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/O Code)
 Active Users - Active Members Record?
 New Topic  Reply to Topic
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 2

MarkJH
Senior Member

United Kingdom
1722 Posts

Posted - 03 January 2005 :  05:01:07  Show Profile  Visit MarkJH's Homepage  Reply with Quote
I was wondering if it was possible to change the way Active Users works so that it displays the record Active Members as well as record Active Users.

Something like this:

Active Members: 10 | Guests: 54 | Total: 64
Active Members Record: 25 | Record Set On: 14 Dec 2004 at 15:09:22
Active Users Record: 189 | Record Set On: 19 Dec 2004 at 22:54:48

How could it be done?<

Bandlink.net - http://www.bandlink.net/
Bandlink Music Forums - http://www.bandlink.net/forum/

masterao
Senior Member

Sweden
1678 Posts

Posted - 03 January 2005 :  14:34:33  Show Profile  Visit masterao's Homepage  Reply with Quote
That would require two additional fields in the new_config table, one for storing the record and one for storing the date. You would also need two new application variables to display the Active Member record and the date it was set on. Finally you need a new function to check if a new record is set. You should be able to create the new function by using the function which checks for a new record of Active Users (function chkAURecord).<

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

MarkJH
Senior Member

United Kingdom
1722 Posts

Posted - 03 January 2005 :  14:40:02  Show Profile  Visit MarkJH's Homepage  Reply with Quote
Not as easy as I'd hoped, then!<

Bandlink.net - http://www.bandlink.net/
Bandlink Music Forums - http://www.bandlink.net/forum/
Go to Top of Page

masterao
Senior Member

Sweden
1678 Posts

Posted - 04 January 2005 :  15:03:54  Show Profile  Visit masterao's Homepage  Reply with Quote
If I had some free time I would do it for you, but unfortunately I don't have that at the moment.

Im not aware of how comfortable you are with coding, but it shouldn't be that difficult. Creating the new function can be daunting, but if you use the current function which checks for record active users as basis, it should be doable.<

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

MarkJH
Senior Member

United Kingdom
1722 Posts

Posted - 04 January 2005 :  19:04:16  Show Profile  Visit MarkJH's Homepage  Reply with Quote
I'm a cut-and-paste coder at best, Jan. I see what you are saying and I think I see how it can be done... without too much ASP knowledge. If I can set aside some time, I'll see if I can create the MOD. Would make a nice addition to the AU MOD, IMHO.

To be honest, I think I'm more scared about messing up the tables!<

Bandlink.net - http://www.bandlink.net/
Bandlink Music Forums - http://www.bandlink.net/forum/
Go to Top of Page

masterao
Senior Member

Sweden
1678 Posts

Posted - 05 January 2005 :  08:33:07  Show Profile  Visit masterao's Homepage  Reply with Quote
Just remember to backup the files and add one piece of code at a time. That way you can see if a table gets out of its borders.

If you get stuck and need help, post here and I will help you.<

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

MarkJH
Senior Member

United Kingdom
1722 Posts

Posted - 05 January 2005 :  11:39:08  Show Profile  Visit MarkJH's Homepage  Reply with Quote
Actually, I was referring to the new_config table in the database. <

Bandlink.net - http://www.bandlink.net/
Bandlink Music Forums - http://www.bandlink.net/forum/
Go to Top of Page

masterao
Senior Member

Sweden
1678 Posts

Posted - 06 January 2005 :  09:21:35  Show Profile  Visit masterao's Homepage  Reply with Quote
Oh, ok .

Adding those isn't too difficult, as you can use the alternative mod setup. The code needed would be something like this:

[INSERT]
CONFIG_NEW
(C_VARIABLE,C_VALUE)#('intAUMeRecord','0')
(C_VARIABLE,C_VALUE)#('strAUMeRecordDate','11111111111111')
[END]

That assumes that you name the new variables intAUMeRecord and strAUMeRecordDate.<

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

MarkJH
Senior Member

United Kingdom
1722 Posts

Posted - 07 January 2005 :  12:18:22  Show Profile  Visit MarkJH's Homepage  Reply with Quote
Okay, I've got so far but I've hit a wall.

I've created a new function in inc_func_common called chkAUMeRecord:

function chkAUMeRecord(intTotalActiveMembers)
  if cInt(intTotalActiveMembers) > cInt(intAUMeRecord) then 'We have a new record!!! :)
    'Check to see if it *Really* is a record, or if Application varaibles just got reset
	strSql = "SELECT C_VALUE FROM " & strTablePrefix & "CONFIG_NEW WHERE C_VARIABLE = 'intAUMeRecord'"
	set rs = my_conn.execute (strSql)
	intOldMeRecord = cint(rs("C_VALUE"))
	rs.close
	set rs = nothing
	if cInt(intOldMeRecord) > cInt(intTotalActiveMembers) then
	  'Oopsi, this was a false alarm
	  strSql = "SELECT C_VALUE FROM " & strTablePrefix & "CONFIG_NEW WHERE C_VARIABLE = 'strAUMeRecordDate'"
	  set rs = my_conn.execute (strSql)
	  strOldMeDate = rs("C_VALUE")
	  rs.close
	  set rs = nothing
      Application(strCookieURL & "INTAUMERECORD") = intOldMeRecord
      Application(strCookieURL & "STRAUMERECORDDATE") = strOldMeDate
      intAUMeRecord = intOldMeRecord
      strAUMeRecordDate = strOldMeDate
	else
      my_conn.execute ("UPDATE " & strTablePrefix & "CONFIG_NEW SET C_VALUE = '" & cstr(intTotalActiveMembers) & "' WHERE C_VARIABLE = 'intAUMeRecord'")
      my_conn.execute ("UPDATE " & strTablePrefix & "CONFIG_NEW SET C_VALUE = '" &DateToStr(strForumTimeAdjust) & "' WHERE C_VARIABLE = 'strAUMeRecordDate'")
      intAUMeRecord = intTotalActiveMembers
      strAUMeRecordDate = DateToStr(strForumTimeAdjust)
      Application(strCookieURL & "INTAUMERECORD") = intTotalActiveMembers
      Application(strCookieURL & "STRAUMERECORDDATE") = DateToStr(strForumTimeAdjust)
	end if
  end if
end function


In inc_activeusers I've created a new variable called intTotalActiveMembers which is basically intTotalActiveUsers without adding the guests. Therefore, I've changed the code thus:

'## Ls3k - Now lets count those peskey guests.
strSql = "SELECT COUNT(AU_IP) AS CNT FROM " & strTablePrefix & "ACTIVE_USERS WHERE MEMBER_ID = -1"
set rs = my_conn.execute (strSql)
intActiveGuests = rs("CNT")
rs.close
set rs = nothing
intTotalActiveMembers = intTotalActiveUsers
intTotalActiveUsers = intTotalActiveUsers + intActiveGuests


I've added the call to the function to check the record:

'## Ls3k - Ok, now it is time to check the record, cause it would be cool if we broke it!
chkAUMeRecord(intTotalActiveMembers)
chkAURecord(intTotalActiveUsers)


I've added a new line of code to the stats which displays the new active members record like this:

if (strAUAdminColor <> "" or strAUModColor <> "") AND intActiveMembers > 0 then
      response.write "                  [ <font color=""" & strAUAdminColor & """>" & fLang(strLangMOD_Ls3kAU_00050) & "</font> | <font color=""" & strAUModColor & """>" & fLang(strLangMOD_Ls3kAU_00060) & "</font> ]" & VBNewLine
    end if
    response.write "            <br>" & VBNewLine & _
                   "            " & fLang(strLangMOD_Ls3kAU_00120) & ": " & intAUMeRecord & " | " & fLang(strLangMOD_Ls3kAU_00080) & ": " & ChkDate(strAUMeRecordDate," " & fLang(strLangMOD_Ls3kAU_00090) & " ",true) & VBNewLine & _
                   "            <br>" & VBNewLine & _
                   "            " & fLang(strLangMOD_Ls3kAU_00070) & ": " & intAURecord & " | " & fLang(strLangMOD_Ls3kAU_00080) & ": " & ChkDate(strAURecordDate," " & fLang(strLangMOD_Ls3kAU_00090) & " ",true) & VBNewLine & _
                   "        </td>" & VBNewLine & _
                   "      </tr>" & VBNewLine & _
                   "      <tr>" & VBNewLine & _
                   "        <td class=""forumheader"" colspan=""" & sGetColspan(6,5) & """>" & VBNewLine & _
                   "            " & fLang(strLangMOD_Ls3kAU_00100) & ": "


(strLangMOD_Ls3kAU_00120 = "Active Members Record: ")

I've added the new variables to the CONFIG_NEW table in the database using the alternative mod setup as you suggested, and checking the database, they are being populated with the members record and time of record.

BUT, the results are not showing up on default.asp. All I'm getting is "Active Members Record: | Record Set On: "

I think I'm close but can you see where I've gone wrong?<

Bandlink.net - http://www.bandlink.net/
Bandlink Music Forums - http://www.bandlink.net/forum/

Edited by - MarkJH on 07 January 2005 12:20:23
Go to Top of Page

masterao
Senior Member

Sweden
1678 Posts

Posted - 07 January 2005 :  19:43:18  Show Profile  Visit masterao's Homepage  Reply with Quote
That seems correct. Have you added the two new fields into the database? Have you also added the variables into config.asp? I suspect that it is the last that you haven't done yet, which would explain why the new record and date isn't showing. If it isn't added in config.asp, the variables aren't populated.<

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

MarkJH
Senior Member

United Kingdom
1722 Posts

Posted - 08 January 2005 :  05:11:48  Show Profile  Visit MarkJH's Homepage  Reply with Quote
It was the latter.

Something still isn't right, though. It's telling me that the active members record is 87! My forum's popular but not that popular!

There must still be some kind of error somewhere...<

Bandlink.net - http://www.bandlink.net/
Bandlink Music Forums - http://www.bandlink.net/forum/
Go to Top of Page

MarkJH
Senior Member

United Kingdom
1722 Posts

Posted - 08 January 2005 :  11:50:31  Show Profile  Visit MarkJH's Homepage  Reply with Quote
I deleted and added again the two new fields in the database. Currently, I have 6 members online and the record is also 6. Going to keep an eye on it.<

Bandlink.net - http://www.bandlink.net/
Bandlink Music Forums - http://www.bandlink.net/forum/
Go to Top of Page

masterao
Senior Member

Sweden
1678 Posts

Posted - 08 January 2005 :  17:45:36  Show Profile  Visit masterao's Homepage  Reply with Quote
I suspected that . Im glad you got it running.<

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

MarkJH
Senior Member

United Kingdom
1722 Posts

Posted - 08 January 2005 :  20:59:21  Show Profile  Visit MarkJH's Homepage  Reply with Quote
Thanks for the guidance, Jan! Yes, it looks like it's working perfectly now. <

Bandlink.net - http://www.bandlink.net/
Bandlink Music Forums - http://www.bandlink.net/forum/
Go to Top of Page

jonaldjustine
Starting Member

Philippines
17 Posts

Posted - 13 August 2005 :  03:13:39  Show Profile  Visit jonaldjustine's Homepage  Send jonaldjustine a Yahoo! Message  Reply with Quote
surely there's something wrong:



can you help me fix it?<

"Remember that the Master of masters is God!"

Edited by - jonaldjustine on 13 August 2005 03:23:43
Go to Top of Page

StephenD
Senior Member

Australia
1044 Posts

Posted - 13 August 2005 :  03:40:03  Show Profile  Send StephenD a Yahoo! Message  Reply with Quote
Did you run audbsetup.asp in the readme file for this mod?<
Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Next Page
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.22 seconds. Powered By: Snitz Forums 2000 Version 3.4.07