boardom Forum Index boardom
b2 message board
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

nofollow tag

 
Post new topic   Reply to topic    boardom Forum Index -> How to ?
View previous topic :: View next topic  
Author Message
lynn



Joined: 04 Jul 2003
Posts: 66
Location: USA

PostPosted: Sat Jan 22, 2005 4:00 pm    Post subject: nofollow tag Reply with quote

From Yahoo News:

Google Inc., Microsoft Corp.'s MSN division, Yahoo Inc. (Nasdaq:YHOO - news) and Six Apart Ltd. announced late Tuesday that they are supporting a tag called "nofollow" to exclude links in blog comments from search-engine crawlers and to prevent spam posts from influencing search rankings.

The rest of the article here: http://story.news.yahoo.com/news?tmpl=story&cid=1738&ncid=1738&e=7&u=/zd/20050118/tc_zd/142858

Sounds like a good idea. How do we do this in B2?
Back to top
View user's profile Send private message Visit poster's website
stevem



Joined: 15 Mar 2003
Posts: 365

PostPosted: Sat Jan 22, 2005 9:07 pm    Post subject: Reply with quote

I think this works. Try it and check View Source to see that it really does.

In b2template.functions.php look for
Code:
function make_clickable($text) { // original function: phpBB, extended here for AIM & ICQ
    $ret = " " . $text;
    $ret = preg_replace("#([\n ])([a-z]+?)://([^, <>{}\n\r]+)#i", "\\1<a href=\"\\2://\\3\" target=\"_blank\">\\2://\\3</a>", $ret);

In that last line add
Code:
rel=\"nofollow\"
so it reads
Code:
    $ret = preg_replace("#([\n ])([a-z]+?)://([^, <>{}\n\r]+)#i", "\\1<a href=\"\\2://\\3\" target=\"_blank\" rel=\"nofollow\">\\2://\\3</a>", $ret);

Then do the same thing 3 lines further down so that
Code:
    $ret = preg_replace("#([\n ])www\.([a-z0-9\-]+)\.([a-z0-9\-.\~]+)((?:/[^,< \n\r]*)?)#i", "\\1<a href=\"http://www.\\2.\\3\\4\" target=\"_blank\">www.\\2.\\3\\4</a>", $ret);

becomes
Code:
    $ret = preg_replace("#([\n ])www\.([a-z0-9\-]+)\.([a-z0-9\-.\~]+)((?:/[^,< \n\r]*)?)#i", "\\1<a href=\"http://www.\\2.\\3\\4\" target=\"_blank\" rel=\"nofollow\">www.\\2.\\3\\4</a>", $ret);
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    boardom Forum Index -> How to ? All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB 2 © 2001, 2002 phpBB Group