• Resolved phdimov

    (@phdimov)


    Hi,

    I am trying yo write my first plugin where it will look in the content of a post for the {charts 1.xml} and replace with a javascript snippet

    <script type="text/javascript" src="swfobject.js"></script>
    
    	<div id="flashcontent">
    		<strong>You need to upgrade your Flash Player</strong>
    	</div>
    	<script type="text/javascript">
    		// <![CDATA[
    		var so = new SWFObject("tock.swf", "stock", "800", "400", "8", "#F9F9F9");
    		so.addVariable("path", "");
    		so.addVariable("settings_file", encodeURIComponent("1.xml"));
            so.addVariable("preloader_color", "#999999");
    		so.write("flashcontent");
    		// ]]>
    	</script>

    I know how to replace {chart} into what I need but I can’t think of the best way to replace {chart 1.xml} where I can put whatever file I want.

    Thanks for any advice in advance

The topic ‘Replace a string in content’ is closed to new replies.