Bbcodes

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Bbcodes

    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
    Code:
    $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&amp;sid=$sid\">Inbox $unrd</a>",$text);
    this when u use it u can update ur profile
    Code:
    $text = preg_replace("/\[updatepro]/is","<a href=\"index.php?action=uset&amp;sid=$sid\">Update Profie</a>",$text);
    this will make ur text bold
    Code:
     $text = preg_replace("/\[b\](.*?)\[\/b\]/i","<b>\\1</b>", $text);
    this will make ur text italic
    Code:
     $text = preg_replace("/\[i\](.*?)\[\/i\]/i","<i>\\1</i>", $text);
    this will make ur text underline
    Code:
     $text = preg_replace("/\[u\](.*?)\[\/u\]/i","<u>\\1</u>", $text);
    this will make ur text big
    Code:
     $text = preg_replace("/\[big\](.*?)\[\/big\]/i","<big>\\1</big>", $text);
    this will make ur text small
    Code:
     $text = preg_replace("/\[small\](.*?)\[\/small\]/i","<small>\\1</small>", $text);
    here u give url to members
    Code:
     $text = preg_replace("/\[url\=(.*?)\](.*?)\[\/url\]/is","<a href=\"$1\">$2</a>",$text);
    here u give img to members
    Code:
     $text = preg_replace("/\[img\=(.*?)\]/is","<img src=\"$1\">",$text);
    here u can quote to members post have to fix (NOT TESTED)
    Code:
    $text = preg_replace("/\[quote\=(.*?)\](.*?)\[\/quote\]/is","<a href=\"index.php?action=post&amp;tid=$tid\">$2</a>",$text);
    here u make ur text coloured
    Code:
     $text = preg_replace("/\[clr\=(.*?)\](.*?)\[\/clr\]/is","<font color=\"$1\">$2</font>",$text);
    here u send link to topic
    Code:
     $text = preg_replace("/\[topic\=(.*?)\](.*?)\[\/topic\]/is","<a href=\"index.php?action=viewtpc&amp;tid=$1&amp;sid=$sid\">$2</a>",$text);
    here u send link to forum
    Code:
      $text = preg_replace("/\[forum\=(.*?)\](.*?)\[\/forum\]/is","<a href=\"index.php?action=viewfrm&amp;tid=$1&amp;sid=$sid\">$2</a>",$text);
    here u send link to club
    Code:
     $text = preg_replace("/\[club\=(.*?)\](.*?)\[\/club\]/is","<a href=\"index.php?action=gocl&amp;clid=$1&amp;sid=$sid\">$2</a>",$text);
    here u send link to blog
    Code:
    $text = preg_replace("/\[blog\=(.*?)\](.*?)\[\/blog\]/is","<a href=\"index.php?action=viewblog&amp;bid=$1&amp;sid=$sid\">$2</a>",$text);
    here u can send the user phone model out
    Code:
    $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
    Last edited by riderz; 14.09.09, 20:48.

    #2
    i gotten this 2 more but dnt know how to use it
    Code:
     $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
    Code:
    $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
    Code:
      $text = preg_replace("/\[galerie\=(.*?)\](.*?)\[\/galerie\]/is","<a href=\"album.php?action=viewtpc&amp;tid=$1&amp;sid=$sid\">$2</a>",$text);
    Last edited by riderz; 14.09.09, 22:09.

    Comment


      #3
      Originally posted by riderz View Post
      i gotten this 2 more but dnt know how to use it

      Code:
       $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...
      Last edited by wap2k; 15.09.09, 01:10.

      Comment


        #4
        Originally posted by wap2k View Post
        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:
        PHP Code:
        $text preg_replace"#\(scr:(.+?)\)(.+?)\(/scr\)#is""<marquee loop=\"800\" bgcolor=\"\\1\" direction=\"right\">\\2</marquee>"$text ); 
        (untested)

        Comment

        Working...
        X