The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Trying to convert a plugin
I need to convert a plugin so the code works in VB4
Here is the code, can anyone please help me convert it. I am having some difficulties on how to change this to be biable in VB$ Code:
if ($_REQUEST['do'] == 'editthread' AND $threadinfo['open'] != 10) { $vbulletin->templatecache['threadadmin_editthread'] = str_replace('$posticons',' <fieldset class=\"fieldset\"> <legend>$vbphrase[redirect_threads_to_url]</legend> <div style=\"padding:$stylevar[formspacer]px\"> <div class=\"fieldset\"> $vbphrase[redirect_threads_to_url_link]<br /> <input type=\"text\" class=\"bginput\" name=\"isurlredirect\" value=\"$threadinfo[isurlredirect]\" size=\"50\" maxlength=\"250\" title=\"$vbphrase[optional]\" /> </div> </div> </fieldset> $posticons',$vbulletin->templatecache['threadadmin_editthread']); } |
#2
|
|||
|
|||
Give this a try, not 100% sure but it should work
Code:
if ($_REQUEST['do'] == 'editthread' AND $threadinfo['open'] != 10) { $vbulletin->templatecache['threadadmin_editthread'] = str_replace('{vb:raw posticons}',' <fieldset class=\"fieldset\"> <legend>{vb:rawphrase redirect_threads_to_url}</legend> <div style=\"padding:{vb:stylevar formspacer}px\"> <div class=\"fieldset\"> {vb:rawphrase redirect_threads_to_url_link}<br /> <input type=\"text\" class=\"bginput\" name=\"isurlredirect\" value=\"{vb:raw threadinfo.isurlredirect}\" size=\"50\" maxlength=\"250\" title=\"{vb:rawphrase optional}\" /> </div> </div> </fieldset> {vb:raw posticons}',$vbulletin->templatecache['threadadmin_editthread']); } |
#3
|
|||
|
|||
That didn't work, I am cuirous if its due to the string {vb:raw posticons} needing to be escaped due to maybe some conflicts with PHP or not
|
#4
|
||||
|
||||
In plugins, you don't use the new template syntax. You need to use, for instance, '.$vbphrase[redirect_threads_to_url].'
|
#5
|
|||
|
|||
I got that part, but how would I be able to refer to the {vb:raw posticons} portion in the code and also outbut something like {vb:raw posticons} since $posticons doesn't work
thanks |
#6
|
||||
|
||||
I really don't understand what you mean. You want to modify the variable $posticons? On what page? When I do a search for $posticons in the files, I get several hits. So, which one of those pages are you looking to do something to? And did you pick an appropriate hook location?
|
#7
|
|||
|
|||
Hook: threadmanage_start
Template: threadadmin_editthread What the code did was look for the instance of $posticon in that template an replace it with code which added an input field for added text. Now I need to update his code to work in VB4 which seems to have {vb:raw posticons} in the template instead of $posticons ---- On a side note, lets say I wanted to make a plugin display Pst Icons, how would i make it since saying echo {vb:raw posticons}; or echo '{vb:raw posticons}'; doesn't work. |
#8
|
||||
|
||||
In php, it is still called $posticons. {vb:raw posticons} is just template syntax.
|
#9
|
|||
|
|||
that doesnt work in the old code though when you run string replace function. Did switching to this "easy" template syntax ruin that? I bet so, not easy for programmers... who decided this should revert it back. Having two sepearate syntax's versus one is the opposite direction they were trying to go for...
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|