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
BBcode for facebook @ Tag
Collapse
X
-
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&sid=$sid\">Go to $who profile</a> ', $text ); to find a certain member im searching for, in Bbcode function Thanks
Comment
-
heres what i made for my mine
Code:$text = preg_replace("/\[user\=(.*?)\](.*?)\[\/user\]/is","<a href=\"index.php?action=viewuser&who=$1&sid=$sid\">$2</a>",$text);
Comment
-
Originally posted by wolvertoon View PostThankyou 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&sid=$sid\">Go to $who profile</a> ', $text ); to find a certain member im searching for, in Bbcode function Thanks
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&who=". $res [ 'user_id' ] ."&sid=$sid\">\\2</a>", $text ); } }
Comment
Comment