Bbcodes

Started on the old forum in September 2009 · view the original in the archive · old links redirect here

3 replies · 655 views · started 17 years ago · 2 min read

3 participants
riderz Lead · 975 posts #1

Wel here is sumthing nice u could use and if u have more please do post them here This one if u use it it will take the member directly to the inbox

$unreadinbox=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_private WHERE unread='1' AND touid='".$uid."'"));
        $pmtotl=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_private WHERE touid='".$uid."'"));
     
   $unrd="[".$unreadinbox[0]."l".$pmtotl[0]."]";
      
  $text = preg_replace("/\[inbox]/is","<a href=\"inbox.php?action=main&sid=$sid\">Inbox $unrd</a>",$text);

this when u use it u can update ur profile

$text = preg_replace("/\[updatepro]/is","<a href=\"index.php?action=uset&sid=$sid\">Update Profie</a>",$text);
 

this will make ur text bold

 $text = preg_replace("/\[b\](.*?)\[\/b\]/i","<b>\\1</b>", $text);

this will make ur text italic

 $text = preg_replace("/\[i\](.*?)\[\/i\]/i","<i>\\1</i>", $text);

this will make ur text underline

 $text = preg_replace("/\[u\](.*?)\[\/u\]/i","<u>\\1</u>", $text);

this will make ur text big

 $text = preg_replace("/\[big\](.*?)\[\/big\]/i","<big>\\1</big>", $text);

this will make ur text small

 $text = preg_replace("/\[small\](.*?)\[\/small\]/i","<small>\\1</small>", $text);

here u give url to members

 $text = preg_replace("/\[url\=(.*?)\](.*?)\[\/url\]/is","<a href=\"$1\">$2</a>",$text);

here u give img to members

 $text = preg_replace("/\[img\=(.*?)\]/is","<img src=\"$1\">",$text);
here u can quote to members post have to fix (NOT TESTED)
$text = preg_replace("/\[quote\=(.*?)\](.*?)\[\/quote\]/is","<a href=\"index.php?action=post&tid=$tid\">$2</a>",$text);
 

here u make ur text coloured

 $text = preg_replace("/\[clr\=(.*?)\](.*?)\[\/clr\]/is","<font color=\"$1\">$2</font>",$text);
 

here u send link to topic

 $text = preg_replace("/\[topic\=(.*?)\](.*?)\[\/topic\]/is","<a href=\"index.php?action=viewtpc&tid=$1&sid=$sid\">$2</a>",$text);

here u send link to forum

  $text = preg_replace("/\[forum\=(.*?)\](.*?)\[\/forum\]/is","<a href=\"index.php?action=viewfrm&tid=$1&sid=$sid\">$2</a>",$text);

here u send link to club

 $text = preg_replace("/\[club\=(.*?)\](.*?)\[\/club\]/is","<a href=\"index.php?action=gocl&clid=$1&sid=$sid\">$2</a>",$text);
  

here u send link to blog

$text = preg_replace("/\[blog\=(.*?)\](.*?)\[\/blog\]/is","<a href=\"index.php?action=viewblog&bid=$1&sid=$sid\">$2</a>",$text);

here u can send the user phone model out

$bro=("$REMOTE_ADDR");
    $usr = explode("/",$_SERVER['HTTP_USER_AGENT']);
    $phone = ("$usr[0]");
$text = str_replace("[phone]","$phone",$text);

hope u all have more to give


Jacques jacques@gw-designs.co.za http://coding.biz.tm Come join and lets make it a place to learn all the noobies how to code


NEVER FORGET TO CLICK THE TANX BUTTON IF U LIKE WHAT IM SHARING OR HELPING WITH

riderz Lead · 975 posts #2

i gotten this 2 more but dnt know how to use it

 $text = preg_replace( "#\(scr:red\)(.+?)\(/scr\)#is", "<marquee loop=\"800\" bgcolor=\"#FF0000\" direction=\"right\">\\1</marquee>", $text );
$text = eregi_replace("pbook:([^<>[:space:]]+[[:alnum:]/])","<a href=\"wtai://wp/ap;\\1;Retrivewap\">My No: \\1</a>", $text);

here are some colour bbcodes

$text = htmlspecialchars($text);
  $text=preg_replace("/\[yellow\](.*?)\[\/yellow\]/i","<font color=\"yellow\">\\1</font>", $text);
   $text=preg_replace("/\[red\](.*?)\[\/red\]/i","<font color=\"red\">\\1</font>", $text);
    $text=preg_replace("/\[blue\](.*?)\[\/blue\]/i","<font color=\"blue\">\\1</font>", $text);
     $text=preg_replace("/\[green\](.*?)\[\/green\]/i","<font color=\"green\">\\1</font>", $text);
      $text=preg_replace("/\[orange\](.*?)\[\/orange\]/i","<font color=\"orange\">\\1</font>", $text);
       $text=preg_replace("/\[black\](.*?)\[\/black\]/i","<font color=\"black\">\\1</font>", $text);
        $text=preg_replace("/\[pink\](.*?)\[\/pink\]/i","<font color=\"pink\">\\1</font>", $text);
         $text=preg_replace("/\[brown\](.*?)\[\/brown\]/i","<font color=\"brown\">\\1</font>", $text);
          $text=preg_replace("/\[silver\](.*?)\[\/silver\]/i","<font color=\"silver\">\\1</font>", $text);
            $text=preg_replace("/\[gri\](.*?)\[\/grey\]/i","<font color=\"grey\">\\1</font>", $text);

see user gallery (have to edit to work on ur site

  $text = preg_replace("/\[galerie\=(.*?)\](.*?)\[\/galerie\]/is","<a href=\"album.php?action=viewtpc&tid=$1&sid=$sid\">$2</a>",$text);

Jacques jacques@gw-designs.co.za http://coding.biz.tm Come join and lets make it a place to learn all the noobies how to code


NEVER FORGET TO CLICK THE TANX BUTTON IF U LIKE WHAT IM SHARING OR HELPING WITH

wap2k Developer · 168 posts #3

riderz wrote: i gotten this 2 more but dnt know how to use it

 $text = preg_replace( "#\(scr:red\)(.+?)\(/scr\)#is", "<marquee loop=\"800\" bgcolor=\"#FF0000\" direction=\"right\">\\1</marquee>", $text );
$text = eregi_replace("pbook:([^<>[:space:]]+[[:alnum:]/])","<a href=\"wtai://wp/ap;\\1;Retrivewap\">My No: \\1</a>", $text);

The first creates a marquee scrolling message and you use it like this (scr:red)lol(/scr)...

The second one is used like pbook:+27123456 and it displays a clickable mobile number for mose wap enabled mobile phones, save to phonebook, call, send message ect... 🙂

something else Fellow · 2,296 posts #4

wap2k wrote: The first creates a marquee scrolling message and you use it like this (scr:red)lol(/scr)...

The second one is used like pbook:+27123456 and it displays a clickable mobile number for mose wap enabled mobile phones, save to phonebook, call, send message ect... :)

probably more hand like:

$text = preg_replace( "#\(scr:(.+?)\)(.+?)\(/scr\)#is", "<marquee loop=\"800\" bgcolor=\"\\1\" direction=\"right\">\\2</marquee>", $text );

(untested)

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