Hi,
I am trying to modify a code in my blog to replace a part of the text so it will insert a poll
The original blog code works like this:
PHP Code:
$message = str_replace(":!:", "<img src=\"images/smilies/icon_exclaim.gif\" alt=\"\"></img>", $message);
I have tried to modify, but have only got this far:
PHP Code:
// Insert Polls
$message = str_replace("[poll1]", "<iframe width=\"100%\" src=\"blog-poll.php?pollid=$id\" scrolling=\"no\" id=\"the_iframe\" onLoad=\"calcHeight();\" height=\"1px\" frameborder=\"0\" ></iframe>", $message);
where [poll1] should be found within $message so it will change the text to show the poll and the $id should be the number of the poll e.g. 1 if I type [poll1]
I have found suitable regex "/^(.*\[poll)(.*)(\])/" but not sure how to implement this?