b6gm6n
08-04-2005, 12:39 PM
Hi..
Need a little help with a mod i've created for 3.5, it's a forum link counter ported from the original (author agreed for me to complete this) - so i've made it... it works, but theres one thing i wanted to do but which is giving me a headache trying to understand and i hope you might be able to help me...
The product installs ok, (there are 2 edits to one php file) but anyways the forum link counter works well.
Then i added some admin options (all done via the xml install so it's automatic) to reset the counter or input a value to start counting from, this works to... BUT > I thought to myself... what if a user creates more than one redirect forum link? - so i added an extra admin setting to choose the (forumid) and this also works... this is where i found my problem... although the counter is working, i can reset or create a value for the counter (or counters) i choose the forumid value i created gets lost or stuck (for want of a better phrase)
for example, i have 2 forum links, both counters show values, i can enter a value from admin ok and this gets displayed depending on the 'forumid' i enter, i refresh the forum home and it shows, i click the link, it updates the counter... i can do this with the other forum link also...enter a value from admin...sorted... but the only one counter updates...(the forum id is lost or stuck)
http://www.hardwired.myftp.org/forum/index.php <-example
anyways, check the code of my admin plugin below and see if i've done anything wrong... i've created the 'varnames' from the custom admin settings and simple tried to enter them in the plugin to get the forum id
counter admin plugin code >
$hit_start = ($vbulletin->options['hit_start']);
$hit_forum_id = ($vbulletin->options['hc_forumid']);
$Query = "Update " . TABLE_PREFIX . "forum SET linkhits = $hit_start WHERE forumid='$hit_forum_id'";
$vbulletin->db->query($Query);
"hit_start" = the varname i used for one of my admin settings, also "hc_forumid" self explainitory really...
as i say i can alter the counter values from admin ok (any forum id) this works, but it buggers the rest of the counters on the forum home and only updates one of them....(unless i go back to admin options i created for this mod and enter a new forumid and value for the counter, click save...then the other counter works...) ... i need help! :) sorry for the long post!
please help!!!!
-b6
Need a little help with a mod i've created for 3.5, it's a forum link counter ported from the original (author agreed for me to complete this) - so i've made it... it works, but theres one thing i wanted to do but which is giving me a headache trying to understand and i hope you might be able to help me...
The product installs ok, (there are 2 edits to one php file) but anyways the forum link counter works well.
Then i added some admin options (all done via the xml install so it's automatic) to reset the counter or input a value to start counting from, this works to... BUT > I thought to myself... what if a user creates more than one redirect forum link? - so i added an extra admin setting to choose the (forumid) and this also works... this is where i found my problem... although the counter is working, i can reset or create a value for the counter (or counters) i choose the forumid value i created gets lost or stuck (for want of a better phrase)
for example, i have 2 forum links, both counters show values, i can enter a value from admin ok and this gets displayed depending on the 'forumid' i enter, i refresh the forum home and it shows, i click the link, it updates the counter... i can do this with the other forum link also...enter a value from admin...sorted... but the only one counter updates...(the forum id is lost or stuck)
http://www.hardwired.myftp.org/forum/index.php <-example
anyways, check the code of my admin plugin below and see if i've done anything wrong... i've created the 'varnames' from the custom admin settings and simple tried to enter them in the plugin to get the forum id
counter admin plugin code >
$hit_start = ($vbulletin->options['hit_start']);
$hit_forum_id = ($vbulletin->options['hc_forumid']);
$Query = "Update " . TABLE_PREFIX . "forum SET linkhits = $hit_start WHERE forumid='$hit_forum_id'";
$vbulletin->db->query($Query);
"hit_start" = the varname i used for one of my admin settings, also "hc_forumid" self explainitory really...
as i say i can alter the counter values from admin ok (any forum id) this works, but it buggers the rest of the counters on the forum home and only updates one of them....(unless i go back to admin options i created for this mod and enter a new forumid and value for the counter, click save...then the other counter works...) ... i need help! :) sorry for the long post!
please help!!!!
-b6