PDA

View Full Version : replacing nested html


Adrian Schneider
09-03-2005, 06:37 AM
forward conversions:
This Becomes => This
{IFMEMBER} => <if condition="(ifmembercondition)">
{/IFMEMBER} => </if>

{IFCONDITION} => <if condition="(somecondition)">
{/IFCONDITION} => </if>

how would I do this backwards without messing up the order everything comes in? (clearly I can't do a standard str_replace)

(actual usage) I'm grabbing a template from the style manager, and i want to convert it to the form that the users use for customizing their page.



i **COULD** add <!-- ifmember --> directly after each </if> as I make them, but that is pretty ridiculous.

Xenon
09-03-2005, 01:39 PM
well, to do it correctly you have to code a parser, but that is more work than use, add the !if member comment would be the esier way...