The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
setting function pointers, need syntax
I am in the process of updating my custom scripts for 3.6.x. Some pages generate this error:
print_standard_error(...) is now redundant. Instead, use standard_error(fetch_error(...)) My errors messages are hard-coded strings. They don't use the phrase system, so I don't think I need fetch_error(). I just need to map print_standard_error() to standard_error(). What is the code to point the old function to the new one so I don't have to change the references? I don't know the syntax. |
#2
|
|||
|
|||
standard_error('This is the error message') works I think.
|
#3
|
||||
|
||||
standard_error (line 2366)
Halts execution and shows the specified error message void standard_error ([string $error = ''], [string $headinsert = ''], [boolean $savebadlocation = true], [string $override_template = ''])
http://members.vbulletin.com/api/vBu...tions_php.html |
#4
|
||||
|
||||
I know how to use the function. I have references to the old function name in my scripts. I want to change the pointers to use the new function without modifying the references in the code. See my post.
For example, I added this to a plugin in the global scope: $DB_site =& $vbulletin->db; This makes it so the references to the old $DB_site variable now refer to the new $vbulletin class so I don't have to change every instance of $DB_site within my code. I want to do a similar thing for the references to the old print_standard_error() function. |
#5
|
||||
|
||||
As far as I know, there's no way to override functions in PHP. But isn't the point of updating changing your code?
You could do a batch search and replace... http://www.abacre.com/afr/ It would take 2 seconds to update all your code. Unless you have a specific reason for not wanting to replace? |
#6
|
||||
|
||||
Because it's easier to change pointers if possible.
|
#7
|
|||
|
|||
You can't redefine functions in PHP as far as I am aware so I don't think it is possible. Haven't tested though but I don't think it would work.
|
#8
|
||||
|
||||
You can't redefine functions in PHP, so edit print_standard_error() in functions.php to work with your old code.
|
#9
|
||||
|
||||
I think all you will need to do is comment out the 'die' statement in the existing print_standard_error() - in functions.php (not tested).
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|