VIEWS count incremented by Spiders/Bots

Discuss features as they are added to the new version. Give us your feedback. Don't post bug reports, feature requests, support questions or suggestions here.
Forum rules
Discuss features as they are added to the new version. Give us your feedback. Don't post bug reports, feature requests, support questions or suggestions here. Feature requests are closed.
ukjim
Registered User
Posts: 7
Joined: Fri Jul 11, 2008 11:26 am

VIEWS count incremented by Spiders/Bots

Post by ukjim »

I have spent the last 2 hours reading through various posts from people asking whether the Views counts gets incremented / increased by Spiders and Bots and Spammers.

While Spambots could be considered an entirely different issue and problem in its own right, with various MODS and mechanisms to combat Spam, I am more interested in the simple fact that normal search engine spiders/robots seem to have always been allowed to "get away" with increasing the topic Views counts. Why :?:

I think that forum owners and topic posters don't like this because they want a fairly accurate representation of the number of views by real people, by excluding the Bots from incrementing the views count altogether.

I understand there is the issue that Views may increase by several clicks simply by the fact the author of the topic might re-view their own topic, particularly if editing it shortly after the initial post.
But once this has settled down it is nice to know roughly how much interest your post has generated.
Even if people (other than the author) reading a topic view it repeatedly, this is normally an indication of genuine interest in that particular topic.

Search engine bots can account for a high number of Views to the post, which portray a false picture of topic interest. :cry:

phpBB 3.0.2 already allows identification of Spiders/Bots, and there is even an option within the Groups forum permissions under the Misc tab for Bots to control whether the Bots group may Increment the Post Counter, so why on earth isn't there a similar setting to stop Bots Incrementing the Views Counter ??

This seems to have been a hot topic of discussion and misunderstanding by forum owners for the past 3 or 4 years. :!:
I just don't see why this idea has not been implemented particularly since phpBB is specifically checking for Spiders now (unless I have missed it somewhere?).

I would have thought that a global switch under the Spider/Bots section could turn off incrementing of the Views counters. Or even a switch against each individual Spider/Bot, although I can't really think of a reason why you would want to allow some but not other bots from affecting the Views counts.

I would be interested to know peoples VIEWS or comments on this point!! :lol:

igorw
Registered User
Posts: 500
Joined: Thu Jan 04, 2007 11:47 pm

Re: VIEWS count incremented by Spiders/Bots

Post by igorw »

Open: viewtopic.php

Find:

Code: Select all

if (isset($user->data['session_page']) && strpos($user->data['session_page'], '&t=' . $topic_id) === false)
Replace with:

Code: Select all

if (isset($user->data['session_page']) && strpos($user->data['session_page'], '&t=' . $topic_id) === false && !$user->data['is_bot'])
:ugeek:

ukjim
Registered User
Posts: 7
Joined: Fri Jul 11, 2008 11:26 am

Re: VIEWS count incremented by Spiders/Bots

Post by ukjim »

Thank you very much eviL3 :)
That was nice and easy.

I was intrigued by the triple equals sign operator (===).

At first I thought it was a typo, but decided I'd best look it up before opening my mouth!

$a === $b means Identical, i.e. TRUE if $a is equal to $b, and they are of the same type. (introduced in PHP 4)

Ya learn something new every day.

Thanks again.

igorw
Registered User
Posts: 500
Joined: Thu Jan 04, 2007 11:47 pm

Re: VIEWS count incremented by Spiders/Bots

Post by igorw »

:ugeek:

jackgopher
Registered User
Posts: 1
Joined: Wed Aug 13, 2008 2:44 pm

Re: VIEWS count incremented by Spiders/Bots

Post by jackgopher »

I wanted just to say thanks to eviL3, I had exactly the same problem as ukjim, and I found this post by googling "phpbb bots increasing page views", and it solved my problem.
So you have a thank you from me too....
Last edited by camm15h on Fri Aug 15, 2008 9:35 pm, edited 1 time in total.
Reason: Spam removed.

defeedme
Registered User
Posts: 1
Joined: Tue Nov 25, 2008 3:16 am

Re: VIEWS count incremented by Spiders/Bots

Post by defeedme »

THIS has to be one of the most annoying problems with phpbb.. Why in the world they would think that overall visits is more important to display than UNIQUE visits is beyond me.
The most important thing is the UNIQUE visits on a topic - and I'm assuming there is a mod for this but am still looking... I am not really sure if evil3's code will fix this, he does not really explain exactly what it does... Any help would be appreciated.. Thanks

User avatar
A_Jelly_Doughnut
Registered User
Posts: 1780
Joined: Wed Jun 04, 2003 4:23 pm

Re: VIEWS count incremented by Spiders/Bots

Post by A_Jelly_Doughnut »

eviL3's code was implemented in phpBB 3.0.3.
A_Jelly_Doughnut

User avatar
Mario_AU
Registered User
Posts: 6
Joined: Sun Feb 10, 2008 5:02 pm
Location: Australia
Contact:

Re: VIEWS count incremented by Spiders/Bots

Post by Mario_AU »

A_Jelly_Doughnut wrote:eviL3's code was implemented in phpBB 3.0.3.
has it ? i am using 3.0.4 and it still has the old code. or do i have to do something in the admincp ?
i could manually edit it but then what you said confuses me.
please explain...
§ Pimp of Mario's World. Hater of society. §

User avatar
Lurttinen
Registered User
Posts: 78
Joined: Mon Feb 20, 2006 7:57 am
Contact:

Re: VIEWS count incremented by Spiders/Bots

Post by Lurttinen »

You are not using 3.0.4?
Have you updated your files and not just the database?

User avatar
Mario_AU
Registered User
Posts: 6
Joined: Sun Feb 10, 2008 5:02 pm
Location: Australia
Contact:

Re: VIEWS count incremented by Spiders/Bots

Post by Mario_AU »

Lurttinen wrote:You are not using 3.0.4?
Have you updated your files and not just the database?
i am using 3.0.4 (database and files)
but the above specific code is not there.
what i have is:

Code: Select all

if (isset($user->data['session_page']) && !$user->data['is_bot'] && strpos($user->data['session_page'], '&t=' . $topic_id) === false)
but now looking at it it HAS the bot entry, so i assume it's the new code and in fact the above changes i assume are for manual edits for older versions.
but when i follow instructions, i follow them to the T. one character out and i stop.
§ Pimp of Mario's World. Hater of society. §

Post Reply