The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
![]()
When you write an XML file and use plugin code at a certain hook location...does the code in your plugin execute before the hook location or after it?
Does your code run alongside the preexisting code in the PHP file, or does it replace it? For example...if I had a xml file where I was trying to replace a certain chunk of code in the PHP file, how does that work? Im trying to add a condition to this chunk of code without directly editing the file: PHP Code:
|
#2
|
||||
|
||||
![]()
Personally I don't think that there is a way to edit a line or overwrite parts of it with hook/plugins.
Basically what you want to do is a file edit, and you should edit the php file. However, leave that as your last option and try to find another way of coding to get the same job done. If you can't find any, then you have to edit the php file. Basically the hooks/plugins allow you to place a chunk of code within vbulletin's php files at certain predefined locations. You can't overwrite or replace lines with it, as far as I know. May I ask what condition you are trying to add? |
#3
|
||||
|
||||
![]()
Just trying to add a if condition around it
if (!$_REQUEST['refer']) { code block here { |
#4
|
||||
|
||||
![]()
So you want to add
PHP Code:
PHP Code:
If so, then I think you have to edit the php file. Also have you tried putting the exact same code in the plugin and see if it works? So that you're plugin would look the exact same with that extra condition? PHP Code:
|
#5
|
||||
|
||||
![]()
no like this
PHP Code:
|
#6
|
||||
|
||||
![]()
oh ok, then I don't know. Again try putting that whole thing in the plugin and see if it will work. If the plugin/hook location is called before that chunk of code, I'm guessing that it will work. But I'm not sure, sorry.
|
#7
|
||||
|
||||
![]()
well ya, I tried placing the whole thing in the plugin at the right hook location, but no go.
![]() |
#8
|
||||
|
||||
![]()
yeah the code you hook replaces the hook - so to speak.
eg. code line 1 code line 2 $hook = blahblah code line 3 code line 4 Anything you put in the hook will execute between line 2 and line 3 |
#9
|
||||
|
||||
![]()
So Id almost have to make a new hook at the location I want it to execute. In which case, how do you release a new hook with ur hack?
|
#10
|
||||
|
||||
![]()
in that case it doesn't really matter whether you add another hook location in your file or just edit the php file and add in your code. Cause either way you are going to end up editting the php file.
|
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|