BBcode for facebook @ Tag

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

    BBcode for facebook @ Tag

    Hi everyone I was wandering on facebook it has a @ tag feature for example @antione tony it goes straight to my profile or @ravenwood fair I dont wanna use a external url just a insite url that uses the @ tag say on my site my name there is mrsaucy but have click links and links would be nice all around the site to have a msg box or whatever to put @mrsaucy then it goes straight to my profile or @inbox @extras @forums etc how would I possibily do that I have no idea how to link it within a site I use php and html only did look at the api facebook but It looked alien to me had a attempt but give up as it was too hard lol any ideas would be fantastic thanks very much

    #2
    Something like that maybe..

    Code:
    $text = str_replace ( "@inbox", '<a href="we_go_to_inbox.php?blablabla">Inbox</a>', $text );
    $text = str_replace ( "@extras", '<a href="we_go_to_extras.php?blablabla">Extras</a>', $text );
    Last edited by MuniGod; 22.11.10, 10:06.

    Comment


      #3
      Thankyou munigod for your reply and answer , I will certernly try that out in a minute what about profile @mrsaucy ,would I use
      $text = str_replace ( "@$who", '<a href=\"./profile.php?who=$who&amp;sid=$sid\">Go to $who profile</a> ', $text ); to find a certain member im searching for, in Bbcode function Thanks
      Last edited by wolvertoon; 22.11.10, 10:23. Reason: I needed to explain more clearly

      Comment


        #4
        heres what i made for my mine

        Code:
        $text = preg_replace("/\[user\=(.*?)\](.*?)\[\/user\]/is","<a href=\"index.php?action=viewuser&amp;who=$1&amp;sid=$sid\">$2</a>",$text);
        works like normal bbcode GumSlone only thing is it uses id numbers and not the nick name.
        Wapchat4u


        Topsites4u

        Comment


          #5
          Thanks again MuniGod its all sorted works perfect and Thankyou very much Dave gives me another Idea aswell your a star cheers

          Comment


            #6
            Originally posted by wolvertoon View Post
            Thankyou munigod for your reply and answer , I will certernly try that out in a minute what about profile @mrsaucy ,would I use
            $text = str_replace ( "@$who", '<a href=\"./profile.php?who=$who&amp;sid=$sid\">Go to $who profile</a> ', $text ); to find a certain member im searching for, in Bbcode function Thanks
            You can something like:

            Code:
            if ( preg_match ( "#@([a-zA-Z0-9]+)#i", $text, $match ) )
            {
            	$res = mysql_fetch_array ( mysql_query ( "SELECT user_id FROM table WHERE username='". mysql_real_escape_string ( $match [ 1 ] ) ."'" ) );
            	if ( $res [ 'user_id' ] > 0 )
            	{
            		$text = preg_replace ( "#@([a-zA-Z0-9]+)#i", "<a href=\"index.php?action=viewuser&amp;who=". $res [ 'user_id' ] ."&amp;sid=$sid\">\\2</a>", $text );
            	}
            }
            I don't know or this works. But you should understand the principle.

            Comment


              #7
              check in thebbcodes post i put up in the coding forum... i goit a bbcode for basically that exact function... @username profile linking...
              C3 Themes: http://c3themes.wen.ru/index.html
              Find Files: http://mystarter.tk/?goto=X-search

              Comment

              Working...
              X