Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
  #1  
Old 02-07-2008, 01:50 AM
vbem2 vbem2 is offline
 
Join Date: Dec 2007
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default deleted plugin, but it won't go away...

Back story:

I was messing around with a plugin in my test forum - using the hook location: vBulletin General: init_startup.

My plug-in sucked. It worked a few times, and then I started getting a test forum-wide error (including in the AdminCP) to the effect of "Unable to add cookies, headers have already been sent. "

I went into the test forum database via phpMyAdmin, and deleted my plug-in record from the plugin table. Didn't help - still got the error.

I then did a bit of searching here and learned the "simple" way to disable plugins that break the Admin CP is by adding the line "define('DISABLE_HOOKS',true);" to my config.php file.

I did that, and it let me get back into the Admin CP, where I confirmed my plugin was no longer listed in the Plugin Manager.

However, when I removed the line "define('DISABLE_HOOKS',true);" from config.php, I can still see the plug-in is active.

How can I kill it? Is it somehow cached in memory because of the hook location I used? I'm stumped.

Thanks for any advice.
Reply With Quote
  #2  
Old 02-07-2008, 10:10 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

First of all you should not do such things manually in the database.

Try to edit/save any other plugin to rebuild the cache.
Reply With Quote
  #3  
Old 02-07-2008, 11:15 AM
vbem2 vbem2 is offline
 
Join Date: Dec 2007
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks, Marco. That fixed it.

To avoid the error in the future: can you suggest which hook location I should use? I was simply generating a random number when any page in the forum is loaded. When I echoed the number (to test it) from the hook location "vBulletin General: init_startup", that's what caused the cookies error in the first place. Which tells me that's not a good hook choice (or a good place to echo output for testing).
Reply With Quote
  #4  
Old 02-07-2008, 11:18 AM
SEOvB's Avatar
SEOvB SEOvB is offline
 
Join Date: May 2007
Location: Indianapolis
Posts: 2,451
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

try global_start maybe?
Reply With Quote
  #5  
Old 02-07-2008, 12:10 PM
vbem2 vbem2 is offline
 
Join Date: Dec 2007
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'll give that a shot. Thanks.
Reply With Quote
  #6  
Old 02-07-2008, 12:45 PM
MoT3rror MoT3rror is offline
 
Join Date: Mar 2007
Posts: 423
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You can echo or use any other function that prints out text to the user. You must assign the data to a variable then put the variable in your template to use it. You will get a error message if you use echo in most hooks.
Reply With Quote
  #7  
Old 02-07-2008, 02:20 PM
vbem2 vbem2 is offline
 
Join Date: Dec 2007
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That was the ultimate plan - feeding the data to a variable for use in a template.

It sounds like my problem was less the hook choice than not knowing about using echo in a hook for testing purposes.
Reply With Quote
  #8  
Old 02-07-2008, 02:23 PM
Opserty Opserty is offline
 
Join Date: Apr 2007
Posts: 4,103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

init_startup should only really be used when you have things which need to be done when the script is just about to start (i.e. when you want to cache extra templates/fetch extra data from the datastore) otherwise your best to stick with global_start as thats when most things are loaded and ready to go. If you just testing however use one of the less used pages, personally I use one of the hooks in the FAQ for testing, when I have what I want working then I would move it over to the most suitable hook.

Good luck
Reply With Quote
  #9  
Old 02-07-2008, 08:54 PM
vbem2 vbem2 is offline
 
Join Date: Dec 2007
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It's all working fine now, using the global_start hook. Tested, and installed on the live forum. Everyone's help is much appreciated.
Reply With Quote
Reply

Thread Tools
Display Modes

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 06:30 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04513 seconds
  • Memory Usage 2,230KB
  • Queries Executed 13 (?)
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)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)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_postinfo_query
  • fetch_postinfo
  • 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