hope this tutorial will help you guys in bbcode formats on your scripts
Bbcodes Complete List And Tutorial
Collapse
X
-
hmmm okay... i guess... lol
but i would like 2 knw how cn i make tht only admins of site write sum BB codes....?
in lava script 4 exsample.......
is ti tht i just put tht bb code
Code:if (isadmin(getuid_sid($sid))) { $text=preg_replace("/\[b\](.*?)\[\/b\]/i","[b]\\1[/b]", $text); }sigpiceeeeerrr....
-
easy just use the function in core.php copy that and add to the new bbcode funtions u dnt want normal users to use like this for examplehmmm okay... i guess... lol
but i would like 2 knw how cn i make tht only admins of site write sum BB codes....?
in lava script 4 exsample.......
is ti tht i just put tht bb code
[/b]Code:if (isadmin(getuid_sid($sid))) { $text=preg_replace("/\[b\](.*?)\[\/b\]/i","[b]\\1[/b]", $text); }
function getbbcode($text, $sid="")
{
$text=preg_replace("/\[b\](.*?)\[\/b\]/i","\\1", $text);
$text=preg_replace("/\[i\](.*?)\[\/i\]/i","\\1", $text);
$text=preg_replace("/\[u\](.*?)\[\/u\]/i","\\1", $text);
$text=preg_replace("/\[big\](.*?)\[\/big\]/i","<big>\\1</big>", $text);
$text=preg_replace("/\[small\](.*?)\[\/small\]/i","\\1", $text);
$text = preg_replace("/\[url\=(.*?)\](.*?)\[\/url\]/is","<a href=\"$1\">$2</a>",$text);
$text = preg_replace("/\[topic\=(.*?)\](.*?)\[\/topic\]/is","<a href=\"index.php?action=viewtpc&tid=$1&sid =$sid\">$2</a>",$text);
$text = preg_replace("/\[club\=(.*?)\](.*?)\[\/club\]/is","<a href=\"index.php?action=gocl&clid=$1&sid=$ sid\">$2</a>",$text);
if(ismod($uid))
{
$text = preg_replace("/\[blog\=(.*?)\](.*?)\[\/blog\] is","<ahref=\"index.php?action=viewblog&bid=$1 &sid=$sid\">$2</a>",$text);
$text = ereg_replace("http://[A-Za-z0-9./=?-_]+","<a href=\"\\\">\</a>", $text);
if(substr_count($text,"[br/]")<=3){
$text = str_replace("[br/]","
",$text);
}
}
maybe that will work lol havennt thought of that feature but yeah guess that would be ho u add it in



Dont Ask Me Dumb Questions.Or you'l get a Dumb Answer..
Want A Profesional Logo or Theme For Your wap site Pm Me.If I Have The Time Ill Make It For Free
Comment
-
yeah i thought soeasy just use the function in core.php copy that and add to the new bbcode funtions u dnt want normal users to use like this for example
function getbbcode($text, $sid="")
{
$text=preg_replace("/\[b\](.*?)\[\/b\]/i","\\1", $text);
$text=preg_replace("/\[i\](.*?)\[\/i\]/i","\\1", $text);
$text=preg_replace("/\[u\](.*?)\[\/u\]/i","\\1", $text);
$text=preg_replace("/\[big\](.*?)\[\/big\]/i","<big>\\1</big>", $text);
$text=preg_replace("/\[small\](.*?)\[\/small\]/i","\\1", $text);
$text = preg_replace("/\[url\=(.*?)\](.*?)\[\/url\]/is","<a href=\"$1\">$2</a>",$text);
$text = preg_replace("/\[topic\=(.*?)\](.*?)\[\/topic\]/is","<a href=\"index.php?action=viewtpc&tid=$1&sid =$sid\">$2</a>",$text);
$text = preg_replace("/\[club\=(.*?)\](.*?)\[\/club\]/is","<a href=\"index.php?action=gocl&clid=$1&sid=$ sid\">$2</a>",$text);
if(ismod($uid))
{
$text = preg_replace("/\[blog\=(.*?)\](.*?)\[\/blog\] is","<ahref=\"index.php?action=viewblog&bid=$1 &sid=$sid\">$2</a>",$text);
$text = ereg_replace("http://[A-Za-z0-9./=?-_]+","<a href=\"\\\">\</a>", $text);
if(substr_count($text,"[br/]")<=3){
$text = str_replace("[br/]","
",$text);
}
}
maybe that will work lol havennt thought of that feature but yeah guess that would be ho u add it in[/b]sigpiceeeeerrr....
Comment
-
hmm i think this will only make only MOD and above permission to see that bb codeeasy just use the function in core.php copy that and add to the new bbcode funtions u dnt want normal users to use like this for example
function getbbcode($text, $sid="")
{
$text=preg_replace("/\[b\](.*?)\[\/b\]/i","\\1", $text);
$text=preg_replace("/\[i\](.*?)\[\/i\]/i","\\1", $text);
$text=preg_replace("/\[u\](.*?)\[\/u\]/i","\\1", $text);
$text=preg_replace("/\[big\](.*?)\[\/big\]/i","<big>\\1</big>", $text);
$text=preg_replace("/\[small\](.*?)\[\/small\]/i","\\1", $text);
$text = preg_replace("/\[url\=(.*?)\](.*?)\[\/url\]/is","<a href=\"$1\">$2</a>",$text);
$text = preg_replace("/\[topic\=(.*?)\](.*?)\[\/topic\]/is","<a href=\"index.php?action=viewtpc&tid=$1&sid =$sid\">$2</a>",$text);
$text = preg_replace("/\[club\=(.*?)\](.*?)\[\/club\]/is","<a href=\"index.php?action=gocl&clid=$1&sid=$ sid\">$2</a>",$text);
if(ismod($uid))
{
$text = preg_replace("/\[blog\=(.*?)\](.*?)\[\/blog\] is","<ahref=\"index.php?action=viewblog&bid=$1 &sid=$sid\">$2</a>",$text);
$text = ereg_replace("http://[A-Za-z0-9./=?-_]+","<a href=\"\\\">\</a>", $text);
if(substr_count($text,"[br/]")<=3){
$text = str_replace("[br/]","
",$text);
}
}
maybe that will work lol havennt thought of that feature but yeah guess that would be ho u add it in[/b]
and alesh want something else.. he wants only MOD and above permission can USE BB code
キノgんイノ刀g 4 ア乇ムc乇 ノ丂 レノズ乇 キucズノ刀g 4 √ノ尺gノ刀ノイリ!It's better to keep your mouth shut and give the impression that you're stupid, than to open it and remove all doubt.
ⓣⓗⓔ ⓠⓤⓘⓔⓣⓔⓡ ⓨⓞⓤ ⓑⓔ©ⓞⓜⓔ, ⓣⓗⓔ ⓜⓞⓡⓔ ⓨⓞⓤ â“â“¡â“” â“ⓑⓛⓔ ⓣⓞ â“—â“”â“â“¡ !
ιη тнєσÑу, тнє ÏÑα¢тι¢є ιѕ α Ñєѕυℓт σƒ тнє тнєσÑу, вυт ιη ÏÑα¢тι¢є ιѕ тнє σÏÏσѕιтє.
Comment
-
hmm i think this will only make only MOD and above permission to see that bb code
and alesh want something else.. he wants only MOD and above permission can USE BB code
[/b]
hmmm yees, i didnt tried yet but i also thnk tht way...
no good....
i want all cn c BB code but tht only mods cn write it in BB code style
example is tht freakin site proCRAPdigits lol
mods cn write clicable links and users c em, but than again users cannot writ clicable links...
i knw the temporal way.....
4 example
$text=preg_replace("/\[only_me_cn_write_this\](.*?)\[\/only_me_cn_write_this\]/i","\\1", $text);
lol
so only u knw the right BB code LMFAOsigpiceeeeerrr....
Comment
-
yeah its possible i uses array for my bbcodeit works one hundred percentCode://patern to replace $patern =array( '/\[url=(.*?)\](.*?)\[\/url\]/is'); if(!isadmin(getuid_sid($sid)) { $with=array("only admin can use this code :P "); } else { //user is a admin $with = array("<a href=\"$1\">$2</a>"); } $from ="[url=http://Jamvibes.org]Jam Vibes[/url]"; echo preg_replace($patern,$with,$from);
R.M.C
----------
PHP Adovocate B)
Comment
Comment