| :: |
| Author |
Message |
AmirAbbas phpBB SEO Team


Joined: 11 May 2006 Posts: 529 Location: IRAN
|
|
| Back to top |
|
 |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 13354
|
Posted: Wed Nov 29, 2006 11:33 pm Post subject: Re: how can i disable the links in text body ? |
|
|
The link is made active in phpBB post in viewtopic, using the make_clickable() phpBB function.
Look for :
| Code: | | $message = make_clickable($message); |
As you see, just one line above there is :
| Code: | if ( $user_sig != '' )
{
$user_sig = make_clickable($user_sig);
} |
Wich is as well turning URLs into active links but in the signature this time.
Let's do this nicely.
Open :
viewtopic.php
Find :
| Code: |
if ( $user_sig != '' )
{
$user_sig = make_clickable($user_sig);
}
$message = make_clickable($message); |
replace with :
| Code: | // www.phpBB-SEO.com SEO TOOLKIT BEGIN
// Set here the limit before links are active
// 0 for never
$min_posts = 25;
if (intval($postrow[$i]['user_posts']) > $min_posts ) {
if ( $user_sig != '' )
{
$user_sig = make_clickable($user_sig);
}
$message = make_clickable($message);
}
// www.phpBB-SEO.com SEO TOOLKIT END |
This way, the links becomes active once the user has reach a certain amount of posts, set up on this line :
The bold thing need some changes in make_clickable(), tell me if you really want it
++ |
_________________ Useful links :
SEO Forum || SEO Directory || SEO phpBB || SEO phpBB3 || Search
____________________
Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Référencement phpBB3 || Recherche |
|
| Back to top |
|
 |
AmirAbbas phpBB SEO Team


Joined: 11 May 2006 Posts: 529 Location: IRAN
|
|
| Back to top |
|
 |
AmirAbbas phpBB SEO Team


Joined: 11 May 2006 Posts: 529 Location: IRAN
|
|
| Back to top |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 13354
|
|
| Back to top |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 13354
|
Posted: Sun Dec 03, 2006 4:46 pm Post subject: Re: how can i disable the links in text body ? |
|
|
All right, finally, I came up with a simple one
Open :
find :
| Code: | if ( $user_sig != '' )
{
$user_sig = make_clickable($user_sig);
}
$message = make_clickable($message); |
Replace with :
| Code: | // www.phpBB-SEO.com SEO TOOLKIT BEGIN
// Set here the limit before links are active
// 0 for never
$min_posts = 25;
if (intval($postrow[$i]['user_posts']) > $min_posts ) {
if ( $user_sig != '' ) {
$user_sig = make_clickable($user_sig);
}
$message = make_clickable($message);
} else {
if ( $user_sig != '' ) {
$user_sig = make_boldlink($user_sig);
}
$message = make_boldlink($message);
}
// www.phpBB-SEO.com SEO TOOLKIT END |
Open :
| Code: |
includes/bbcode.php |
Find :
| Code: |
// Remove our padding..
$ret = substr($ret, 1);
return($ret);
} |
After add :
| Code: | // www.phpBB-SEO.com SEO TOOLKIT BEGIN
/**
* Will do the same matchings as make_clickable() but will add bold
* instead of href tags.
* email will be outputed bolds and inactive too : email-AT-domain.com
*/
function make_boldlink($text)
{
$text = preg_replace('#(script|about|applet|activex|chrome):#is', "\\1:", $text);
// pad it with a space so we can match things at the start of the 1st line.
$ret = ' ' . $text;
// matches an "xxxx://yyyy" URL at the start of a line, or after a space.
// xxxx can only be alpha characters.
// yyyy is anything up to the first space, newline, comma, double quote or <
$ret = preg_replace("#(^|[\n ])([\w]+?://[\w\#$%&~/.\-;:=,?@\[\]+]*)#is", "\\1<b>\\2</b>", $ret);
// matches a "www|ftp.xxxx.yyyy[/zzzz]" kinda lazy URL thing
// Must contain at least 2 dots. xxxx contains either alphanum, or "-"
// zzzz is optional.. will contain everything up to the first space, newline,
// comma, double quote or <.
$ret = preg_replace("#(^|[\n ])((www|ftp)\.[\w\#$%&~/.\-;:=,?@\[\]+]*)#is", "\\1<b>\\2</b>", $ret);
// matches an email@domain type address at the start of a line, or after a space.
// Note: Only the followed chars are valid; alphanums, "-", "_" and or ".".
$ret = preg_replace("#(^|[\n ])([a-z0-9&\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)*[\w]+)#i", "\\1<b>\\2-AT-\\3</b>", $ret);
// Remove our padding..
$ret = substr($ret, 1);
return($ret);
}
// www.phpBB-SEO.com SEO TOOLKIT END |
 |
_________________ Useful links :
SEO Forum || SEO Directory || SEO phpBB || SEO phpBB3 || Search
____________________
Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Référencement phpBB3 || Recherche |
|
| Back to top |
|
 |
AmirAbbas phpBB SEO Team


Joined: 11 May 2006 Posts: 529 Location: IRAN
|
|
| Back to top |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 13354
|
|
| Back to top |
|
 |
AmirAbbas phpBB SEO Team


Joined: 11 May 2006 Posts: 529 Location: IRAN
|
|
| Back to top |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 13354
|
Posted: Sat Dec 09, 2006 6:18 pm Post subject: Re: how can i disable the links in text body ? |
|
|
I'll compile this into a mod when we'll have all the feature we want.
To add nofollow tag for the links posted without bbcode :
like this http://www.phpbb-seo.com/boards/
Open :
| Code: | | includes/bbcode.php |
Find :
| Code: | $ret = preg_replace("#(^|[\n ])([\w]+?://[\w\#$%&~/.\-;:=,?@\[\]+]*)#is", "\\1<a href=\"\\2\" target=\"_blank\">\\2</a>", $ret);
|
Replace with :
| Code: | // www.phpBB-SEO.com SEO TOOLKIT BEGIN
$ret = preg_replace("#(^|[\n ])([\w]+?://[\w\#$%&~/.\-;:=,?@\[\]+]*)#is", "\\1<a href=\"\\2\" rel=\"nofollow\" target=\"_blank\">\\2</a>", $ret);
// www.phpBB-SEO.com SEO TOOLKIT END |
To add them even in bbcode links open :
| Code: | | template/subSilver/bbcode.tpl |
Find :
| Code: | | <!-- BEGIN url --><a href="{URL}" target="_blank" class="postlink">{DESCRIPTION}</a><!-- END url --> |
Replace with :
| Code: |
<!-- BEGIN url --><a href="{URL}" rel="nofollow" target="_blank" class="postlink">{DESCRIPTION}</a><!-- END url --> |
But this would concern all links, I'll see how to only add the nofollow tag to external links only.
++ |
_________________ Useful links :
SEO Forum || SEO Directory || SEO phpBB || SEO phpBB3 || Search
____________________
Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Référencement phpBB3 || Recherche |
|
| Back to top |
|
 |
AmirAbbas phpBB SEO Team


Joined: 11 May 2006 Posts: 529 Location: IRAN
|
|
| Back to top |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 13354
|
|
| Back to top |
|
 |
AmirAbbas phpBB SEO Team


Joined: 11 May 2006 Posts: 529 Location: IRAN
|
|
| Back to top |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 13354
|
|
| Back to top |
|
 |
AmirAbbas phpBB SEO Team


Joined: 11 May 2006 Posts: 529 Location: IRAN
|
|
| Back to top |
|
 |
|
|