A mod to not increase topic views for admin

Discuss the development of future releases of phpBB (phpBB 3.x minor releases) and MODing/Coding related questions.
Post Reply
imkingdavid
Supporter
Supporter
Posts: 32
Joined: 12 Aug 2009, 16:16
Real name: David
Contact:

A mod to not increase topic views for admin

Post by imkingdavid »

Hey, my new website is just starting out and I'm trying to get a better idea of who all is viewing the posts on my board. So I would like a way for the software to only increase the view counter for topics when someone that is not an admin views the topic. That way I can see who all is viewing it besides me.
I'm sure I saw a MOD to do this somewhere, but I can't find it now, after spending quite a few minutes on phpBB.com. I would delve into the code myself to try and find it, but I don't have the time at the moment.
phpBB.com Development Team Member | View My MODs | View My Website
Please do NOT contact for support via PM or email.
imkingdavid
Supporter
Supporter
Posts: 32
Joined: 12 Aug 2009, 16:16
Real name: David
Contact:

Re: A mod to not increase topic views for admin

Post by imkingdavid »

Well, I found [url=http://www.phpbb.com/community/viewtopic.php?f=69&t=1744245&start=0]Prevent Topic View Increase by Author[/url], by BondGamer. Which is also something that can be useful. I added that MOD, and then I added

Code: Select all

&& !$auth->acl_get('a_')
and so far that seems to work just fine for what I need.

So what I ended up changing was:
Open viewtopic.php, and replace:

Code: Select all

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

with:

Code: Select all

if (isset($user->data['session_page']) && !$user->data['is_bot'] && !$auth->acl_get('a_') && $user->data['user_id'] != $topic_data['topic_poster'] && (strpos($user->data['session_page'], '&t=' . $topic_id) === false || isset($user->data['session_created'])))


I hope this helps someone. :)
phpBB.com Development Team Member | View My MODs | View My Website
Please do NOT contact for support via PM or email.
Post Reply