The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
can't get a function or require_once code to run on hook with ajax edit
OK so I'm stumped...
I have code I want to run on postbit_display_complete. If I declare the function in the plugin or put the function in an external php file and use "require_once" it runs and works fine when i load the thread. However if I do an ajax / quick-edit to the post and re-save it the code does not run. I assume the function isn't being declared or the file isn't being included. However if I don't use a function and just put the code directly in the postbit_display_hook then the code runs just fine after saving a quick-edit. It's like quick-edit runs only the postbit_display_complete hook when saving but it won't get external files or declare a function. I tried putting the require_once code on ajax_complete hook and several edit_complete hooks with no luck. Anyone understand what I'm saying and have any ideas? |
#2
|
||||
|
||||
The console in Chrome isn't showing any error... I'm thinking there's just some trick I'm missing...
|
#3
|
||||
|
||||
EUREKA....
Actually require_once works just fine for my needs, and had I been testing this on any other hook I probably would have been OK... My problem was my code had an if condition to only execute if THIS_SCRIPT == 'showthread' and during an edit, even a quick edit, the script becomes 'editpost' - so once I made it work on showthread or editpost it began working as I expected. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|