XF 2.2 HTML, bbCodes, more stuff, faster use

Robert9

Well-known member
Let's say you have a blog;
you have some rules for design and do every day the same.
But sporadically, you break out and try new things.

You could add bbCodes for this, and because you love to do that, you finally have no more codes with [a-z][a-z][0-9] and the list of things gets looooonger and looooooooooooonger.

Would it be nice to have something like a onePostbbCode? Means HTML?
Or a new field with HTML things to include? Or include a phrase with html-stuff in a post?

Sorry, don't have a clear idea now.
But I like the idea of changing my articles without adding a bbCode and css everytime.

Where could it be saved best? And done fast?
 
I have found two add-ons to add html as a bbcode, one is free, the other not; have checked the free one.
perfect for my needs, but ...

... i guess it should forbid anything dangerous. So i will try to find out how I can do that.

Everything i need is something like:

Code:
div style=color:red; padding:10px
/div

no form, no script, no {i dont know what could be dangerous}

Has someone an idea how to filter that html to things we are not afraid of?
 
I have not found anything useable now, but ...

What's about defining a bbCode divx, just adding

div class=x /div
around my {text}


and a second one to set .x { {text} }

with text regex allowed: a-zA-Z0-9 and ":",";"

more things to care for?

So i could have at least one div for special effects or maybe three with divx, divy, divz


or use style="{text}"?
with same regex.


Are three divs enough to make nice things?
 
I don't know what the bbCode machinery does, but inside this add-on seems to be no check for the html.
I would like to limit this somehow.
 
entity/post

Code:
public function setPreview(&$error = null)
{
$message = $this->message;

    if (preg_match('#\[opener\](.*)\[/opener\]#is', $message, $matches))
    {
print_r($matches);
        $this->message = $matches[1];
    }
}

controller
Code:
foreach ($posts AS $post)
{
$post->setPreview();
}
 
Last edited:
Top Bottom