Stranice: [1]   Idi dole
Štampaj
Autor Tema: BB kodovi!  (Pročitano 982 puta)
kecap
VIP
Mozak foruma
******

Ugled: 9
Van mreže Van mreže

Poruke: 1.722

:) Punks not Dead


WWW
« poslato: Oktobar 01, 2008, 04:22:21 am »

Evo nekoliko nacina za BB kodove


BY marko 
Kod:
(a2-soft.com)

Kod:
<?php

function bbcode_format($text)
{
$text htmlentities($text);
$search = array('/\[b\](.*?)\[\/b\]/is''/\[i\](.*?)\[\/i\]/is');
$replace = array('<b>$1</b>''<i>$1</i>');
$str preg_replace ($search$replace$text);
return 
$str;
}

echo 
bbcode_format('[b]test bold[/b]...[i]test italic[/i] itd itd');

?>

by seti

Kod:
$trazi= array("/n");
$zameni= array("<br />");
str_replace ($trazi, $zameni, $text);


By Akon (edan moj ortak Smile )

Kod:
<?
function BBCode($text)
{
  $text = htmlspecialchars($text);
  $text = preg_replace("/\[b\](.*?)\[\/b\]/i","<b>\\1</b>", $text);
  $text = preg_replace("/\[i\](.*?)\[\/i\]/i","<i>\\1</i>", $text);
  $text = preg_replace("/\[u\](.*?)\[\/u\]/i","<u>\\1</u>", $text);
  $text = preg_replace("/\[big\](.*?)\[\/big\]/i","<big>\\1</big>", $text);
  $text = preg_replace("/\[small\](.*?)\[\/small\]/i","<small>\\1</small>", $text);
  $text = preg_replace("/\[url\=(.*?)\](.*?)\[\/url\]/is","<a href=\"$1\">$2</a>",$text);
  $text = str_replace("[br/]", "<br />", $text);
  return $text;
}

$Go = $_GET["Go"];

if($Go = "Post"){
$FormText = BBCode($_POST["FormText"]);
echo "Text je: " . $FormText;
} else {
?>
<div>
<form action="?Go=Post" method="post">
<textarea name="FormText" rows="10"><?= $FormText; ?></textarea><br />
<input type="submit" />
</form>
</div>
<?
}
?>

pa sad vi vidite sta vam odgovara Smile

Sačuvana

kobra699
Uspesan clan
**

Ugled: 0
Van mreže Van mreže

Poruke: 25


« Odgovor #1 poslato: Avgust 11, 2010, 11:07:57 am »

Druze imas nesto za ubacivanje smajlija,ubi se pokusavajuci da smislim nesto kako da ih ubacim u postove  exclaim
Sačuvana
ZEROF
Administrator
Man at work!
******

Ugled: 41
Van mreže Van mreže

Poruke: 3.085


H4ck3r u penziji !


WWW
« Odgovor #2 poslato: Avgust 13, 2010, 04:37:50 am »

Kecap ti je vec odgovorio na pitanje.
Sačuvana

In God we trust, the rest we monitor.

YouTube>My Channe>Channel Info>Channel Type>Director
Stranice: [1]   Idi gore
Štampaj
Prebaci se na:  

Naša mreža: Bg-dizajn.com | AstaHost | Anonimus | My Exploit | Lovac Na Novac | RE.rs
Partneri: Net Centar | EE.RS portal | Maturski | Svet Igara