The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#11
|
||||
|
||||
Quote:
Basically, here's what I've got (my whole .js code): http://paste2.org/p/2073301#line-549 As you can see, I'm already modifying the variable RULES on line 549 to change all \n tags to be <br />. Now, the RULES var is called from an option in a setting on my Forum. In this setting, as you can probably guess, you can input a description of your rules that will display. I have the following defined in a template: Code:
var RULES = "$vboptions[ishout_rules]"; Quote:
So, the contents of the ishout_rules option that are like: ...would in fact not be valid js and cause an error. So, if I were to design a Plugin, what hook location should I use and what should it contain? Also, how would I get a custom variable to be accessible by a template? Or, is there a way to fix the js error? Thanks, Mark |
#12
|
|||
|
|||
OK, I think this should work: create a plugin using hook parse_templates and code like this:
Code:
$ishout_rules = addcslashes($vbulletin->options['ishout_rules'], "\r\n'\\"); Then in your template: Code:
var RULES = "$ishout_rules"; This won't change the newlines to <br>, but if you are allowing html in your rules then the person writing the rules should put <br> where they want a newlines. By the way, you asked about how to access a variable in the other thread and I'm sorry it didn't occur to me that you might have problems like this with a string. |
#13
|
||||
|
||||
Quote:
I had to put some PHP code into the cache_templates page then modify the output in my .js file |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|