Bbcodes Complete List And Tutorial

Started on the old forum in January 2008 · view the original in the archive · old links redirect here

6 replies · 862 views · started 18 years ago · 1 min read

4 participants
alesh Lead · 604 posts #2

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

  if (isadmin(getuid_sid($sid)))
  {
    $text=preg_replace("/\[b\](.*?)\[\/b\]/i","[b]\\1[/b]", $text);
  }

eeeeerrr....

ozziemale31 Lead · 861 posts #3

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

  if (isadmin(getuid_sid($sid)))
  {
    $text=preg_replace("/\[b\](.*?)\[\/b\]/i","\\1", $text);
  }

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 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","\1", $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

External image (may be gone) External image (may be gone)

External image (may be gone)

*****

**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 ***

alesh Lead · 604 posts #4

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 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","\1", $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

yeah i thought so

eeeeerrr....

metulj Super moderator Principal · 1,726 posts #5

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 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","\1", $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

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 External image (may be gone)

It's better to keep your mouth shut and give the impression that you're stupid, than to open it and remove all doubt. ⓣⓗⓔ ⓠⓤⓘⓔⓣⓔⓡ ⓨⓞⓤ ⓑⓔ©ⓞⓜⓔ, ⓣⓗⓔ ⓜⓞⓡⓔ ⓨⓞⓤ ⓐⓡⓔ ⓐⓑⓛⓔ ⓣⓞ ⓗⓔⓐⓡ ! ιη тнєσяу, тнє ρяα¢тι¢є ιѕ α яєѕυℓт σƒ тнє тнєσяу, вυт ιη ρяα¢тι¢є ιѕ тнє σρρσѕιтє.

キノgんイノ刀g 4 ア乇ムc乇 ノ丂 レノズ乇 キucズノ刀g 4 √ノ尺gノ刀ノイリ!

alesh Lead · 604 posts #6

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 External image (may be gone)

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 LMFAO

eeeeerrr....

mcKeny Developer · 130 posts #7

yeah its possible i uses array for my bbcode

//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);

it works one hundred percent

R.M.C

PHP Adovocate B)

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close