*bump*
Frågan#1
Jag använder följande kod till en citat-funktion (bbkod).
function format_quotes($s)
{
while ($old_s != $s)
{
$old_s = $s;
//find first occurrence of [/quote]
$close = strpos($s, "[/quote]");
if ($close === false)
return $s;
//find last [quote] before first [/quote]
//note that there is no check for correct syntax
$open = _strlastpos(substr($s,0,$close), "[quote");
if ($open === false)
return $s;
$quote = substr($s,$open,$close - $open + 8);
//[quote]Text[/quote]
$quote = preg_replace(
"/\[quote\]\s*((\s|.)+?)\s*\[\/quote\]\s*/i",
"<b>Citat:</b><blockquote>\\1</blockquote>", $quote);
//[quote=Author]Text[/quote]
$quote = preg_replace(
"/\[quote=(.+?)\]\s*((\s|.)+?)\s*\[\/quote\]\s*/i",
"<b>\\1 skrev:</b><blockquote>\\2</blockquote>", $quote);
$s = substr($s,0,$open) . $quote . substr($s,$close + 8);
}
return $s;
}
Nu skulle jag vilja fixa så att inga bilder syns i citatet, utan endast länken till bilden. Hur löser jag det?
Alltså.. om någon citerar ett inlägg som innehåller en bild, då vill jag automatiskt ta bort [ img ][ /img ] -taggarna, och endast visa länken till bilden i citatet.
