Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 08-04-2005, 12:39 PM
b6gm6n's Avatar
b6gm6n b6gm6n is offline
 
Join Date: Aug 2002
Location: UK
Posts: 691
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default I'm a $=sniff away from nailing this...

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 >
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
Reply With Quote
  #2  
Old 08-04-2005, 02:02 PM
amykhar's Avatar
amykhar amykhar is offline
 
Join Date: Oct 2001
Location: PA
Posts: 4,438
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm just guessing cause I'm not seeing the code in context, but perhaps you should be using an array.

Instead of $hitstart, it might be $hitstart[$forumid] or something like that. What could be happening is that you are pulling all the hitstarts down for the forms, but the each successive one overwrites the previous.

As I said, I may be all wet on this one, but that would be my first hunch.
Reply With Quote
  #3  
Old 08-04-2005, 04:15 PM
b6gm6n's Avatar
b6gm6n b6gm6n is offline
 
Join Date: Aug 2002
Location: UK
Posts: 691
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

bugger me i got it working! (Kinda) - hey thanx amykhar! - it was my hook location, i had the admin plugin using 'global_start' which in turn was reseting my forum id... the code was ok, i just needed to alter the hook location... i can now get both counters working, but i have a weird behaviour in the updating of the counter from admin...

i have to click update twice?? weird... it works, but why twice? my hook location for the admin plugin is : admin_options_processing

yep, definatly have to click save twice for this to work.... bum!

-b6
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:03 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03360 seconds
  • Memory Usage 2,177KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (3)post_thanks_box
  • (3)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (3)post_thanks_postbit_info
  • (3)postbit
  • (3)postbit_onlinestatus
  • (3)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete