 |
 |
 |
 |
Registered: 12/25/03
Posts: 125
|
|
|
 |
 |
 |
 |
|
 |
 |
 |
 |
|
Express Hosting
"We are the official hosting company of UBB.threads. Ask us about our free migration services to migrate your UBB.threads installation."
|
|
|
 |
 |
 |
 |
 |
 |
 |
 |
#201650 - 11/18/07 11:01 PM
Re: "nofollow" added to links users post? Is this possible?
[Re: willing]
|
|
Registered: 06/05/06
Posts: 14995
Loc: Portland, OR; USA
|
|
It's straight forward... simple as can be... find the lines, add the rel comment, in the url tag... You see: // Link regexes here
$body = preg_replace( "#\[url\](https|http|ftp)://([^\"\[\]<>]+?)\[/url]#i", '<a href="\1://\2" target="_blank">\1://\2</a>',$body );
$body = preg_replace( "#\[url\]([^\"\[\]<>]+?)\[/url\]#i", '<a href="http://\1" target="_blank">\1</a>',$body );
$body = preg_replace( "#\[url=(https|http|ftp)://([^\"\[\]<> ]+?)\](.+?)\[/url]#i", '<a href="\1://\2" target="_blank">\3</a>',$body);
$body = preg_replace("#(<br />|^|\s)(http|https|ftp)://([^<\"\[\s]+)(\.|\,|\?|\)|\s)?#i", '\1<a href="\2://\3" target="_blank">\2://\3</a>\4',$body);
$body = preg_replace( "#(<br />|^|\s)(www\.[^<\"\[\s]+)(\.|\,|\?|\)|\s)?#i", '\1<a href="http://\2" target="_blank">http://\2</a>\3',$body );You do: // Link regexes here
$body = preg_replace( "#\[url\](https|http|ftp)://([^\"\[\]<>]+?)\[/url]#i", '<a href="\1://\2" target="_blank">\1://\2</a>',$body );
$body = preg_replace( "#\[url\]([^\"\[\]<>]+?)\[/url\]#i", '<a href="http://\1" rel="nofollow" target="_blank">\1</a>',$body );
$body = preg_replace( "#\[url=(https|http|ftp)://([^\"\[\]<> ]+?)\](.+?)\[/url]#i", '<a href="\1://\2" rel="nofollow" target="_blank">\3</a>',$body);
$body = preg_replace("#(<br />|^|\s)(http|https|ftp)://([^<\"\[\s]+)(\.|\,|\?|\)|\s)?#i", '\1<a href="\2://\3" rel="nofollow" target="_blank">\2://\3</a>\4',$body);
$body = preg_replace( "#(<br />|^|\s)(www\.[^<\"\[\s]+)(\.|\,|\?|\)|\s)?#i", '\1<a href="http://\2" rel="nofollow" target="_blank">http://\2</a>\3',$body );
|
|
Top
|
|
|
|
|
 |
 |
 |
 |
 |
 |
 |
 |
#201661 - 11/19/07 07:12 AM
Re: "nofollow" added to links users post? Is this possible?
[Re: Gizmo]
|
old hand
|
Registered: 02/12/07
Posts: 701
|
|
|
|
|
Top
|
|
|
|
|
 |
 |
 |
 |
 |
 |
 |
 |
#204706 - 01/13/08 05:54 AM
Re: "nofollow" added to links users post? Is this possible?
[Re: Gizmo]
|
old hand
|
Registered: 02/12/07
Posts: 701
|
|
|
|
|
Top
|
|
|
|
|
 |
 |
 |
 |
|
|