BirdOPrey5
06-30-2010, 11:27 PM
So I'm now to using plugins in place of direct php file edits. I have code I want to put into a hook location but I need to execute my code and NOT execute the existing code... for example I make a pligin in: example_hook_location
My code is:
$x = 5;
But the existing code in the php file where the hook is:
$x = 6;
When I add my code via the plugin the result is basically:
$x = 5;
$x = 6;
Which leaves x with the same value of '6' as if my code never ran to begin with. How do I get around this? It seems like this would be a common issue when using plugins.
--------------- Added 1277949347 at 1277949347 ---------------
In more detail what I want to do is "If" something is true use my custom code for a query, otherwise (if false) use the existing code... One of the hook locations I want to do this with is:
forumdisplay_query_threadscount
I'd be much obliged for pointers on how to do this, I read an article on plugins but it was very old and couldn't find much dealing with my issue in the search.
My code is:
$x = 5;
But the existing code in the php file where the hook is:
$x = 6;
When I add my code via the plugin the result is basically:
$x = 5;
$x = 6;
Which leaves x with the same value of '6' as if my code never ran to begin with. How do I get around this? It seems like this would be a common issue when using plugins.
--------------- Added 1277949347 at 1277949347 ---------------
In more detail what I want to do is "If" something is true use my custom code for a query, otherwise (if false) use the existing code... One of the hook locations I want to do this with is:
forumdisplay_query_threadscount
I'd be much obliged for pointers on how to do this, I read an article on plugins but it was very old and couldn't find much dealing with my issue in the search.