View Full Version : Hook for vb 3
alnassrah
01-21-2010, 01:04 PM
Hello
Can you modify this hook to suit the vb 4
$getviewstoday=$db->query_first("SELECT SUM(views) AS threadviews FROM thread WHERE dateline>='$vbs_today'");
$viewstoday=number_format($getviewstoday['threadviews']);
Please help me
Thanks
Lynne
01-21-2010, 01:39 PM
Most likely there is nothing wrong with that code (I see nothing wrong with it). It's just php and php is not different for vB4.
If you are changing templates/plugins for vB4, Cellarius wrote a really good article that you may be interested in - [vB4] Rendering templates and registering variables - a short guide (https://vborg.vbsupport.ru/showthread.php?t=228078)
alnassrah
01-21-2010, 03:19 PM
Added a hook in the forumhome_complete
And inside this code
$getviewstoday=$db->query_first("SELECT SUM(views) AS threadviews FROM thread WHERE dateline>='$vbs_today'");
$viewstoday=number_format($getviewstoday['threadviews']);
I have added a phrase viewstoday
Went to the template FORUMHOME
I added this
<dt>{vb:rawphrase viewstoday}</dt
><dd>{vb:raw viewstoday,}</dd>
But does not count the number of visitors
Can you help me ?
Lynne
01-21-2010, 04:51 PM
You haven't registered the variable for use in the template. Did you read that article I posted a link to for you? It explains about registering variables for vB4.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.