Go Back   vb.org Archive > vBulletin Modifications > Archive > Modification Graveyard
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
vbPluginOrder Details »»
vbPluginOrder
Version: 1.2, by hambil hambil is offline
Developer Last Online: Apr 2013 Show Printable Version Email this Page

Category: Miscellaneous Hacks - Version: 3.5.4 Rating:
Released: 03-29-2006 Last Update: Never Installs: 10
Uses Plugins
Additional Files Is in Beta Stage  
No support by the author.

Keywords: plugin, order, hook

Description:
A simple but potentially very useful tool that allows you to set the order of execution for plugins within the same hook.

Features:
  • Fully Phrased.
  • Set the order of plugin execution within the same hook.
Install
  1. Download the vbPluginOrder_1.2.zip file.
  2. Unzip and upload the files in the upload directory to your forum root.
  3. Import the product file in your admincp.
  4. Set the order for your plugins if needed and desired.
Notes:
If you have Hellcat's real time page compressor installed it must be set as the first plugin in its hook after you activate plugin order.

Version 1.2
  • Fixed bug causing plugin order not to run on some systems because of cookie settings
Version 1.1
  • Fixed nasty sql bug where I forgot to use TABLE_PREFIX for one join. Causes a problem if you have a table prefix (obviously)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #52  
Old 05-14-2006, 09:00 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for providing this solution for members with problems.

Although your solution works, the proper way to disable all plugins from outside the ACP, is to add the following line to yhe includes/config.php:
PHP Code:
define('DISABLE_HOOKS'true); 
Reply With Quote
  #53  
Old 05-14-2006, 09:07 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That's what I just posted above, sir.
Reply With Quote
  #54  
Old 05-14-2006, 11:37 AM
akanevsky akanevsky is offline
 
Join Date: Apr 2005
Posts: 3,972
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Although I could see how this hack could be useful, I'd like to point out two things:
1. It would encourage a bunch of already-lazy coders to NOT care about making their hack in a way that would guarantee absense of conflicts with other hacks.
2. Instead of creating a new table and having to implement a whole new block of code, you should've added a displayorder column to the plugin table and used that.
Reply With Quote
  #55  
Old 05-14-2006, 12:34 PM
hambil's Avatar
hambil hambil is offline
 
Join Date: Jun 2004
Location: Seattle
Posts: 1,719
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Logician
Warning:
This hack causes serious problems if your board has table prefixes. If it is installed in a board where tables are prefixed, the board start producing DB errors and it won't even allow you to access admin cp and disable product. So if you dont know what you are doing, you'll get stuck in a very bad position.

Problem & Fix:

This query in the pluggin is problematic:

PHP Code:
SELECT p.*, po.`orderFROM " . TABLE_PREFIX . "pluginorder AS po
JOIN plugin 
AS p ON(p.pluginid po.pluginid)
ORDER BY p.hooknamepo.order 
It should be:
PHP Code:
SELECT p.*, po.`orderFROM " . TABLE_PREFIX . "pluginorder AS po
LEFT JOIN 
" . TABLE_PREFIX . "plugin AS p ON(p.pluginid po.pluginid)
ORDER BY p.hooknamepo.order 
If you installed the hack and stuck with an DB error and you can't even access admin cp here is the fix for you:

Edit includes/init.php, find:
PHP Code:
if ($vbulletin->options['enablehooks'] OR defined('FORCE_HOOKS')) 
Before that add:
PHP Code:
$vbulletin->options['enablehooks'] = FALSE
Upload init.php.

This will cure DB error and now you can login to admin cp. Go to products and uninstall the product. Now delete the line you edit to init.php, reupload init.php and you are done.

@hambil : Sorry to post this into your thread and I appreciate your sharing your work with other vb members but I feel obligated to post this so that people won't get into trouble. It maybe a good idea to apply the fix I provided to your pluggin. Sorry again!
This was one of my first hacks. I thought I'd fixed the table prefix issue in this - not sure how it crept back in. Anyway, thanks for pointing out. Perhaps a PM next time?

Edit: In fact I know I did - it's in the description of version 1.1. Somehow version 1.0 got reuploaded.
Reply With Quote
  #56  
Old 05-14-2006, 12:37 PM
hambil's Avatar
hambil hambil is offline
 
Join Date: Jun 2004
Location: Seattle
Posts: 1,719
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Psionic Vision
Although I could see how this hack could be useful, I'd like to point out two things:
1. It would encourage a bunch of already-lazy coders to NOT care about making their hack in a way that would guarantee absense of conflicts with other hacks.
That's silly. You can't possible predict what conflicts your hack might have with other hacks. And this isn't just for conflicts. What if you simply want to re-order things on forum home, for example?

Quote:
2. Instead of creating a new table and having to implement a whole new block of code, you should've added a displayorder column to the plugin table and used that.
That's your opinion. I prefer not to modify vb core tables if I can help it. The new table is indexed and performance is not an issue.
Reply With Quote
  #57  
Old 05-14-2006, 12:45 PM
akanevsky akanevsky is offline
 
Join Date: Apr 2005
Posts: 3,972
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
You can't possible predict what conflicts your hack might have with other hacks.
True, you cannot predict. But you can avoid altering vBulletin core with your hacks, which is what many coders do, and which is what leads to problems.

Quote:
What if you simply want to re-order things on forum home, for example?
Last time I checked, to re-order things in the front end, you edit the templates. Templates, in their turn, do not have hooks so they have nothing to do with ordering.

Quote:
That's your opinion. I prefer not to modify vb core tables if I can help it. The new table is indexed and performance is not an issue.
That's not just my opinion, it's a fact. "JOIN" always requires more from the server than a straightforward "SELECT FROM". However, it was only a suggestion. You're the boss of your hack, so you may or may not follow it, depending on what you want...
Reply With Quote
  #58  
Old 05-14-2006, 12:53 PM
hambil's Avatar
hambil hambil is offline
 
Join Date: Jun 2004
Location: Seattle
Posts: 1,719
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Psionic Vision
True, you cannot predict. But you can avoid altering vBulletin core with your hacks, which is what many coders do, and which is what leads to problems.
Don't like my hack, don't find it useful, don't install it. Fine with me. I don't know why you feel you have to come in here and say so though. I created this hack because people requested, so obviously not all feel as you do. When did we start going into others hacks and publicly criticizing them?

Quote:
Last time I checked, to re-order things in the front end, you edit the templates. Templates, in their turn, do not have hooks so they have nothing to do with ordering.
And then when you upgrade you have to re-edit all those templates.

Quote:
That's not just my opinion, it's a fact. "JOIN" always requires more from the server than a straightforward "SELECT FROM". However, it was only a suggestion. You're the boss of your hack, so you may or may not follow it, depending on what you want...
It is most certainly an opinion, not a 'fact'. The cost of a proper join is nearly non-existant, especially compared to the design and maintainence benifits. It's called a relational database because it's designed for related tables, not flat tables.
Reply With Quote
  #59  
Old 05-14-2006, 12:56 PM
hambil's Avatar
hambil hambil is offline
 
Join Date: Jun 2004
Location: Seattle
Posts: 1,719
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I removed the old 1.0 zip and reuploaded the 1.1. zip. That should take care of the table_prefix problem.
Reply With Quote
  #60  
Old 05-14-2006, 12:58 PM
akanevsky akanevsky is offline
 
Join Date: Apr 2005
Posts: 3,972
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Don't like my hack, don't find it useful, don't install it. Fine with me. I don't know why you feel you have to come in here and say so though. I created this hack because people requested, so obviously not all feel as you do. When did we start going into others hacks and publicly criticizing them?
To ensure that you aren't going to be criticized, don't release hacks.
Just to point out, however, I did say that I find how this hack could be useful.

Quote:
And then when you upgrade you have to re-edit all those templates.
That, once again, has nothing to do with plugins.

Quote:
It is most certainly an opinion, not a 'fact'. The cost of a proper join is nearly non-existant, especially compared to the design and maintainence benifits. It's called a relational database because it's designed for related tables, not flat tables.
I am not going to argue about it, I am just going to say that in my opinion, creating an extra field for just one table is a waste.
Reply With Quote
  #61  
Old 05-14-2006, 12:59 PM
hambil's Avatar
hambil hambil is offline
 
Join Date: Jun 2004
Location: Seattle
Posts: 1,719
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Psionic Vision
I am only giving you suggestions. If you don't like people giving you suggestions, let everyone know publicly to rid yourself of it. Thanks for understanding.
Sorry if I over-reacted. I'm always open to suggestions.

Quote:
I am not going to argue about it, I am just going to say that in my opinion, creating an extra field for just one table is a waste.
So noted
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: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.04513 seconds
  • Memory Usage 2,332KB
  • Queries Executed 25 (?)
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
  • (5)bbcode_php
  • (14)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete