PDA

View Full Version : Help need using str_replace($find,$add_before.$find, $output);


TheSupportForum
01-25-2010, 06:51 PM
for the past week i've been trying to do the following code in php plugins and php files


if ($vbulletin->options[option1]){
$iptools = '<vb:if condition="can_moderate()"><a href="http://www.dnsstuff.com/tools/ipall/?tool_id=67&token=&toolhandler_redirect=0&ip={vb:raw post.ip}" alt="YoBroMoFo IP Tracker" title="YoBroMoFo IP Tracker"target="_blank"><img src="images/site_icons/account.png" border="0"></a></vb:if>
';
$find = '<vb:if condition="$show['reputationlink']">';
$add_before = "$iptools". PHP_EOL;
$output = str_replace($find,$add_before.$find, $output);
}


i know somewhere i am going wrong but not sure where

the peice of code is ina a template call postbit_legacy

Lynne
01-25-2010, 10:01 PM
Your problem is that the code is php and you cannot put php in a template.