Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: MOD Implementation
 Need an expert on Active Users Mod!
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

lovduv
Starting Member

40 Posts

Posted - 12 April 2007 :  17:03:44  Show Profile
I am wondering if I can add the rest of the pages on my site for the current page column. View the source for the function "what page" here.

I think I can add most pages in the case statement, but what about a page like listing.aspx?listing=mylisting, that has a querystring? I am guessing I will have to add a query, but i am not sure on the structure? I just need a nunge in the right direction.

MarcelG
Retired Support Moderator

Netherlands
2625 Posts

Posted - 13 April 2007 :  03:43:05  Show Profile  Visit MarcelG's Homepage
Have you tried case = "listing.aspx?listing=mylisting" ?

portfolio - linkshrinker - oxle - twitter
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 13 April 2007 :  04:30:48  Show Profile
To add new pages to active_users.asp, find the WhatPage function at the end of the file (line 340 in v4.0.18). This function has 2 arguments; fScript which is the name of the script (in your example, listing.aspx) abd fQ which is the entire querystring (in your example, listing=mylisting). To simply add a new page, that won't have a querystring, simply add a new case to the select case statement as follows:
case "listing.aspx"
	strPage=strPage&"Your title here"
If you want to return a different title, depending on values passed through the querystring then you will need to use the analyzeQuery function and nest another select case within that case, like so:
case "listing.aspx"
	strQuery=fQuery
	strListing=analyzeQuery(strQuery,"listing")
	select case strListing
		case "mylisting"
			strPage=strPage&"My listing"
		case "yourlisting"
			strPage=strPage&"Your listing"
		case else
			strPage=strPage&"Generic title"
	end select
You can keep nesting select case statements in this way, if you have more than one variable beaing passed through the querystring. Each time you do so, though, make sure you reassign the fQuery value to the strQuery variable before passing it through analyzeQuery.

Finally, if you just want to show the title of the page, without providing a link, edit the if statement at the end of the WhatPage function, to include a check for the script's name:
if lcase(instr(fscript, "admin_")) > 0 or fscript="listing.aspx" then

Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page

lovduv
Starting Member

40 Posts

Posted - 14 April 2007 :  12:57:12  Show Profile
Would that apply to pages outside the forum as well?

This is the case statement for active.asp:

case "active.asp"
strPage = strPage & fLang(strLangMOD_Ls3kAU_01160)


I am trying to add my home page outside the forum, index.asp, I tried this:

case "../index.asp"
strPage = strPage & "Home"


but it didn't work. What am I missing, I assume it has to do with fLang(strLangMOD_Ls3kAU_01160)?

Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 16 April 2007 :  04:23:33  Show Profile
To do that requires some pretty extensive modifications. Besides adding all the necessary active users functions in your non-forum pages, you'll also need to modify the database, to store directory names, and the code, to check the directory names.


Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page

lovduv
Starting Member

40 Posts

Posted - 16 April 2007 :  09:36:16  Show Profile
yikes! nope not wanting to do that. So heres a question, which Marcel has already done. How can I as painlessly as possible, change the default.asp into my home page and create a new forum home page or default.asp.

How much relies on default.asp? I mean would it be as simple as renaming my files or is there extensive code changes as well?



Go to Top of Page

AnonJr
Moderator

United States
5768 Posts

Posted - 16 April 2007 :  09:51:20  Show Profile  Visit AnonJr's Homepage
I renamed default.asp to forum_home.asp, and if memory serves there were a few references in (the now named) forum_home.asp that needed to be changed, and I thin there were a few other references in topic.asp and forum.asp. Those would be the important ones I can remember. You may find others scattered here and there where you will have to decide on a case-by-case basis if you really want/need to change it.

Some quality time with your favorite editor's "Find and Replace" will make this a relatively painless endeavor, and shouldn't take more than a couple hours - if that long.
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 16 April 2007 :  09:52:54  Show Profile
It's as easy as renaming default.asp. Of course, then you have to change all links in all other files to reflect this change, which can be slightly time consuming if you're not overly familiar with Snitz.


Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page

MaD2ko0l
Senior Member

United Kingdom
1053 Posts

Posted - 16 April 2007 :  10:00:50  Show Profile  Visit MaD2ko0l's Homepage
this is the program i used to change default.asp to allforums.asp Search and replace 98 it will do all files in a given folder. it will take seconds to do it all and will make it hassel free

hope this helps

© 1999-2010 MaD2ko0l
Go to Top of Page

lovduv
Starting Member

40 Posts

Posted - 16 April 2007 :  13:27:54  Show Profile
Thanks for the great advice guys! The program was extremely helpful MaD2ko0l, I was done in minutes and everything seems to be working.

Back to adding pages to active_users.asp....

this part of the above code:
& fLang(strLangMOD_Ls3kAU_01160)

The number 01160 goes up with every page in the case statement. Do I need to add this to the pages I add in the case statement?

Edited by - lovduv on 16 April 2007 13:32:01
Go to Top of Page

MaD2ko0l
Senior Member

United Kingdom
1053 Posts

Posted - 16 April 2007 :  14:33:33  Show Profile  Visit MaD2ko0l's Homepage
& fLang(strLangMOD_Ls3kAU_01160)
this bit of code is used with the internationalized version of snitz

if you look in the lang files/folder u will see somthign like this


'###### Ls3k - Inc_Activeusers.asp ######'
strLangMOD_Ls3kAU_00000 = "Active Users"
strLangMOD_Ls3kAU_00001 = "Board Statistics"
strLangMOD_Ls3kAU_00002 = "Expand Active Users"

the code that u specifyed is this

strLangMOD_Ls3kAU_01160 = "Active Topics"


basically when these flang code is specifyed it will display some text
so if you wanted to use a different language all the numbers will be the same but the text that it outputs will be a different language


this code can be written like this

case "active.asp"
strPage = strPage & "Active Topics"



i think that made sense

© 1999-2010 MaD2ko0l
Go to Top of Page

lovduv
Starting Member

40 Posts

Posted - 16 April 2007 :  15:02:33  Show Profile
So basically if I do not need a language besides english, I don't need to add this & fLang(strLangMOD_Ls3kAU_

I will give it a try!
Go to Top of Page

lovduv
Starting Member

40 Posts

Posted - 16 April 2007 :  15:29:45  Show Profile
Ok, I tried to add code for my about.asp page, I added the code below in red right above the first case active.asp

It's not working...yet...is this possibly a cookie clearing issue?

select case lcase(trim(fScript))
case "about.asp"
strPage = strPage & "All about us!"

case "active.asp"
strPage = strPage & fLang(strLangMOD_Ls3kAU_01160)
Go to Top of Page

MaD2ko0l
Senior Member

United Kingdom
1053 Posts

Posted - 16 April 2007 :  17:23:38  Show Profile  Visit MaD2ko0l's Homepage
that should work fine...that is the exact code i use...have u included the forums inc_header/config/inc_footer into the about.asp page?

© 1999-2010 MaD2ko0l
Go to Top of Page

lovduv
Starting Member

40 Posts

Posted - 16 April 2007 :  19:57:55  Show Profile
Well no I don't....

That did it allright!

Thanks for the help!!
Go to Top of Page

MaD2ko0l
Senior Member

United Kingdom
1053 Posts

Posted - 17 April 2007 :  10:37:19  Show Profile  Visit MaD2ko0l's Homepage
no worries...glad you got it sorted eventually ;-)

© 1999-2010 MaD2ko0l
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.42 seconds. Powered By: Snitz Forums 2000 Version 3.4.07