Author |
Topic  |
|
indianBoy
New Member

56 Posts |
Posted - 10 August 2003 : 01:14:59
|
I installed active users mod vs. 4.0.17 on Snitz Forums 2000 Version 3.4.03.
I want to display the same statistics which show on the default.asp page regarding the active users on a page outseide the forum directory.
I tried to do it myself but couldnt do it. i followed te following steps :
included files : inc_activeusers.asp and config.asp and one or two other files which helped me eliminate certain other errors.
in the end i get strCookieURL no defined on the external page.
plz help!!!!!
|
|
mortioli
Average Member
  
United Kingdom
898 Posts |
Posted - 10 August 2003 : 06:02:34
|
I made a file called inc_header_site.asp and included these on my site...
<!--#INCLUDE virtual="forum/config.asp"--> <!--#INCLUDE virtual="forum/inc_sha256.asp"--> <!--#INCLUDE virtual="forum/inc_header_site.asp"-->
My inc_header_site.asp looks like this (with the active users part in red)...it does have the full copyright in the file (I've just shortened it for this)...
quote:
<% '################################################################################# '## Copyright (C) 2000-02 Michael Anderson, Pierre Gorissen, '################################################################################# %> <!--#INCLUDE FILE="inc_func_common.asp" --> <% strArchiveTablePrefix = strTablePrefix & "A_" scriptname = split(request.servervariables("SCRIPT_NAME"),"/")
set my_Conn= Server.CreateObject("ADODB.Connection") my_Conn.Open strConnString
strDBNTUserName = Request.Cookies(strUniqueID & "User")("Name") strDBNTFUserName = trim(chkString(Request.Form("Name"),"SQLString")) if strDBNTFUserName = "" then strDBNTFUserName = trim(chkString(Request.Form("User"),"SQLString")) if strAuthType = "nt" then strDBNTUserName = Session(strCookieURL & "userID") strDBNTFUserName = Session(strCookieURL & "userID") end if
chkCookie = 1 mLev = cLng(chkUser(strDBNTUserName, Request.Cookies(strUniqueID & "User")("Pword"),-1)) chkCookie = 0
'## START - REMOVAL, MODIFICATION OR CIRCUMVENTING THIS CODE WILL VIOLATE THE SNITZ FORUMS 2000 LICENSE AGREEMENT Response.Write "<meta name=""copyright"" content=""This Forum code is Copyright (C) 2000-02 Michael Anderson, Pierre Gorissen, Huw Reddick and Richard Kinser, Non-Forum Related code is Copyright (C) " & strCopyright & """>" & vbNewline '## END - REMOVAL, MODIFICATION OR CIRCUMVENTING THIS CODE WILL VIOLATE THE SNITZ FORUMS 2000 LICENSE AGREEMENT
function getFemalesCount dim rs, intFemales, intMales set rs = server.CreateObject("adodb.recordset") strSql = "SELECT COUNT(*) as females FROM " & strMemberTablePrefix & "MEMBERS WHERE m_sex = 'female' and M_NAME not like '%iamviet %'" rs.Open strSql, my_Conn getFemalesCount = rs("females") rs.Close end function
function getMalesCOUNT() dim rs, intFemales, intMales set rs = server.CreateObject("adodb.recordset") strSql = "SELECT COUNT(*) as males FROM " & strMemberTablePrefix & "MEMBERS WHERE m_sex = 'male' and M_NAME not like '%iamviet %'" rs.Open strSql, my_Conn getMalesCount = rs("males") rs.Close end function
function getNoneCOUNT() dim rs, intFemales, intMales set rs = server.CreateObject("adodb.recordset") strSql = "SELECT COUNT(*) as none FROM " & strMemberTablePrefix & "MEMBERS WHERE m_sex = '' and M_NAME not like '%iamviet %'" rs.Open strSql, my_Conn getNoneCount = rs("none") rs.Close end function
dim SQLMemberCount, RSMEmberCount SQLMemberCount = "SELECT COUNT(Member_id) AS MemberCount FROM " & strMemberTablePrefix & "MEMBERS WHERE M_NAME not like '%iamviet %'" Set RSMemberCount = my_Conn.execute(SQLMemberCount) intMemberCount = RSMemberCOUNT("MemberCount") set RSMEmberCount = nothing bolOverride = chkAUPermissions(strAUAnonOverride) bolPanel = chkAUPermissions(strAUPAllow) bolAUPage = chkAUPermissions(strAUAllow)
'## Ls3k - Before we can do anything we need to get rid of those slackers who have left ;) deleteInactiveUsers()
'## Ls3k - Lest first deal with members logged in - for them we need to join with the members table. intTotalActiveUsers = 0 intActiveMembers = 0 intActiveAnonMembers = 0 intActiveGuests = 0
strSql = "SELECT ME.MEMBER_ID, ME.M_NAME, ME.M_AUHIDE, ME.M_LEVEL " & _ "FROM " & strTablePrefix & "ACTIVE_USERS AU, " & strMemberTablePrefix & "MEMBERS ME " & _ "WHERE AU.MEMBER_ID = ME.MEMBER_ID" set rsAM = my_conn.execute (strSql) if rsAM.EOF or rsAM.BOF then rsAM.close set rsAM = nothing else do until rsAM.EOF intTotalActiveUsers = intTotalActiveUsers + 1 if (rsAM("M_AUHIDE")="1" or isNull(rsAM("M_AUHIDE"))) or strAUAnon = 0 or bolOverride then intActiveMembers = intActiveMembers + 1 if strActiveMemberList <> "" then strActiveMemberList = strActiveMemberList & " , " & VBNewLine end if if strUseExtendedProfile then strActiveMemberList = strActiveMemberList & "<a href=""forum/pop_profile.asp?mode=display&id="& rsAM("MEMBER_ID") & """ target=""_blank"">" else strActiveMemberList = strActiveMemberList & "<a href=""JavaScript:openWindow2('forum/pop_profile.asp?mode=display&id=" & rsAM("MEMBER_ID") & "')"">" end if strActiveMemberList = strActiveMemberList & "<font color=""red"">" if rsAM("M_LEVEL") = 2 then strActiveMemberList = strActiveMemberList & "<font color=""" & strAUModColor & """>" elseif rsAM("M_LEVEL") = 3 then strActiveMemberList = strActiveMemberList & "<font color=""" & strAUAdminColor & """>" end if strActiveMemberList = strActiveMemberList & rsAM("M_NAME") if rsAM("M_LEVEL") = 2 or rsAM("M_LEVEL") = 3 then strActiveMemberList = strActiveMemberList & "</font>" end if strActiveMemberList = strActiveMemberList & "</font>" strActiveMemberList = strActiveMemberList & "</a>" else intActiveAnonMembers = intActiveAnonMembers + 1 end if rsAM.movenext loop rsAM.close set rsAM = nothing end if
'## 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 intTotalActiveUsers = intTotalActiveUsers + intActiveGuests
'## Ls3k - Ok, now it is time to check the record, cause it would be cool if we broke it! chkAURecord(intTotalActiveUsers)
visitorIP = Request.ServerVariables("REMOTE_ADDR")
If visitorIP = "62.254.128.6" Then Response.Redirect("http://www.fbi.gov/") %>
The I use this to show how many are online:
Response.Write "<font size=1>Online users: <font color=red size=1>" & intTotalActiveUsers & "</font>"
And this to show who:
<% Response.Write "<font size=1>Members online: <font color=red size=1>"
if intActiveMembers > 0 then
response.write strActiveMemberList & VBNewLine
else
response.write fLang(strLangMod_Ls3kAU_00110) & VBNewLine
end if
Response.Write "</font>" %>
...sorry if I haven't explained that very well 
I use it at the top of this site... www.ckyalliance.co.uk |
 |
|
indianBoy
New Member

56 Posts |
Posted - 10 August 2003 : 13:48:58
|
hi i appreciate a lot for taking out your time and answering to my query. i had done the following things but i couldnt get it to work, so please help. here is my code:
<%@ Language=VBScript%>
<%Option Explicit%>
<!--#INCLUDE file="forum/config.asp"-->
<!--#INCLUDE file="forum/inc_sha256.asp"-->
<!--#INCLUDE file="forum/inc_func_common.asp"-->
<!--#INCLUDE file="forum/inc_adovbs.asp"-->
<%
Dim objConn
Dim objRS1
DIm strSQL
'stuff for the fooking wowbikes
Set objConn=Server.CreateObject("ADODB.Connection")
objConn.Provider="Microsoft.Jet.OLEDB.4.0"
objConn.Open Server.MapPath("yyy.mdb")
strSQL = "SELECT * FROM wowbike"
Dim totalbikes
Set objRS1 = Server.CreateObject("ADODB.Recordset")
objRS1.CursorLocation=3
objRS1.CursorType=2 'adOpenDynamic
objRS1.open strSQL , objConn
totalbikes=objrs1.recordcount
'stuff for the fooking members from forum db
Dim objConnAv
Dim strSQLAv
Dim objRS1Av
Set objConnAv=Server.CreateObject("ADODB.Connection")
objConnAv.Provider="Microsoft.Jet.OLEDB.4.0"
objConnAv.Open Server.MapPath("xxx.mdb")
'calling a query KOOL!
strSQLAv = "SELECT * FROM returnavatars"
Dim totalavatars
Set objRS1Av = Server.CreateObject("ADODB.Recordset")
objRS1Av.CursorLocation=3 'aduseclient
objRS1Av.CursorType=2
objRS1Av.open strSQLAv , objConnAv
totalavatars=objrs1Av.recordcount
'response.write(totalavatars)
'stuff for the fooking top 5 posters
Dim objConnTop5
Dim strSQLTop5
Dim objRS1Top5
Set objConnTop5=Server.CreateObject("ADODB.Connection")
objConnTop5.Provider="Microsoft.Jet.OLEDB.4.0"
objConnTop5.Open Server.MapPath("xxx.mdb")
'calling a query KOOL!
strSQLTop5 = "SELECT * FROM top5posters"
Set objRS1Top5 = Server.CreateObject("ADODB.Recordset")
objRS1Top5.CursorLocation=3
objRS1Top5.CursorType=2
objRS1Top5.open strSQLTop5 , objConnTop5
'stuff for the fooking top 7 recent replies
Dim objConnRecent7
Dim strSQLRecent7
Dim objRS1Recent7
Set objConnRecent7=Server.CreateObject("ADODB.Connection")
objConnRecent7.Provider="Microsoft.Jet.OLEDB.4.0"
objConnRecent7.Open Server.MapPath("xxx.mdb")
'calling a query KOOL!
strSQLRecent7 = "SELECT * FROM top7recentreplies"
Set objRS1Recent7 = Server.CreateObject("ADODB.Recordset")
objRS1Recent7.CursorLocation=3
objRS1Recent7.CursorType=2
objRS1Recent7.open strSQLRecent7 , objConnRecent7
'stuff for the fooking top 7 recent topics
Dim objConnRecenttopics
Dim strSQLRecenttopics
Dim objRS1Recenttopics
Set objConnRecenttopics=Server.CreateObject("ADODB.Connection")
objConnRecenttopics.Provider="Microsoft.Jet.OLEDB.4.0"
objConnRecenttopics.Open Server.MapPath("xxx.mdb")
'calling a query KOOL!
strSQLRecenttopics = "SELECT * FROM recenttopics"
Set objRS1Recenttopics = Server.CreateObject("ADODB.Recordset")
objRS1Recenttopics.CursorLocation=3
objRS1Recenttopics.CursorType=3
objRS1Recenttopics.open strSQLRecenttopics , objConnRecenttopics
bolOverride = chkAUPermissions(strAUAnonOverride)
bolPanel = chkAUPermissions(strAUPAllow)
bolAUPage = chkAUPermissions(strAUAllow)
'## Ls3k - Before we can do anything we need to get rid of those slackers who have left ;)
deleteInactiveUsers()
'## Ls3k - Lest first deal with members logged in - for them we need to join with the members table.
intTotalActiveUsers = 0
intActiveMembers = 0
intActiveAnonMembers = 0
intActiveGuests = 0
strSql = "SELECT ME.MEMBER_ID, ME.M_NAME, ME.M_AUHIDE, ME.M_LEVEL " & _
"FROM " & strTablePrefix & "ACTIVE_USERS AU, " & strMemberTablePrefix & "MEMBERS ME " & _
"WHERE AU.MEMBER_ID = ME.MEMBER_ID"
set rsAM = my_conn.execute (strSql)
if rsAM.EOF or rsAM.BOF then
rsAM.close
set rsAM = nothing
else
do until rsAM.EOF
intTotalActiveUsers = intTotalActiveUsers + 1
if (rsAM("M_AUHIDE")="1" or isNull(rsAM("M_AUHIDE"))) or strAUAnon = 0 or bolOverride then
intActiveMembers = intActiveMembers + 1
if strActiveMemberList <> "" then
strActiveMemberList = strActiveMemberList & " , " & VBNewLine
end if
if strUseExtendedProfile then
strActiveMemberList = strActiveMemberList & "<a href=""forum/pop_profile.asp?mode=display&id="& rsAM("MEMBER_ID") & """ target=""_blank"">"
else
strActiveMemberList = strActiveMemberList & "<a href=""JavaScript:openWindow2('forum/pop_profile.asp?mode=display&id=" & rsAM("MEMBER_ID") & "')"">"
end if
strActiveMemberList = strActiveMemberList & "<font color=""red"">"
if rsAM("M_LEVEL") = 2 then
strActiveMemberList = strActiveMemberList & "<font color=""" & strAUModColor & """>"
elseif rsAM("M_LEVEL") = 3 then
strActiveMemberList = strActiveMemberList & "<font color=""" & strAUAdminColor & """>"
end if
strActiveMemberList = strActiveMemberList & rsAM("M_NAME")
if rsAM("M_LEVEL") = 2 or rsAM("M_LEVEL") = 3 then
strActiveMemberList = strActiveMemberList & "</font>"
end if
strActiveMemberList = strActiveMemberList & "</font>"
strActiveMemberList = strActiveMemberList & "</a>"
else
intActiveAnonMembers = intActiveAnonMembers + 1
end if
rsAM.movenext
loop
rsAM.close
set rsAM = nothing
end if
'## 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
intTotalActiveUsers = intTotalActiveUsers + intActiveGuests
'## Ls3k - Ok, now it is time to check the record, cause it would be cool if we broke it!
chkAURecord(intTotalActiveUsers)
%>
<%
Dim objTools
Dim a
Dim b
Dim randomAvatar
Set objTools = Server.CreateObject("MSWC.Tools")
a=1+(Abs(objTools.Random)) Mod totalbikes
'response.Write(a)
objrs1.Move(a-1)
'response.Write(objRS1("bikename"))
b=1+(Abs(objTools.Random)) Mod 3
'select random record from the avatar query
randomAvatar=1+(Abs(objTools.Random)) Mod totalavatars
objrs1Av.Move(randomAvatar-1)
%>
<HTML>
<HEAD>
<TITLE>1300 CC, 210 Bhp, Just Joking :)</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<script>
function jumpTo(s) {if (s.selectedIndex != 0) location.href = s.options[s.selectedIndex].value;return 1;}
wowbike="<%=objRs1("bikedescription")%>"
helpavatar="Wanna have your avatar loaded up on the front page? Then register on the forums and choose or send in your avatar to sunny@bajajpulsar.com! The avatars displayed are chosen randomly each time you view the page!"
siteoftheweek="<b>Desmoquattro.com</b>, Ducati Unleashed!"
gizmooftheweek="<b>Nokia 5510</b>, Mobile Entertaintment!"
comingSoon="<b>comingSoon!</b>"
forumButton="<b>http://forum.xBhp.com</b>"
fotosButton="<b>http://fotos.xBhp.com</b>"
warmUpButton="<b>http://www.xBhp.com</b>"
</SCRIPT>
<style type="text/css">
<!--
body { scrollbar-face-color: #999999; scrollbar-shadow-color: #666666; scrollbar-highlight-color: #666666; scrollbar-3dlight-color: #666666 scrollbar-darkshadow-color: #999999; scrollbar-track-color: #636363; scrollbar-arrow-color: #ffffff; }
.unnamed1 { text-decoration: none}
.unnamed1 { text-decoration: none}
-->
</style>
</HEAD>
<BODY BGCOLOR=636363 text="#FFFFFF" link="#FFFFFF" vlink="#FFFFFF" alink="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>
<script language="JavaScript" src="overlib.js"><!-- overLIB (c) Erik Bosrup --></script>
<font size="1" face="Verdana, Arial, Helvetica, sans-serif"> </font>
<map name="MapMap">
<area shape="rect" coords="134,11,202,32" href="http://forum.xBhp.com" onMouseOver="return overlib(forumButton,TEXTCOLOR, '#ff6600', TEXTSIZE, 1, WIDTH, 100, HEIGHT, 18,FGCOLOR,'#ffffff')" onMouseOut="return nd();">
<area shape="rect" coords="231,10,302,30" href="http://fotos.xBhp.com" alt="Visuals" onMouseOver="return overlib(fotosButton,TEXTCOLOR, '#ff6600', TEXTSIZE, 1, WIDTH, 100, HEIGHT, 18,FGCOLOR,'#ffffff')" onMouseOut="return nd();">
<area shape="rect" coords="326,11,401,30" href="#" onMouseOver="return overlib(comingSoon,TEXTCOLOR, '#ff6600', TEXTSIZE, 1, WIDTH, 100, HEIGHT, 18,FGCOLOR,'#ffffff')" onMouseOut="return nd();">
<area shape="rect" coords="419,11,511,29" href="#" onMouseOver="return overlib(comingSoon,TEXTCOLOR, '#ff6600', TEXTSIZE, 1, WIDTH, 100, HEIGHT, 18,FGCOLOR,'#ffffff')" onMouseOut="return nd();">
<area shape="rect" coords="31,11,103,31" href="http://www.xBhp.com" alt="Home" onMouseOver="return overlib(warmUpButton,TEXTCOLOR, '#ff6600', TEXTSIZE, 1, WIDTH, 100, HEIGHT, 18,FGCOLOR,'#ffffff')" onMouseOut="return nd();">
</map>
<map name="Map">
<area shape="rect" coords="134,11,202,32" href="forum/default.asp" onMouseOver="return overlib(forumButton,TEXTCOLOR, '#ff6600', TEXTSIZE, 1, WIDTH, 100, HEIGHT, 18,FGCOLOR,'#ffffff')" onMouseOut="return nd();">
<area shape="rect" coords="231,10,302,30" href="visuals.asp" alt="Visuals" onMouseOver="return overlib(fotosButton,TEXTCOLOR, '#ff6600', TEXTSIZE, 1, WIDTH, 100, HEIGHT, 18,FGCOLOR,'#ffffff')" onMouseOut="return nd();">
<area shape="rect" coords="326,11,401,30" href="#" onMouseOver="return overlib(comingSoon,TEXTCOLOR, '#ff6600', TEXTSIZE, 1, WIDTH, 100, HEIGHT, 18,FGCOLOR,'#ffffff')" onMouseOut="return nd();">
<area shape="rect" coords="419,11,511,29" href="#" onMouseOver="return overlib(comingSoon,TEXTCOLOR, '#ff6600', TEXTSIZE, 1, WIDTH, 100, HEIGHT, 18,FGCOLOR,'#ffffff')" onMouseOut="return nd();">
<area shape="rect" coords="31,11,103,31" href="http://www.xBhp.com" alt="Home" onMouseOver="return overlib(warmUpButton,TEXTCOLOR, '#ff6600', TEXTSIZE, 1, WIDTH, 100, HEIGHT, 18,FGCOLOR,'#ffffff')" onMouseOut="return nd();">
</map>
.
.
.
.
.
.
<tr>
<td colspan="6" bgcolor="#919191"><!--#include file="forum/config.asp"--><!--#include file="forum/inc_activeusers.asp"--> <!--#include file="forum/inc_activeusers.asp"--></td>
</tr>
<tr>
<td width="2%" bgcolor="#919191"><img src="media/images/techspeak.gif" width="18" height="100"></td>
<td width="24%" valign="top"><iframe src="techspeak.asp" width="175" height="95" frameborder="no"></iframe></td>
<td width="2%"><img src="media/images/link.gif" width="18" height="100"></td>
<td width="28%" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#333333"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><strong><a href="http://www.highresautoimages.com" class="unnamed1">www.highresautoimages.com</a></strong></font></td>
</tr>
<tr>
<td><font color="#FFFFFF" size="1" face="Verdana, Arial, Helvetica, sans-serif"><br>
Lots, lots and lots of absolutely clear fotos of cars
( no bikes ) :(</font></td>
</tr>
<tr>
<td bgcolor="#333333"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><strong><a href="http://www.harleypics.com" class="unnamed1">www.harleypics.com</a></strong></font></td>
</tr>
<tr>
<td><font color="#FFFFFF" size="1" face="Verdana, Arial, Helvetica, sans-serif"><br>
Make your desktop a Harley desktop!</font></td>
</tr>
</table></td>
<td width="2%"><img src="media/images/fotos.gif" width="18" height="100"></td>
<td width="42%"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="29%"><a href="visuals/fireblade.asp"><img src="media/images/fotos/thumbnailz/fireblade_1_thumbz.jpg" width="87" height="94" border="1"></a></td>
<td width="29%"><a href="visuals/blackbird.asp"><img src="media/images/fotos/thumbnailz/blackbird_1_thumbz.jpg" width="87" height="94" border="1"></a></td>
<td width="28%"><a href="visuals/fireblade.asp"><img src="media/images/fotos/thumbnailz/fireblade_2_thumbz.jpg" width="87" height="94" border="1"></a></td>
<td width="14%" valign="top"><div align="center"><a href="visuals.asp"><img src="media/images/pics.jpg" width="20" height="84" border="0"></a></div></td>
</tr>
</table></td>
</tr>
<tr>
<td colspan="6" bgcolor="#636363"><div align="center"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><strong><a href="http://www.itsasunny.com" target="_blank" class="unnamed1">©2003
www.itsasunny.com</a></strong></font></div></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
<map name="Map3">
<area shape="rect" coords="6,4,379,122" href="http://pulsar.xBhp.com" alt="http://pulsar.xBhp.com" >
<area shape="rect" coords="387,3,756,120" href="http://karizma.xBhp.com" alt="http://karizma.xBhp.com" >
</map>
</BODY>
</HTML>
<%
objconn.close
set objconn = nothing
%>
the page gives me an error:
Error Type: Microsoft VBScript compilation (0x800A0411) Name redefined /old/forum/inc_adovbs.asp, line 14, column 6 Const adOpenForwardOnly = 0 -----^
what should i do !? |
 |
|
mortioli
Average Member
  
United Kingdom
898 Posts |
Posted - 10 August 2003 : 13:57:53
|
That's where I get lost...sorry mate 
Had to ask quite a few people to get mine working  |
 |
|
indianBoy
New Member

56 Posts |
Posted - 10 August 2003 : 15:30:20
|
well u mean u actually got wrking and dont wanna share with us? |
 |
|
mortioli
Average Member
  
United Kingdom
898 Posts |
Posted - 10 August 2003 : 15:32:09
|
Nah, I mean I'm not that good with ASP...so wouldn't know what that error meant if someone explained it to me  |
 |
|
|
Topic  |
|
|
|