The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Preventing thread authors from increasing the view count of their own threads
I searched but couldn't find anything related here or on vbulletin.com forums.
I've decided to post here instead of possibly wasting time and be told this would require hacking and getting pointed here. Preventing the thread view count from getting increased by the thread's starter is very useful, and I'd say fundamental to any forum. I was able to find simple mods for several other forum solutions, but not for vBulletin. If anyone knows how to achieve this, I'd appreciate directions. Thank you. |
#2
|
||||
|
||||
I didn't test it out, but you can try to replace
Code:
$DB_site->shutdown_query(" UPDATE " . TABLE_PREFIX . "thread SET views = views + 1 WHERE threadid = " . intval($threadinfo['threadid']) ); Code:
$DB_site->shutdown_query(" UPDATE " . TABLE_PREFIX . "thread SET views = views + 1 WHERE threadid = " . intval($threadinfo['threadid']) AND postuserid <> $bbuserinfo[userid] ); |
#3
|
||||
|
||||
It might help if you said which file this was in
|
#4
|
|||
|
|||
Thank you tnguy3n! This addition to showthread.php seems to work fine.
edit: nope, jump 2 posts |
#5
|
|||
|
|||
Maybe better to try to avoid the query to be run (would save a query again) by surrounding it with an if tgesting for authorid. Something like:
PHP Code:
|
#6
|
|||
|
|||
sorry, i was wrong. in fact, it's not working properly, view count is not increased by anyone.
(i enabled instant view updating in cp) edited: post=view* |
#7
|
||||
|
||||
I released a hack for this for VB2. Feel free to look at that for reference.
|
#8
|
|||
|
|||
Since I have little knowledge of PHP and how the forum's script works (plus I do need guest views to count), I hope someone could create this type of solution for vBulletin 3.
I'm surprised that it's not a widely requested feature. It's quite popular with other forums. |
#9
|
|||
|
|||
Quote:
Find: PHP Code:
PHP Code:
|
#10
|
|||
|
|||
MarcoH64: Yes, this (really) works properly. Thanks!
However, queries jumped from 8 to 13. Can someone modify it to be more query friendly? |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|