Log in

View Full Version : How can I make this code work for vb 3.5.x


BoYagoob
11-27-2005, 02:42 AM
Hello,

There is a hack used for vb 3.0.x, which has an instruction:

################################################## ########

#########
# Code modifications in file "index.php"
################################################## ########

#########

---------------------------------------------------------

----------
search for this code: (almost at the end)
---------------------------------------------------------

----------

eval('$navbar = "' . fetch_template('navbar') . '";');

---------------------------------------------------------

----------
change it to:
---------------------------------------------------------

----------

// Hack: most active user
$start = TIMENOW - TIMENOW % 86400;
$end = $start + 86400;
$maxposter = $DB_site->query_first("SELECT

user.username,user.userid,count(*) total FROM

".TABLE_PREFIX."user AS user,".TABLE_PREFIX."post AS post

WHERE user.userid=post.userid AND post.dateline BETWEEN

$start AND $end GROUP BY post.userid ORDER BY total DESC

LIMIT 1");

eval('$navbar = "' . fetch_template('navbar') . '";');

This is the code:

// Hack: most active user
$start = TIMENOW - TIMENOW % 86400;
$end = $start + 86400;
$maxposter = $DB_site->query_first("SELECT user.username,user.userid,count(*) total FROM ".TABLE_PREFIX."user AS user,".TABLE_PREFIX."post AS post WHERE user.userid=post.userid AND post.dateline BETWEEN $start AND $end GROUP BY post.userid ORDER BY total DESC LIMIT 1");

eval('$navbar = "' . fetch_template('navbar') . '";');

Please can you help me in how can I make it a product or a plugin for a vb 3.5.x ?

Kind regards ..

Andreas
11-27-2005, 02:56 AM
Learning by doing ;)
https://vborg.vbsupport.ru/forumdisplay.php?f=110

BoYagoob
11-27-2005, 11:44 AM
Ok sir, I trid this one can you ckeck it for me?

See the attachment..

Also, I am not sure about this sentence:

$vbulletin->db->query_first

: (

akanevsky
11-27-2005, 12:08 PM
That is correct.
However, in your case you can just use $db->query_first();

BoYagoob
11-27-2005, 12:13 PM
Thanks a lot Psionic Vision : )

I correct it now and this is my final version:

So, can I use it as a product now?

many thanks and regards .. :)