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
 Active Users - Sorting spiders from real people
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

MarkJH
Senior Member

United Kingdom
1722 Posts

Posted - 03 June 2007 :  08:36:41  Show Profile  Visit MarkJH's Homepage
I've got the Active Users MOD installed on my site and it lists who's reading the pages, members first then guests; a mix of spiders and actual people.

Is it possible to re-order this so that guests identified as real people (ie. those who aren't identified as any kind of spider/crawler) are listed first. Particularly with the barrage of spiders that come from Yahoo!, it's hard to figure out who's reading what.

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

bobby131313
Senior Member

USA
1163 Posts

Posted - 03 June 2007 :  13:11:12  Show Profile  Visit bobby131313's Homepage
Great idea, I didn't realize how interested I'd be in this until you said it. Just to be real greedy.... splitting another section out would be awesome...

Active Members :
Active Guests :
Active Robots :




You're right, I have as many as 30 Yahoo bots on there sometimes. Conversely, Google sends one that almost never leaves. I did the math once a couple weeks ago and it was there for 13 days.


Switch the order of your title tags

Edited by - bobby131313 on 03 June 2007 13:14:56
Go to Top of Page

MarkJH
Senior Member

United Kingdom
1722 Posts

Posted - 03 June 2007 :  13:14:20  Show Profile  Visit MarkJH's Homepage
Ha, no kidding. I've recently put Adsense back on the forums and the 'bot has been crawling it for (at time of post) 7539 minutes.

I've recently got a few good inbound links. It's hard to find out who's hitting where when there's Yahoo! etc. interspersed amongst the results.

Any ideas, ASP gurus?

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

Edited by - MarkJH on 03 June 2007 13:17:30
Go to Top of Page

MarkJH
Senior Member

United Kingdom
1722 Posts

Posted - 03 June 2007 :  13:15:24  Show Profile  Visit MarkJH's Homepage
quote:
Originally posted by bobby131313


Active Members :
Active Guests :
Active Robots :



That would be a great solution.

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 - 03 June 2007 :  14:58:08  Show Profile  Visit MarkJH's Homepage
Okay, it's a bit of a fudge and it has to pull from the database twice, but I've figured out how to display the real people guests then the bots. Warning, it's not pretty but it works!

Also, my code has been massively altered to include CSS attributes. If you use this, you'll need to figure out how it is in the standard file for yourself.

Though, it's simple in concept. It looks through the active users, if it's a spider, it passes it over and if it's a real person, it creates a line in the HTML table. Second time around, it looks through the active users, it it's a spider, it creates a line in the HTML table, if it's a real person, it passes over.

This is the page in action: http://www.bandlink.net/forum/active_users.asp

Here's the "original" (CSS altered) code loop in active_users.asp:

'## Ls3k - Get Online Guest information
strSql = "SELECT AU_IP, AU_LOGINTIME, AU_LASTACTIVETIME, AU_LASTPAGE, AU_QUERYSTRING, AU_USER_AGENT " & _
         "FROM " & strTablePrefix & "ACTIVE_USERS WHERE MEMBER_ID = -1"
set rsAG = my_conn.execute (strSql)
if rsAG.EOF or rsAG.BOF then
  rsAG.close
  set rsAG = nothing
else
  response.write "              <tr>" & VBNewLine & _
                 "                <td colspan=""" & colspan-1 & """ class=""forumsubheader""><b>" & fLang(strLangMOD_Ls3kAU_01120) & " : " & intTotalActiveGuests & "</b>" & VBNewLine & _
                 "                </td>" & VBNewLine & _
                 "              </tr>" & VBNewLine
  bolAlternating = bolFirstAlternating
  do until rsAG.EOF
    AGENTSTR = fUserAgent(rsAG("AU_USER_AGENT"),rsAG("AU_IP"))
    strLastPage = rsAG("AU_LASTPAGE") 
    strQS = rsAG("AU_QUERYSTRING")
    c=c+1
    if bolAlternating then 
      CColor = strAltForumCellColor
    else
      CColor = strForumCellColor
    end if
    bolAlternating = not(bolAlternating)
    response.write "              <tr>" & VBNewLine & _
                   "                <td class=""forumheader"" valign=middle nowrap=""nowrap"">" 
	If instr(AGENTSTR,"SPIDER") or instr(AGENTSTR,"CRAWLER") then
		response.write "CRAWLER"
		c=c-1
	else
		response.write fLang(strLangMOD_Ls3kAU_01130) & c 
	end if
	response.write "</td>" & VBNewLine
    if bolAUUA then
      response.write "                <td class=""forumheader"" align=center valign=middle nowrap=""nowrap"">" & fUserAgent(rsAG("AU_USER_AGENT"), rsAG("AU_IP")) & "</td>" & VBNewLine
    end if
    if bolAUIP then
      response.write "                <td class=""forumheader"" align=center valign=middle nowrap=""nowrap"">" & rsAG("AU_IP") & "</td>" & VBNewLine
    end if
    if bolAULocal then
      response.write "                <td class=""forumheader"" align=center valign=middle>" & WhatPage(strLastPage,strQS) & "</td>" & VBNewLine
    end if
    response.write "                <td class=""forumheader"" align=center valign=middle nowrap=""nowrap"">" & chkDate(rsAG("AU_LOGINTIME"),"<br>",true) & "</td>" & VBNewLine & _
                   "                <td class=""forumheader"" align=center valign=middle nowrap=""nowrap"">" & abs(DateDiff("n",StrToDate(rsAG("AU_LOGINTIME")),strForumTimeAdjust)) & " " & fLang(strLangMOD_Ls3kAU_01140) & "</td>" & VBNewLine & _
                   "              </tr>" & VBNewLine
    rsAG.movenext
  loop
  rsAG.close
  set rsAG = nothing
end if

'## Ls3k - Closing Main Table
response.write "            </table>" & VBNewLine & _
               "          </td>" & VBNewLine & _
               "        </tr>" & VBNewLine & _
               "      </table>" & VBNewLine & _
               "      <br>" & VBNewLine
WriteFooter


Here's my altered code:

'## Ls3k - Get Online Guest information
strSql = "SELECT AU_IP, AU_LOGINTIME, AU_LASTACTIVETIME, AU_LASTPAGE, AU_QUERYSTRING, AU_USER_AGENT " & _
         "FROM " & strTablePrefix & "ACTIVE_USERS WHERE MEMBER_ID = -1"
set rsAG = my_conn.execute (strSql)
if rsAG.EOF or rsAG.BOF then
  rsAG.close
  set rsAG = nothing
else
  response.write "              <tr>" & VBNewLine & _
                 "                <td colspan=""" & colspan-1 & """ class=""forumsubheader""><b>" & fLang(strLangMOD_Ls3kAU_01120) & " : " & intTotalActiveGuests & "</b>" & VBNewLine & _
                 "                </td>" & VBNewLine & _
                 "              </tr>" & VBNewLine
  bolAlternating = bolFirstAlternating
  do until rsAG.EOF
    AGENTSTR = fUserAgent(rsAG("AU_USER_AGENT"),rsAG("AU_IP"))
    strLastPage = rsAG("AU_LASTPAGE") 
    strQS = rsAG("AU_QUERYSTRING")
    c=c+1
    if bolAlternating then 
      CColor = strAltForumCellColor
    else
      CColor = strForumCellColor
    end if
    bolAlternating = not(bolAlternating)
	If instr(AGENTSTR,"SPIDER") or instr(AGENTSTR,"CRAWLER") then
		c=c-1
	else
		response.write	"              <tr>" & VBNewLine & _
						"                <td class=""forumheader"" valign=middle nowrap=""nowrap"">"
		response.write	fLang(strLangMOD_Ls3kAU_01130) & c & VBNewLine & _
						"</td>" & VBNewLine
		if bolAUUA then
			response.write "                <td class=""forumheader"" align=center valign=middle nowrap=""nowrap"">" & fUserAgent(rsAG("AU_USER_AGENT"), rsAG("AU_IP")) & "</td>" & VBNewLine
		end if
		if bolAUIP then
			response.write "                <td class=""forumheader"" align=center valign=middle nowrap=""nowrap"">" & rsAG("AU_IP") & "</td>" & VBNewLine
		end if
		if bolAULocal then
			response.write "                <td class=""forumheader"" align=center valign=middle>" & WhatPage(strLastPage,strQS) & "</td>" & VBNewLine
		end if
		response.write	"                <td class=""forumheader"" align=center valign=middle nowrap=""nowrap"">" & chkDate(rsAG("AU_LOGINTIME"),"<br>",true) & "</td>" & VBNewLine & _
						"                <td class=""forumheader"" align=center valign=middle nowrap=""nowrap"">" & abs(DateDiff("n",StrToDate(rsAG("AU_LOGINTIME")),strForumTimeAdjust)) & " " & fLang(strLangMOD_Ls3kAU_01140) & "</td>" & VBNewLine & _
						"              </tr>" & VBNewLine
	end if
	rsAG.movenext
  loop
  rsAG.close
  set rsAG = nothing
end if

strSql = "SELECT AU_IP, AU_LOGINTIME, AU_LASTACTIVETIME, AU_LASTPAGE, AU_QUERYSTRING, AU_USER_AGENT " & _
         "FROM " & strTablePrefix & "ACTIVE_USERS WHERE MEMBER_ID = -1"
set rsAG = my_conn.execute (strSql)
if rsAG.EOF or rsAG.BOF then
  rsAG.close
  set rsAG = nothing
else
  bolAlternating = bolFirstAlternating
  do until rsAG.EOF
    AGENTSTR = fUserAgent(rsAG("AU_USER_AGENT"),rsAG("AU_IP"))
    strLastPage = rsAG("AU_LASTPAGE") 
    strQS = rsAG("AU_QUERYSTRING")
    c=c+1
    if bolAlternating then 
      CColor = strAltForumCellColor
    else
      CColor = strForumCellColor
    end if
    bolAlternating = not(bolAlternating)
	If instr(AGENTSTR,"SPIDER") or instr(AGENTSTR,"CRAWLER") then
		response.write	"              <tr>" & VBNewLine & _
						"                <td class=""forumheader"" valign=middle nowrap=""nowrap"">"
		response.write "CRAWLER"
		c=c-1		
		response.write "</td>" & VBNewLine
		if bolAUUA then
			response.write "                <td class=""forumheader"" align=center valign=middle nowrap=""nowrap"">" & fUserAgent(rsAG("AU_USER_AGENT"), rsAG("AU_IP")) & "</td>" & VBNewLine
		end if
		if bolAUIP then
			response.write "                <td class=""forumheader"" align=center valign=middle nowrap=""nowrap"">" & rsAG("AU_IP") & "</td>" & VBNewLine
		end if
		if bolAULocal then
			response.write "                <td class=""forumheader"" align=center valign=middle>" & WhatPage(strLastPage,strQS) & "</td>" & VBNewLine
		end if
		response.write	"                <td class=""forumheader"" align=center valign=middle nowrap=""nowrap"">" & chkDate(rsAG("AU_LOGINTIME"),"<br>",true) & "</td>" & VBNewLine & _
						"                <td class=""forumheader"" align=center valign=middle nowrap=""nowrap"">" & abs(DateDiff("n",StrToDate(rsAG("AU_LOGINTIME")),strForumTimeAdjust)) & " " & fLang(strLangMOD_Ls3kAU_01140) & "</td>" & VBNewLine & _
						"              </tr>" & VBNewLine
	end if
	rsAG.movenext
  loop
  rsAG.close
  set rsAG = nothing
end if

'## Ls3k - Closing Main Table
response.write "            </table>" & VBNewLine & _
               "          </td>" & VBNewLine & _
               "        </tr>" & VBNewLine & _
               "      </table>" & VBNewLine & _
               "      <br>" & VBNewLine
WriteFooter


Hope that helps in some way. If anybody wants to provide some more sophisticated code, then please, don't hold back!

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

Edited by - MarkJH on 03 June 2007 15:01:16
Go to Top of Page

Andy Humm
Average Member

United Kingdom
908 Posts

Posted - 04 June 2007 :  02:26:44  Show Profile
Your bandlink.net link to the forum has the following error displayed at the top of the page:
Microsoft VBScript runtime error '800a000d'
Type mismatch: 'cLng'

/forum/inc_func_secure.asp, line 163
You only have active members and active guests list, to which there appears to be quite a fe bots online, the IP not shown, but the timeonline are grouped and this shows the bots are about.
Go to Top of Page

MarkJH
Senior Member

United Kingdom
1722 Posts

Posted - 04 June 2007 :  12:42:16  Show Profile  Visit MarkJH's Homepage
quote:
Your bandlink.net link to the forum has the following error displayed at the top of the page:
Microsoft VBScript runtime error '800a000d'
Type mismatch: 'cLng'

/forum/inc_func_secure.asp, line 163
That's an error that I sometimes get on my Active Users page. I've never found out exactly why it does it.

quote:
You only have active members and active guests list, to which there appears to be quite a fe bots online, the IP not shown, but the timeonline are grouped and this shows the bots are about.
My mini-MOD just sorts out the guests from the bots. It still displays the guests and bots together but now they're not mixed, the guests appear above the bots. Only moderators and admin on my site can see the IP and you have to be logged in to see more than "CRAWLER".

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

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 05 June 2007 :  05:31:02  Show Profile
This any use, Mark?


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

MarkJH
Senior Member

United Kingdom
1722 Posts

Posted - 05 June 2007 :  12:39:27  Show Profile  Visit MarkJH's Homepage
Not really. I'm already using it. Presumably, Bobby was using that one too.

The spider MOD is great but it doesn't sort out the bots from the people. The code I've added just filters them into a more usable order.

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

modifichicci
Average Member

Italy
787 Posts

Posted - 05 June 2007 :  13:45:04  Show Profile  Visit modifichicci's Homepage
For error in inc_func secure:

http://forum.snitz.com/forum/topic.asp?TOPIC_ID=63247

Ernia e Laparocele
Forum di Ernia e Laparocele
Acces - MySql Migration Tutorial
Adamantine forum
Go to Top of Page

bobby131313
Senior Member

USA
1163 Posts

Posted - 05 June 2007 :  14:08:06  Show Profile  Visit bobby131313's Homepage
quote:
Presumably, Bobby was using that one too.


Bits and pieces.


Switch the order of your title tags
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.55 seconds. Powered By: Snitz Forums 2000 Version 3.4.07