HMBeaty
08-02-2011, 11:04 PM
I'm working on making a hit counter for the forumhome and so far, have gotten this far with the code:
Plugin
Hook location: forumhome_start
$vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "usml_fhcounter SET count = count + 1");
$counter = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "usml_fhcounter");
$count = vb_number_format($counter['count']);
$template_hook['navtab_end'] .= '<phrase 1="$count">'.$vbphrase[counter].'</phrase>';
Installcode
$db->hide_errors();
$db->query_write('CREATE TABLE IF NOT EXISTS `'.TABLE_PREFIX.'usml_fhcounter`(
`count` VARCHAR(6) NOT NULL DEFAULT "",
PRIMARY KEY (`count`)
) TYPE=MyISAM;
');
$db->query_write('INSERT INTO `'.TABLE_PREFIX.'usml_fhcounter` (
VALUES (0);
');
$db->show_errors();
It ALMOST works! The only problem I'm having is that it is printing out
Visitors: %1$s
So, how do I get %1$s to display as the number of visitors instead of.....whatever that is? lol
Thanks in advance for the help :)
Plugin
Hook location: forumhome_start
$vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "usml_fhcounter SET count = count + 1");
$counter = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "usml_fhcounter");
$count = vb_number_format($counter['count']);
$template_hook['navtab_end'] .= '<phrase 1="$count">'.$vbphrase[counter].'</phrase>';
Installcode
$db->hide_errors();
$db->query_write('CREATE TABLE IF NOT EXISTS `'.TABLE_PREFIX.'usml_fhcounter`(
`count` VARCHAR(6) NOT NULL DEFAULT "",
PRIMARY KEY (`count`)
) TYPE=MyISAM;
');
$db->query_write('INSERT INTO `'.TABLE_PREFIX.'usml_fhcounter` (
VALUES (0);
');
$db->show_errors();
It ALMOST works! The only problem I'm having is that it is printing out
Visitors: %1$s
So, how do I get %1$s to display as the number of visitors instead of.....whatever that is? lol
Thanks in advance for the help :)