BBcode for facebook @ Tag

Started on the old forum in November 2010 · view the original in the archive · old links redirect here

6 replies · 777 views · started 16 years ago · 1 min read

4 participants
wolvertoon Newbie · 9 posts #1

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 🙂

Hi im Antione Tony Thanks to all for the help everyone has giving me on coding-talk, im here almost everyday Here to code/create and learn new stuff , If I can help I will but please say thanks and friends on the way is a total bonus as we all have something in common we love creating new stuff 🙂

MuniGod Junior · 23 posts #2

Something like that maybe..

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

www.wapruby.com - Create your own WAP site and earn money.

wolvertoon Newbie · 9 posts #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&sid=$sid">Go to $who profile</a> ', $text ); to find a certain member im searching for, in Bbcode function Thanks 🙂

Hi im Antione Tony Thanks to all for the help everyone has giving me on coding-talk, im here almost everyday Here to code/create and learn new stuff , If I can help I will but please say thanks and friends on the way is a total bonus as we all have something in common we love creating new stuff 🙂

nclemale36 Lead · 537 posts #4

heres what i made for my mine

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

works like normal bbcode @[click here] only thing is it uses id numbers and not the nick name.

wolvertoon Newbie · 9 posts #5

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

Hi im Antione Tony Thanks to all for the help everyone has giving me on coding-talk, im here almost everyday Here to code/create and learn new stuff , If I can help I will but please say thanks and friends on the way is a total bonus as we all have something in common we love creating new stuff 🙂

MuniGod Junior · 23 posts #6

wolvertoon wrote: 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 :)

You can something like:

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

I don't know or this works. But you should understand the principle.

www.wapruby.com - Create your own WAP site and earn money.

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