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

Reply
 
Thread Tools Display Modes
  #1  
Old 08-29-2010, 01:39 AM
TheMayhem's Avatar
TheMayhem TheMayhem is offline
 
Join Date: Oct 2002
Location: Pittsburgh, Pa
Posts: 526
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Plugins and vB Settings

I have spent most of my night trying to debug my product and finally zero'd in on a problem that users have been reporting since vB 4.0.2. I wasn't able to find any documentation or bug related issues so I figured I'd ask the forum in general if anyone knew.

For a very small portion of the people who use my product, the stored data in vbulletin settings are not working correctly in plugins. For nearly 95% of the users on hooks, I can use something like:

$grab = $vbulletin->options['market_gift_postbit']

And $grab would get the correct numerical or data value stored in the vbulleting database settings. However, for that remaining 5% of the users, it absolutely refuses to find out what $grab is and I cannot figure out why. It's been an issue since vbulletin version 4.0.2. The above example for those 5% of users would display nothing if I decided to echo it out or use it in an if statement, regardless of what data is stored.

The vbulletin settings are working perfectly fine on my files, the problem is only occurying when I try to use the above example in a plugin such as postbit_display_complete. Any help/advise would be appreciated.
Reply With Quote
  #2  
Old 08-29-2010, 01:46 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You need to make sure $vbulletin is in scope. You may need to make $vbulletin global at the top of your plugin code. (Or, it could be the $vbulletin is just the wrong variable - if you look at that hook location, you'll see that $this->registry may be the way to call the setting ie. $this->registry->options['market_gift_postbit']. When in doubt, go find the hook location and look at the code around it.
Reply With Quote
  #3  
Old 08-29-2010, 01:48 AM
Guest190829
Guest
 
Posts: n/a
Default

Try doing some cross diagnosis between the forums that are causing your product to malfunction:

Are the x% of forums experiencing problems running the same version of vB ?

Do they have any of the same third-party products installed?

etc,etc...

This will help determine if it's a vBulletin version incompatibility or a conflict with another product perhaps.
Reply With Quote
  #4  
Old 08-30-2010, 07:59 PM
TheMayhem's Avatar
TheMayhem TheMayhem is offline
 
Join Date: Oct 2002
Location: Pittsburgh, Pa
Posts: 526
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok I did a far more pinpoint after 8 hours of adding, testing, editing, and deleting code and here is what I have found. On the postbit plugins (postbit_display_start and postbit_display_complete) the usage of mysql is not working. So to test it to the extreme, I uninstalled my product and had a blank version of vBulletin.

I created a test plugin in postbit_display_complete:

PHP Code:
$grabexperience $db->fetch_array($db->query_read("SELECT username FROM " TABLE_PREFIX "user")); 

print 
"$grabexperience[username] is working!!! or not"
It produced a pretty blank page and my showthread didn't load correctly. If I tried deleting that and just calling upon any vBulletin saved setting, I received no error but it did not find the data correctly. What can I do guys?
Reply With Quote
  #5  
Old 08-31-2010, 12:28 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If you show the errors, you'll see this error with that call:

Code:
Fatal error:  Call to a member function fetch_array() on a non-object in /home/thetradersden/public_html/vb4_suite2/includes/class_postbit.php(321) : eval()'d code on line 39
The reason I suggested you actually look at the code where the hook is was so you could see what syntax was being used there. If you did, you'd see the proper syntax there is not $db, but instead $this->registry->db .
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 09:42 PM.


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.03456 seconds
  • Memory Usage 2,195KB
  • 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)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (5)postbit
  • (4)postbit_onlinestatus
  • (5)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