<?xml version='1.0' encoding='UTF-8'?>
<rss version='2.0'>
	<channel>
		<title>cotonti.com : Function sed_cutpost?</title>
		<link>https://www.cotonti.com</link>
		<description>Last topic posts</description>
		<generator>Cotonti</generator>
		<language>en</language>
		<pubDate>Tue, 12 May 2026 18:08:19 -0000</pubDate>

		<item>
			<title>musiconly</title>
			<description><![CDATA[<blockquote><a href="https://www.cotonti.com/forums.php?m=posts&amp;p=11910#11910">#</a> <strong>Trustmaster :</strong>
Dirty trick:<br />
<div class="highlight"><pre class="php">else
{
    $text = preg_replace('#\&#091;&#091;^\&#093;&#093;+?\&#093;(.*?)\&#091;/&#091;^\&#093;&#093;+?\&#093;#', '', $text);
    $text = preg_replace('#\&#091;&#091;^\&#093;&#093;+?\&#093;#', '', $text);
}</pre></div>
</blockquote>
<br />
Perfect! Thanks Trustmaster! <img class="aux smiley" src="https://www.cotonti.com/./images/smilies/smile.gif" alt=":-)" />]]></description>
			<pubDate>Thu, 30 Apr 2009 16:14:19 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=2663&d=0#post11916]]></link>
		</item>
		<item>
			<title>Trustmaster</title>
			<description><![CDATA[Dirty trick:<br />
<div class="highlight"><pre class="php">else
{
    $text = preg_replace('#\&#091;&#091;^\&#093;&#093;+?\&#093;(.*?)\&#091;/&#091;^\&#093;&#093;+?\&#093;#', '', $text);
    $text = preg_replace('#\&#091;&#091;^\&#093;&#093;+?\&#093;#', '', $text);
}</pre></div>]]></description>
			<pubDate>Thu, 30 Apr 2009 12:18:48 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=2663&d=0#post11910]]></link>
		</item>
		<item>
			<title>TwistedGA</title>
			<description><![CDATA[I'd say the easiest option would be to strip any the text between all [bbcode][/bbcode] in the string and then strip the tags from it.]]></description>
			<pubDate>Thu, 30 Apr 2009 06:35:57 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=2663&d=0#post11906]]></link>
		</item>
		<item>
			<title>musiconly</title>
			<description><![CDATA[I'm using this function for cutting down some stuff on my site, like bio previews and stuff like that.<br />
<br />
And I'm using it as parse_bbcodes=false, but this function only removes [bbcode][/bbcode] while still outputting the data that was between that two codes.<br />
<br />
For example, using sed_cutpost function, parse_bbcodes=false:<br />
<br />
<pre class="code">&#091;img&#093;someimage.jpg&#091;/img&#093;Lorem ipsum at something more of this and more and more</pre>
<br />
after it passes the function, it will be <br />
<pre class="code">someimage.jpgLorem ipsum at something more of this and more and more</pre>
<br />
Is there any way to remove whole bbcodes, along with text that is using them.<br />
<br />
So I don't get <pre class="code">someimage.jpgLorem ipsum at something more of this and more and more</pre>
but <pre class="code">Lorem ipsum at something more of this and more and more</pre>
<br />
<div class="highlight"><pre class="php">// Cutpost
function sed_cutpost($text, $max_chars, $parse_bbcodes = true)
{
    $text = $max_chars == 0 ? $text : sed_cutstring(strip_tags($text), $max_chars);
    // Fix partial cuttoff
    $text = preg_replace('#\&#091;&#091;^\&#093;&#093;*?$#', '...', $text);
    // Parse the BB-codes or skip them
    if($parse_bbcodes)
    {
        // Parse it
        $text = sed_parse($text);
    }
    else $text = preg_replace('#\&#091;&#091;^\&#093;&#093;+?\&#093;#', '', $text);
    return $text;
}</pre></div>]]></description>
			<pubDate>Thu, 30 Apr 2009 01:48:05 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=2663&d=0#post11898]]></link>
		</item>
	</channel>
</rss>