The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#11
|
||||
|
||||
Hmm, a problem I've come in contact with this hack is whether to make the functions return a value relative to the first time they're called, or upon every page refresh.
For example, I'll use the code from my last post: Usage: [random="100"]200[/random] Masked: [random="{option}"]{param}[/random] PHP: rand({option}, {param}); Because vBulletin retains BBCode tags in posts, and doesn't substitute them with hard-coded values (which absolutely makes sense), this would mean upon page refresh a function is called everytime. In the case of functions that return non-static values, like rand(), you're going to get a new random number everytime you refresh the page. I'm not sure if your hack will be affected by this mudpyr8 in a negative way, but let me know your thoughts. I could hard-code the values for specific functions, making the first generated return value replaced with its tag, and upon page refresh it'll never update. This would also be a tad more efficient since you aren't calling custom functions over and over again upon page refresh, but the downside is if you were to ever change the bbcode tag or bbcode function from the AdminCP, the previous instances that have already been posted wouldn't be updated. Although, whether that is a huge concern.. I wouldn't think so. I'll probably add an option for the administrator to decide how they want it. Quote:
As for passing an incorrect amount of arguments, or the wrong datatype of a argument, normally this would result in a parse error. But, just apply the @ in front of a function, and you suppress its error messages. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|