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

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/Code)
 Active Users Mod: Page Specific (ie who's in chat)
 New Topic  Topic Locked
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 2

Wizz
New Member

United Kingdom
70 Posts

Posted - 17 April 2003 :  17:16:57  Show Profile
I've finally managed to get the AU mod (a long winded way). I have setup up perfect and it runs smooth and without errors.

I have administered the setup so that the Active Users Panel is not displayed on my forums default.asp page. (im glad that option exists).

I've taken advantage of hiding the panel so that I can use a link on my site that will go directly to the active_users.asp page!

however, i would like to create a very basic few lines of code that I can use as an include file which i will put on my main sites default.asp page. My intentions are to simply make it say:

"Why not join these users in the chat room: jim, john, wizz, etc"

i have my site fully integrated to use the snitz database and everything works brilliant and seamlessly.

Can someone help me write the code im refering too?

Ive noticed that
WhatPage(strLastPage,strQS)
records the page name a user is on and that the following code gets the members information:

I removed the code here cause It *was* stretching the tables (also its no longer needed too)

and also, nobody can access anypage because all pages on my site require you to login, plus im not allowing non-logged in users to access the forum neither. So therefore I dont need to worry about any coding to detect guests.

this is what ive come up with in theory so far:

I removed the code here cause It *was* stretching the tables (also its no longer needed too)

*was* - masterao's code snip is keeping the table out of proportion now, lol. (nothing to do with me - sorry, thats my sense of humor!)

www.promotioncity.co.uk - A cost effective solution for Promoters, DJ's and MC's. Clubbing Pics, Chat, Forums, Raving/Clubbing Guide, A-Z Clubs & Winebars listing etc + much more!

Edited by - Wizz on 18 April 2003 22:16:16

Wizz
New Member

United Kingdom
70 Posts

Posted - 17 April 2003 :  18:22:00  Show Profile
ok, i know that was a rather long post/question, so i decided to tackle it face on and it seems to be going well, after a few fixed errors in my poor coding.

Anyhow, could someone explain to me how the WhatPage() funtion works please? i just need to adjust it so that i can do something like
if whatPage(value,value) = "chatroom.asp" then blah blah
and my 2nd and last question is that for some reason the code cant find the database connection my_conn (but ive included the inc_func_common.asp and config.asp so whats happeneing?

Please give me some light?

www.promotioncity.co.uk - A cost effective solution for Promoters, DJ's and MC's. Clubbing Pics, Chat, Forums, Raving/Clubbing Guide, A-Z Clubs & Winebars listing etc + much more!
Go to Top of Page

masterao
Senior Member

Sweden
1678 Posts

Posted - 17 April 2003 :  19:53:39  Show Profile  Visit masterao's Homepage
In short, it will display a name for the page you are visiting, instead for using the page's actual name (for example, Active Users instead for active_users).

Regarding your 2nd question, have you closed my_Conn before the AU-code runs?

Jan
===========
FR Portal Forums | Active Users 4.0.20 Mod
Go to Top of Page

Wizz
New Member

United Kingdom
70 Posts

Posted - 17 April 2003 :  20:00:13  Show Profile
just a quick reply:

when I reply to posts here at the snitz forum, is there a way to embedd a <textarea> box instead? cause im sure ive seen it somewhere in someone elses posts.

I would make things a lot less scary for those who dont like seeing loads of lines of code in a reply message.

www.promotioncity.co.uk - A cost effective solution for Promoters, DJ's and MC's. Clubbing Pics, Chat, Forums, Raving/Clubbing Guide, A-Z Clubs & Winebars listing etc + much more!
Go to Top of Page

Wizz
New Member

United Kingdom
70 Posts

Posted - 17 April 2003 :  23:17:57  Show Profile
Ok, I beleive I almost got this sussed, however I have 2 annoying problems im trying to solve.

my rewritten active_users.asp (called au.asp) resides in my root directory (not the forum) but im using virtual includes like forum/config.asp etc. my sites default.asp file (obviosly in the root) simply uses an <!--#include file=au.asp-->.

1) Some type of "are you logged in" check is happeninging in the au.asp because when i got to the site, i get redirected to my login.asp page, if i login, then i can access the /default.asp page without a problem, and the active users status is display as expected at the bottom of the page. So why do you think this is? anyone?

2) Instead of using the WhatPage() function, im just simply doing:
if strLastPage = "newchat.asp" then
blah blah blah
end if
newpage.asp is the name of my chat room. My problem is that the active user output isn't changing as expected in this instance, so I wanted to see what the database was getting at this moment in time, and so I downloaded the database and looked at the FORUM_ACTIVE_MEMBERS table, at the AU_LASTPAGE and it had default.asp written in the field for 1 user (me). default.asp was not the lastpage, chat.asp should be, so do i need to include the code to update the database from the newchat.asp page?

I'd appriciate any help.

The current code im using can be downloaded here: http://www.mixologist.co.uk/au.txt (i've clearly debugged it for easy understanding.)

-WizzKidd

www.promotioncity.co.uk - A cost effective solution for Promoters, DJ's and MC's. Clubbing Pics, Chat, Forums, Raving/Clubbing Guide, A-Z Clubs & Winebars listing etc + much more!
Go to Top of Page

masterao
Senior Member

Sweden
1678 Posts

Posted - 18 April 2003 :  06:20:24  Show Profile  Visit masterao's Homepage
Im sure that the login-check is done in inc_header_strip.asp. The reason you have to login to view to the default.asp page is because you have activated require login to view forum.

The following code is the one which checks if you are logged in and redirects you to login.asp:


if strRequireReg = "1" and strDBNTUserName = "" then
	if not Instr(strScriptName,"policy.asp") > 0 and _
	not Instr(strScriptName,"register.asp") > 0 and _
	not Instr(strScriptName,"password.asp") > 0 and _
	not Instr(strScriptName,"faq.asp") > 0 and _
	not Instr(strScriptName,"login.asp") > 0 then
		scriptname = split(request.servervariables("SCRIPT_NAME"),"/")
		if Request.QueryString <> "" then
			Response.Redirect("login.asp?target=" & lcase(scriptname(ubound(scriptname))) & "?" & Request.QueryString)
		else
			Response.Redirect("login.asp?target=" & lcase(scriptname(ubound(scriptname))))
		end if
	end if
end if

Jan
===========
FR Portal Forums | Active Users 4.0.20 Mod
Go to Top of Page

Wizz
New Member

United Kingdom
70 Posts

Posted - 18 April 2003 :  13:28:41  Show Profile
Just got back from work,

Im sure a Page Specific option in the Active Users mod would be great and widley used (so long as site integration is being used, otherwise theres no point). Im creating this script only for my site, and i have no experience in building snitz mods (even though i do have some idea off what it'd entail).

I can just visualise the active mod: page specifiy mod extra...

Config Active Users
  -List of Watched Channels
  -Add New Channel to Watch
     -Channel Name
     -Enable Display IP
     -Enable Display Idle Time
  -Remove Channel to Watch

Then a Page Specific type of active users pannel can show something like (depending on selected channels to watch):

Members in Chat: 3
Members in Forum: 7
Members in Downloads: 2
Total Members throughout site: 12

www.promotioncity.co.uk - A cost effective solution for Promoters, DJ's and MC's. Clubbing Pics, Chat, Forums, Raving/Clubbing Guide, A-Z Clubs & Winebars listing etc + much more!
Go to Top of Page

Wizz
New Member

United Kingdom
70 Posts

Posted - 18 April 2003 :  16:54:23  Show Profile
Hi, I've stumbled again,

I modified my version of the inc_header.asp (inc_header_strip.asp) to remove the login check and it works smoothly, and doesn't affect my forums pages neither, cause they still use the original inc_header.asp

I can access the /default.asp without the redirection problem and the output to the screen is as expected, however my problem now is that the values are not being locked, because i am using normal variables and not application variables (which im not sure how to use)

It appears that snitz use it in the config.asp page. It appears that the appropite value is pulled from a cookie (preset somewhere, i dont know where though), and then that value is the application variables name - which is then put into a normal variable. So that whenever config.asp is used, it seems to be keeping the application variable and normal variable uptodate.

How can i implement this into my 3 variables:

intTotalActiveUsers
intTotalChatUsers
strUsersListHTML

so that these variables stay locked, and timeout according to the value set in the Active Users admin configuration?

Please advise.

Reference:
My /default.asp uses this to call the au.asp page:

    <!--#INCLUDE VIRTUAL="forum/config.asp" -->
    <!--#INCLUDE VIRTUAL="forum/inc_func_common.asp" -->
    <!--#INCLUDE VIRTUAL="forum/inc_func_secure.asp" -->
    <!--#INCLUDE VIRTUAL="forum/inc_sha256.asp" -->
    <!--#INCLUDE VIRTUAL="forum/inc_header_strip.asp" -->
    <%
      AUHandleLoging() 
      ActiveUserTracker()
    %>
    <font color="#ffffff" face="arial" size="2">
    <!-- #INCLUDE FILE="au.asp" -->
    </font>


And my /au.asp file is here (.txt)

www.promotioncity.co.uk - A cost effective solution for Promoters, DJ's and MC's. Clubbing Pics, Chat, Forums, Raving/Clubbing Guide, A-Z Clubs & Winebars listing etc + much more!
Go to Top of Page

masterao
Senior Member

Sweden
1678 Posts

Posted - 18 April 2003 :  20:26:47  Show Profile  Visit masterao's Homepage
Im not able to help you with the customization of AU, although there may be others who might be able to help you.

AU doesn't use application variables to save the current active users, it uses normal variables with values fetched from the db. It does use application variables to save the configuration values, but nothing else.

You are fetching the current online members from the database, but you don't have any code which removes members who have been idle for longer than the timeout value. The following lines does that in the active users mod. That sub is in inc_func_common.asp, so it should work ok for you. You should add those lines before you count the number of members online.


'## Ls3k - Before we can do anything we need to get rid of those slackers who have left ;)
deleteInactiveUsers()

Jan
===========
FR Portal Forums | Active Users 4.0.20 Mod
Go to Top of Page

Wizz
New Member

United Kingdom
70 Posts

Posted - 18 April 2003 :  21:12:47  Show Profile
I appriciate the help youve given me so far, thanks a lot. Know of anyway I can encourage Nathan or some of the people who know about this script to help me out? (i wont email them, cause they probably get thousands of people emailing them saying "look at my question, can u help")

With regards to the deleteInactive() users function, I do call it in my au.asp page like the active_users.asp page does too. So that wont be the problem.

And regarding the script not using application variables. In that case I must have to store the names, and totals to the database, and use INSERT statements to keep updating the database perhaps. I'll give this a go and see where it gets me.

Thanks again, P.S: Put the word out for me that im struggling with this one, cheers!

-WizzKidd

www.promotioncity.co.uk - A cost effective solution for Promoters, DJ's and MC's. Clubbing Pics, Chat, Forums, Raving/Clubbing Guide, A-Z Clubs & Winebars listing etc + much more!
Go to Top of Page

Wizz
New Member

United Kingdom
70 Posts

Posted - 18 April 2003 :  22:11:18  Show Profile
Ok, ive come to the conclusion now that I have alot of understanding (or so I think) of the AU mod, that I will just simply create a couple files and extra tables/fields in the database to manage the number and names of the users in my newchat.asp page

Could someone perhaps help me get this right in theory?
So far this is my theory:

modify database.mdb:
  • Create a table called FORUM_CHAT_USERS
  • Create fields REFID and MEMBERS_ID
  • Link the MEMBERS_ID to the FORUM_MEMBERS's MEMBERS_ID field(i dont know how to do this, help?)
newchat.asp:
  • Include code at the top of my chatroom page to add the users MEMBER_ID number into the FORUM_CHAT_USERS's table MEMBER_ID field
chat_au.asp:
  • Count how many chat users are in the chat room using SQL COUNT(REFID)
  • Gather the details of all these users from the database using SELECT (im not sure how to grab a linked tables values, help?)
  • Write the usernames to the screen with their names as hyperlinks to their profile (pop_profile.asp?mode=display&id=...)
Im sure theres a few things I missed out and a few things I should consider, but this is where I would like anyones input.

3rd time lucky i guess.... (or is that 8th, ot 9th, lol)

-WizzKidd

www.promotioncity.co.uk - A cost effective solution for Promoters, DJ's and MC's. Clubbing Pics, Chat, Forums, Raving/Clubbing Guide, A-Z Clubs & Winebars listing etc + much more!

Edited by - Wizz on 18 April 2003 22:19:47
Go to Top of Page

masterao
Senior Member

Sweden
1678 Posts

Posted - 19 April 2003 :  07:35:47  Show Profile  Visit masterao's Homepage
I must have missed the deleteInActiveUsers() sub when I checked au.asp.

You shouldn't need to add a new table to accomplish what you are after. Exactly what happens when you use the current code?

Jan
===========
FR Portal Forums | Active Users 4.0.20 Mod
Go to Top of Page

Wizz
New Member

United Kingdom
70 Posts

Posted - 19 April 2003 :  16:34:50  Show Profile
My current code does the followinh:

when you visit my site you obviously enter the /default.asp page, and at the bottom of the page the following is shown:
There are 0 people on this site, and nobody in the chatroom.

(at this point the database.mdb has one record in it with a -1 value)

if you try to go to any page (apart from my /login.asp or the /forum/register.asp pages) you are prompted to login, cause only members are allowed to access the site - and your directed to the /login.asp page (a modified version of the /forum/login.asp).

when you log-in successfully, you are redirected to the /default.asp page (and the loggedin session variable is set to "true" - this controls whether or not you can access the pages)

(at this point the database.mdb has one record in it with a 1 value)

the /default.asp page now displays at the bottom of the page the following:
There is 1 person on this site, and nobody in the chatroom.

at this point i can access the newchat.asp page (because the session loggedin is set to "true"). now, i decide to check if the intTotalChatUsers variable has incremented by opening a new browser window, and goto the site, but the /default.asp page says:
There are 0 people on this site, and nobody in the chatroom.

so, this means 3 things to me. 1, the variables are getting reset to 0 on the page. 2, the variable is not being stored, and 3, the newchat.asp page doesn't do anything in order to update the variable (or) the au.asp's code starting if strLastPage = "newchat.asp" then is doing its job.

So theres the overview of whats actually happening/whats not happening!

-WizzKidd

www.promotioncity.co.uk - A cost effective solution for Promoters, DJ's and MC's. Clubbing Pics, Chat, Forums, Raving/Clubbing Guide, A-Z Clubs & Winebars listing etc + much more!
Go to Top of Page

masterao
Senior Member

Sweden
1678 Posts

Posted - 19 April 2003 :  17:15:18  Show Profile  Visit masterao's Homepage
Ok, I see what you have missed. If you load default.asp in a new page, AU will track that change and you are thus no longer in newchat.asp. To test this yourself, you need to use another browser than your normal, login with a test account and go to the chat section. Open your normal browser and go to default.asp (with your normal login) and you will see that there is one member in the chat area.

Another way to test this is to get one of your members to go the chat while you check default.asp.

Jan
===========
FR Portal Forums | Active Users 4.0.20 Mod
Go to Top of Page

Wizz
New Member

United Kingdom
70 Posts

Posted - 20 April 2003 :  22:36:09  Show Profile
I reverted to starting again using the original active_users.asp page (renamed to au.asp and stored in the root folder), i just stripped out all the tables and font colors and all those extras. Everything is the same as the original apart from the visual output, i just used linebreaks instead of tables and colums etc.

Im still calling the page from my /default.asp therefore i still use an include on the /default.asp page to include my au.asp page. And the au.asp page use virtual includes to include the necessary files from the /forum/ directory.

i forgot to mention that i cleaned up the au.asp page so that it doesn't have any code/functions that are not required, and also i removed the if statements that check for bolAUUA, bolAUIP and bolAULocal and just hardcoded it so that bolAULocal is always true. (i dont wish to be able to administrate over this.) I am using a modified version of the inc_header.asp (inc_header_stip.asp) which also has all the tables and forms stripped out so that my au.asp page display anything other than what ive told it to response.write!

Lastly, i have slightly changed the WhatPage() function so that it only searches for cases of case "newchat.asp" and case else (which does the strPage = strPage & Mid(fScript, 1, instr(fScript, ".")-1) code). (remember this is going to refer to pages in the root)

So my position is, everything is neat, tidy and clean. When im not logged in, i get a nice output (which i'll midify the design later) it looks like this:

Total Guests: 1
Guest #1
Page Name: Default
How Long: 3 Minutes

and when 2 people are not logged in then it looks like this:

Total Guests: 2
Guest #1
Page Name: Default
How Long: 3 Minutes

Guest #2
Page Name: Default
How Long: 1 Minutes

BUT, when i log in, the page displays fine, but nothing from the script is shown on the screen. I checked the database, and logged in users are getting the correct <> -1 value, but it seems that the code skips the if rsAM.EOF or rsAM.BOF then section of code for some weird reason. Weird? i thought that if the <> -1 is true then it should go inside the loop. Have i missed something?

Reference: au.asp (.txt)

www.promotioncity.co.uk - A cost effective solution for Promoters, DJ's and MC's. Clubbing Pics, Chat, Forums, Raving/Clubbing Guide, A-Z Clubs & Winebars listing etc + much more!
Go to Top of Page

masterao
Senior Member

Sweden
1678 Posts

Posted - 21 April 2003 :  05:34:11  Show Profile  Visit masterao's Homepage
Im not sure what the error is, but can you test this?

Put Response.write intTotalActiveMembers before response.write "<!--// output starts from here //-->". That way, you can see directly on the page that it is counting members.

Also put rsAM.MoveFirst before do until rsAM.EOF, in case the recordset is at the end when it starts to loop.

Jan
===========
FR Portal Forums | Active Users 4.0.20 Mod
Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Next Page
 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.3 seconds. Powered By: Snitz Forums 2000 Version 3.4.07