Welcome Guest, Not a member yet? Register   Sign In
Custom conditionals in html content?
#1

[eluser]CroNiX[/eluser]
On a project the client creates page content using the fckeditor. He is now wanting to go above and beyond traditional straight html and use some sort of a custom parser for processing conditional statements within the html. I know vBulletin allows this sort of thing in their templates but I have no idea how to incorporate this.

Basically I want to use if/else statements within the html without having to run a dangerous eval(), so I can run the whole text string through a parser and protect certain content.

Something like:

case 1: show text block only if member of listed groups
Quote:<p><strong>This is text everyone can see.<strong></p>

[protected=administrator;moderator]
<p>This would only be seen if the member is an administrator or moderator.</p>
[/protected]
Case 2: show text block only if member of listed groups. If not, show alternative.
Quote:<p><strong>This is text everyone can see.<strong></p>
[protected=administrator;moderator]
This would only be seen if the member is an administrator or moderator.
[protected_else]
This would be the alternative text shown if not an admin or moderator
[/protected]

Does this seem like the best way to accomplish this? If so I would really appreciate some help coming up with the regex to capture the above 2 cases. Regex is still something I have to master and this seems like it would be fairly complex.

Thanks for any help or suggestions!


Messages In This Thread
Custom conditionals in html content? - by El Forum - 08-05-2010, 01:32 PM
Custom conditionals in html content? - by El Forum - 08-06-2010, 07:42 PM



Theme © iAndrew 2016 - Forum software by © MyBB