vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Graveyard (https://vborg.vbsupport.ru/forumdisplay.php?f=224)
-   -   Forum Home Enhancements - Track Guest Visits (https://vborg.vbsupport.ru/showthread.php?t=131314)

Paul M 01-13-2007 06:45 PM

Quote:

Originally Posted by Shazz (Post 1157742)
Help would be appreciated :(

Unless you provide me with admin access (with sql query permission) then there is nothing I can do or look at.

CSS59 01-13-2007 07:15 PM

Any way to how the total unique hits counting the members AND visitors?
Also, to total hits would be nice as well :D

Please

bo0oost 01-13-2007 08:03 PM

updated... thanks!

works great as always :)

Philster 01-16-2007 10:42 AM

Updated and still working smooth. Thanks.

Phil.

ShawnV 01-16-2007 02:05 PM

Quote:

Originally Posted by Shazz (Post 1157290)
I can't get it to display the yahoo bots etc.

It only says
Visitors (457)

I have all the the options checked to "yes" in the vBoptions

Same thing here.

Mudvayne 01-16-2007 02:16 PM

Update your spiders.xml from here http://www.vbulletin.com/forum/showthread.php?t=76662

firstrebel 01-16-2007 05:43 PM

Getting back to my difficulty uninstalling this product a few pages back, I though I had now fully removed it as I intended installing an earlier verson then working up.

But in ACP -> vBulletin Options it shows a gap in the list where this product was. This suggests it is not totally removed. Any ideas please?

Thanks

Bob

storpappa 01-16-2007 05:45 PM

Wondering if Yahoo really really likes me

Visitors (117), Yahoo! Slurp Spiders (418), MSNBot Spiders (1), Google Spiders (1)

Ricsca 01-16-2007 06:01 PM

Visitatori (673), Yahoo! Slurp Spiders (939), MSNBot Spiders (11), AskJeeves Spiders (1), Google Spiders (1) ;)

Paul M 01-16-2007 06:33 PM

Yahoo likes everyone, they flood you with spiders - take this example from one of the sites I administer.

Visitors (4704), Yahoo! Slurp Spiders (1127), MSNBot Spiders (13), Google Spiders (22), AskJeeves Spiders (1), Google AdSense Spiders (1)

Paul M 01-16-2007 06:39 PM

Quote:

Originally Posted by firstrebel (Post 1160765)
Getting back to my difficulty uninstalling this product a few pages back, I though I had now fully removed it as I intended installing an earlier verson then working up.

But in ACP -> vBulletin Options it shows a gap in the list where this product was. This suggests it is not totally removed. Any ideas please?

Thanks

Bob

That's the auto-template options, it's a shared section used by some of my other mods as well - sadly the idea doesn't work very well as removing the last one installed deletes the options phrase. If you reinstall one of the others (like visitors today) it will restore the phrase. Future versions will not use this sharing due to this flaw.

Code Monkey 01-16-2007 06:48 PM

Is there a 3.54 version of this mod?

Paul M 01-17-2007 12:57 AM

Quote:

Originally Posted by Code Monkey (Post 1160831)
Is there a 3.54 version of this mod?

Nope, sorry, there isn't - nor, I'm afraid, will there ever be one.

Most of my 3.5 stuff is no longer fully supported, and anything new is only for the current vb version. All my 3.5 stuff will be out of support by the summer. I simply don't have the time/resources to maintain old versions.

loonytune15 01-17-2007 02:39 AM

I am also having probs with the hack only showing visitors

Pm sent.

Paul M 01-17-2007 08:32 AM

Your spider cache was broken (the unserialize bit was not set in the datastore).

I have fixed that for you locally so your spiders will start to show again.

While I can (and will) add a bit of code to the install routine that will fix spider caches broken in this way, I cannot tell you how you managed to do it (which means that whatever happened could happen again).

loonytune15 01-17-2007 09:31 AM

could this of happened to others as well?

May have happened when i switched server :)

loonytune15 01-17-2007 08:43 PM

G'day paul, sorry to bother you again, but me thinks the cache has broken again???

i am only getting visitors again..

misticjeff 01-17-2007 08:57 PM

Sorry to be a bother here but I don't have time to read through 26 pages of this thread.

Will this mod track guests I.P. addresses and if not, is there a way to make it do so? I had a mod similar to this on a Xoops site a while back and it tracked guest I.P. addresses which was helpful.

Paul M 01-17-2007 10:13 PM

The ip address of all visitors is recorded, but atm it is not displayed anywhere, you would need your own code to query it.

Paul M 01-17-2007 10:25 PM

Quote:

Originally Posted by loonytune15 (Post 1161669)
G'day paul, sorry to bother you again, but me thinks the cache has broken again???

i am only getting visitors again..

Yes it has broken again - I took a closer look and a product called vbBOL (Shows spiders/bots in who's online) is breaking it - the code was written for vb3.5.

To fix the broken cache run this sql query ;

Code:

update datastore set unserialize = 1 where title = 'wol_spiders'

farooqaaa 01-18-2007 02:51 AM

This is great! thanks

Installed ;)

loonytune15 01-18-2007 08:36 AM

thanks paul, I will enquire over in that thread as to why its breaking the cache all the time..

I'm hoping this can be fixed as I really like that hack..

Paul M 01-18-2007 07:36 PM

The fix is easy, to make it 3.6 compatible the datastore build needs updating.

Code:

build_datastore('wol_spiders', serialize($spiders));
becomes

Code:

build_datastore('wol_spiders', serialize($spiders), 1);

Shazz 01-18-2007 07:42 PM

Paul I know Ive already asked this, but I don't want to waste your time :)

How would I fix so it would display spiders/bots (all is yes in vboptions)
Ever since the last upgrade it stopped showing them.
Could you suggest anything I could do?

-Thanx

Paul M 01-18-2007 10:21 PM

I already answered you.

https://vborg.vbsupport.ru/showpost....&postcount=361


Also read post #380.

loonytune15 01-19-2007 01:10 AM

ok Paul, I'll update the product to include that. Hopefully this works :D

Paul M 01-19-2007 01:47 AM

Version 1.14 is only a change to the install code, no need to update.

KURTZ 01-19-2007 01:42 PM

anyway i do the update :)

thx Paul

AzzidReign 01-19-2007 05:13 PM

It's been awhile since I gave you an update Paul. There was something wrong with my PHP and Apache...so we got everything back up and running fine now. The mod works like a charm with this new 1.14 update...I can finally see how many spiders have been on my site!!!

Thanks Paul!

Al-Fateh 01-19-2007 05:23 PM

great mod@! installed

rouho1 01-22-2007 03:52 AM

Hi, I have installed this hack but since I am a newbie I have this stupid question on how to access the guests track! On onine.php page nothing has been added.

Mudvayne 01-22-2007 05:34 AM

1. Admin CP > Whois Online > Enable Spider Display
2. Admin CP > Guest Tracker > Config Who Can View This Block
3. Check Forum Home
4. Smile!

reebosak 01-24-2007 04:25 AM

edit: wow, i've only had 5 posts on these forums so far? i guess i should post more :p

Quote:

Originally Posted by Paul M (Post 1154265)
I have also made some minor changes to the spider detection code to try and solve the "Cannot use string offset as an array" problem that some people are experiencing. However, since I cannot replicate this error these are 'blind' changes, and I cannot say if they will work. If they don't then you can run this with spider detection disabled.

Hey Paul, i installed this mod tonight and had the "Cannot use string offset as an array" error pop up. After some debugging i found that the $vbulletin->wol_spiders is a serialized array, but the plugin code is using it as if it is unserialized. i've made some modifications to your code to unserialize() the data before accessing it and since then it's been running like a charm, afaict.

here's the modified code:
Code:

<plugin active="1" executionorder="5">
                        <title>Guest Tracking (4)</title>
                        <hookname>global_start</hookname>
                        <phpcode><![CDATA[$process = false;
if ($vbulletin->userinfo['userid'] == 0 AND $vbulletin->options['trg'])
{
        $scripts = explode(',',$vbulletin->options['trgscript']);
        if (empty($scripts))
        {
                $process = true;
        }
        else if (!in_array(THIS_SCRIPT, $scripts))
        {
                $process = true;
        }
}

if ($process)
{
        $time = TIMENOW;
        $host= SESSION_HOST;
        $script = THIS_SCRIPT;
        $requests = $_REQUEST;
        $guest = md5(USER_AGENT.IPADDRESS.COOKIE_SALT);
        $useragent = $vbulletin->db->escape_string(USER_AGENT);
        $excludes = explode(',',$vbulletin->options['trgrequests']);
        if (!empty($excludes))
        {
                foreach ($excludes AS $exclude)
                {
                        unset ($requests[$exclude]);
                }
        }
        $spidername = '';
        $requests = $vbulletin->db->escape_string(serialize($requests));
        if ($vbulletin->options['trgspiders'] AND $vbulletin->options['enablespiders'])
        {
                unset($agent, $vbulletin->wol_spiders, $ip);
            $vbulletin->datastore->do_db_fetch("'wol_spiders'");
                if (preg_match('#(' . $vbulletin->wol_spiders['spiderstring'] . ')#si', USER_AGENT, $agent))
                {
                        $agent = strtolower($agent[1]);

            $unserialized_spiders = unserialize($vbulletin->wol_spiders);
            $u_agent = $unserialized_spiders['agents'][$agent];
           
                        if (false && !empty($u_agent['lookup']))
                        {
                                $ourip = ip2long($host);
                                foreach ($u_agent['lookup'] AS $key => $ip)
                                {
                                        if ($ip['startip'] AND $ip['endip'])
                                        {
                                                if ($ourip >= $ip['startip'] AND $ourip <= $ip['endip'])
                                                {
                                                        $spidername = $u_agent['name'];
                                                }
                                        }
                                        else if ($ip['startip'] == $ourip)
                                        {
                                                $spidername = $u_agent['name'];
                                        }
                                }
                        }
                        else
                        {
                                $spidername = $u_agent['name'];
                        }
                }
        }
        $db->query_write("
                REPLACE INTO ".TABLE_PREFIX."guest
                (guestid, hostip, useragent, lastactive, spider, script, rdata)
                VALUES
                ('$guest', '$host', '$useragent', $time, '$spidername', '$script', '$requests')
        ");
}]]></phpcode>
                </plugin>

In case anybody is interested, i'm running:
vBulletin : v3.6.4
Guest Tracking : my modified version of 1.14
psiStats 2006 : 1.4.3
Spider Watcher : 1.0.0 Beta 9
Members who have visited the forum : 4.41

i've also attached my modified xml file

Edit: removed file. While I appreciate the effort, it would be a support nightmare for different versions called 1.14 to be in circulation, and the problem is a little more complicated than you think - please see my post below (Paul).

reebosak 01-24-2007 05:12 AM

upon further inspection, it appears that the "Total guests" section is not displaying crawlers, it just says "Visitors (xx)", but if i view my current users list, i see about 10 crawlers displayed there.this could be something with the settings, or maybe something left to be fixed, or un-broken (if i broke something along the way) i'll try and take a look at the code again tomorrow, for now though, sleep!

Paul M 01-24-2007 07:36 AM

Quote:

Originally Posted by reebosak (Post 1166204)
After some debugging i found that the $vbulletin->wol_spiders is a serialized array, but the plugin code is using it as if it is unserialized. i've made some modifications to your code to unserialize() the data before accessing it and since then it's been running like a charm

Actually, the datastore fetch should unserialize it automatically - the problem is a bit more complicated - as follows ;

In vb 3.6 a new column was added to the datastore table, telling vb if the data should be automatically unserialised when loaded = a value of 0 = no, 1 = yes, 2 = detect (it tries to work it out from the contents). The entry for "wol_spiders" should be 1 - and when you install this mod, it will delete the existing entry and rebuild it with the correct value.

Now the problem is that the new 'unserialize' value is taken from the build_datastore() function (as an added third parameter) but they have defaulted it to 0 if it's not supplied. Code written for vb3.5 does not supply a third parameter (as it didn't exist) so what happens is some old code somewhere runs, and rebuilds the wol_spiders entry with an unserialze value of 0 (due to the missing parameter) - and because of this, subsequent datastore fetches do not unserialise the data, and everything breaks. (This happens a lot to the 'maxloggedin' datastore entry as well - which is why a lot of people who have upgraded to 3.6 have problems with their WOL data resetting to 1 and 1970).

I posted/requested a change to fix this here, but it got zero response.

I hope you understood all that - I think the solution for me will be to add a bit of code to detect if the data was unserialised correctly, and if not, do it myself and rebuild the datastore entry correctly.

reebosak 01-24-2007 02:46 PM

ah, that makes sense. around the time of my last vB update my "most users ever" date was reset to unix start time.

i'll try to grep through my installed plugins tonight to try and find out the culprit that is resetting the datastore

reebosak 01-24-2007 02:58 PM

this won't solve the big picture problem, but adding a quick check to unserialize if needed may be a good work around specific to this plugin to make it work universally. i just added a ternary check to my previously modified code:

Code:

if (preg_match('#(' . $vbulletin->wol_spiders['spiderstring'] . ')#si', USER_AGENT, $agent))
                {
                        $agent = strtolower($agent[1]);
                        if(is_string($vbulletin->wol_spiders)){
                        $wol_spiders = is_string($vbulletin->wol_spiders)?
                                unserialize($vbulletin->wol_spiders)
                                :$vbulletin->wol_spiders;

            $u_agent = $wol_spiders['agents'][$agent];
           
                        if (false && !empty($u_agent['lookup']))
                        {
                                $ourip = ip2long($host);
                                foreach ($u_agent['lookup'] AS $key => $ip)
                                {
                                        if ($ip['startip'] AND $ip['endip'])
                                        {
                                                if ($ourip >= $ip['startip'] AND $ourip <= $ip['endip'])
                                                {
                                                        $spidername = $u_agent['name'];
                                                }
                                        }
                                        else if ($ip['startip'] == $ourip)
                                        {
                                                $spidername = $u_agent['name'];
                                        }
                                }
                        }
                        else
                        {
                                $spidername = $u_agent['name'];
                        }
                }


Paul M 01-24-2007 05:05 PM

Version 1.15 - as per the above posts, many of the spider issues are due to the spider cache being broken by other modifications - this version will check the loaded data and try to fix the cache if it has been broken in this manner. If it cannot then spider detection will not take place, meaning no errors should occur.

If you are not having any spider detection issues then there is no need to update to this version, there are no other changes.

Shazz 01-24-2007 07:27 PM

/me updates much thanx

johnrizz 01-26-2007 10:17 PM

Like always Paul, your the man! **installed**


All times are GMT. The time now is 06:29 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02000 seconds
  • Memory Usage 1,850KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_code_printable
  • (7)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete