PDA

View Full Version : Replacement variable in plugin?


Stagehandspace
08-31-2008, 09:18 AM
I have found a cool little mini script, and have got it running by uploading a file to server and creating a variable replacement but I would like to turn it into a plugin,

I know how to call a template so the file upload is no longer needed but I wish to know (if its possible) how to code/call a Replacement variable within a plugin so all thats needed is to import the plugin.xml file and your done....

I want to change:
alt="
to
mycode="" alt="

Thank you in advance :)

Stagehandspace
09-07-2008, 10:48 PM
Bump :)

I cant just use alt=" as a hook as my code need to go behind

Lynne
09-07-2008, 10:54 PM
Yeah you can. If you use str_replace, it will replace the instance of alt. So, if you put the word to replace is "alt=" and the word to replace it with is "mycode=whatever alt=" then it should be how you want it.

Stagehandspace
09-07-2008, 11:10 PM
Mmmm ok that make sense so how do I call it for all templates?
I currently only know how for 1 template
<![CDATA[$hot = 'alt="';
$vbulletin->templatecache['headinclude'] = str_replace($hot,$hot.fetch_template('hot_replace' ),$vbulletin->templatecache['headinclude']);]]>