![]() |
Number of views per announcement
I wasn't able to find this hack anywhere. So I wrote this.
This hack will show the number of views per announcement. Tables affected: announcement Templates affected: forumdisplay_announcement Files affected: forumdisplay.php and announcement.php First we need to add a new field to announcement: alter table announcement add visits smallint(5) unsigned DEFAULT 0 NOT NULL; Then we need to modify forumdisplay_announcement template: Look for the following: Code:
<smallfont><br>($announcement[usertitle])</smallfont></td> Code:
<smallfont><br>($announcement[usertitle])</smallfont></td> Look for the following: PHP Code:
PHP Code:
Look for the following: PHP Code:
PHP Code:
Look for the following: PHP Code:
PHP Code:
|
YES!! Been wanting something like this for ages :D Thanks! Works great :)
|
Great, now we can prove that no one, but no one, reads the announcements. :D
Two things: a) Instead of updating the counter for every announcement, you could just run a query that goes more or less like this: Code:
UPDATE announcement SET visits = visits+1 WHERE forumid IN ($forumlist); b) Use the shutdown queries of vBulletin. :) An example can be found in showthread.php: Code:
if ($noshutdownfunc) { |
As always, I am most grateful for the wonderful advice. :)
Thank you. :) |
Very nice....
Should we wait for a upgrade, so ? :p Thnx |
Sure. ;)
I'll post an update later tonite. :) |
also for the forumdisplay.php file, when your trying to find the first part it should be....
PHP Code:
PHP Code:
|
so any updates for this?
coz i get this error Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/domain/domain119/web/forum/announcement.php on line 34 |
ZZed, pleaser release update this wonderful hack! :)
|
Ok, I updated it. :)
It is all in the original post. And I updated the attachment. :) |
All times are GMT. The time now is 03:28 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|