Version: 2.0, by Zero Tolerance
Developer Last Online: Nov 2023
Version: 3.5.0 Beta 1
Rating:
Released: 06-09-2005
Last Update: 06-12-2005
Installs: 10
DB Changes Uses Plugins
Code Changes
No support by the author.
Well as the vBulletin are request extra hook locations, i find it very hard that they would be able to forfill everyones request, because if they did the php files would mostly contain hook calls, so to ease the pain of adding you're own hooks manually, i have created this addon, to add/edit/delete your own hooks using the acp!
Features:
Adding A Custom Hook
Hook Category
Hook Name
Choose ANY PHP file in your forums directory to place the hook (including sub-fodlers)
Insert a line of PHP from the specified file to designate where the hook will be placed
Choose to locate the hook above or below the specified line of PHP
Will automatically modify your PHP file AND vbulletin_hooks.xml for you.
View file contents : Will automatically show the contents of the PHP file, so you can choose where to place the hook.
Modifying A Custom Hook
Change any details you inputted while creating the custom hook
Any plugins assigned to it will be moved to the edited version (if the hook name is changed)
Deleting A Custom Hook
Removes all file edits for that specific hook
Deletes all plugins assigned to that hook location
Repairing All Custom Hooks
Repairs all custom hooks : This is designed to keep your custom hooks intact, if you accidently overwrite any file with a custom hook or vbulletin_hooks.xml, or if you've just upgraded your vBulletin forum, the repair function will re-insert ALL custom hooks back onto your system, with no manual file modifications required.
Export Custom Hook Locations To Auto Installer
The custom hooks exporter is aimed at developers, and will automatically create an install file for people to use and run on there server, the intention is that you export custom hook locations for people to install so that your own modification runs off these hook locations. Please ensure that you notify users installing any modifications you provide with a custom hooks export installer to run the custom hooks installer first before proceeding to import any plugins!.
Installer Includes: Installer/Uninstaller/Repairer for all custom hook locations exported inside it.
File edits: 3 (admincp/plugin.php & includes/xml/cpnav_vbulletin.xml)
Requirements: CHMOD all php files in your forums directory (including sub folders) to 0666, and includes/xml/hooks_vbulletin.xml to 0666 (Will not function without this done!)
Enjoy
- Zero Tolerance
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
Well, i have an idea, which is not flawless, however not as flawed as the line number. Have an area to input code, then choose to place the hook before/after the code, ofcourse the code may be changed in the future, so being very specific instead of inserting a huge lump of code would improve the ratio of succession, and if it was only the line number changed, it won't matter.
Why not have it show the contents of the PHP file, and a radio button next to each line. You select the line you want, and then chose "Above This Line" or "Below This Line".
Not sure if something like that is possible but hey, it's just an idea
Hmm... if you have to open the file to determine where you're going to insert the hook, why not just add it then instead of going back to the ACP?
You also need to modify vbulletin_hooks.xml or another hook xml file to create a hook location, so when you go to Add A Plugin, you will be able to see the hook location you added
The point of this is to eradicate manualy coding in the hooks.
Really nice idea ZT to manage custom hooks :claps: .
Just a suggestion if u like.
Basically a coder requires 3 things :-
1> To add more code in files
2> To remove existing code
3> To replace existing code
Your hack manages the 1st point very well but most of the mods cant work without 2&3.
If along with custom hooks, you could add custom comments like
/* Zero Tolerance comment
######Existing code here ########
Zero Tolerance comment */
Custom commenting will help remove the existing code.Also to replace the code, a custom hook(with the replaced code) can be placed just above or below the custom comments. Also you can keep track of custom hooks+comments together by parsing the file or just storing the line numbers.
Although this all can be done manually but it will be a more organised approach to manage it with your hack instead of going through file and doing ctrl+f.
More functionalities can be added to it like cleanup file which can remove all custom comments and hook for debugging etc.
Nice suggestions spool, however point 2 & 3 may be useful, it is not the point of this modification, which is to create custom hooks, not to change the vB code for modifications, the idea is you have a modification, but the hooks you want do not exist, so you create them using this, so then you can add the plugins to your newly created hook.
Sorry for the delay on v1, i was out shopping o_o (Bad excuse - i know).
v1 has been released, look uptop for features, if you used the old version, you must delete all custom hooks you added with the old system before proceeding to upgrade.