phpBB SEO
Boards
Directory  
SEO  
Downloads
  phpBB SEO : Search Engine Optimization, Directory, Forums  
Index
Forums
Annuaire
Référencement
Télécharger
 
  Search Rechercher
    Register
Username :  Password :  Log me on automatically each visit  
S'enregistrer  
 
   
how can i disable the links in text body ?
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    phpBB SEO » SEO Forum  » phpBB Forum
::  
Author Message
AmirAbbas
phpBB SEO Team
phpBB SEO Team


Joined: 11 May 2006
Posts: 529
Location: IRAN

how can i disable the links in text body ?Posted: Wed Nov 29, 2006 1:23 pm    Post subject: how can i disable the links in text body ?

how can i disable the links in text body

hi

another question Smile

how can i disable the link in text body. for example when i type this:

http://www.phpbb-seo.com/boards/seo-techniques/locking-the-www-in-urls-vt30.html

the phpbb will recognize it as a link. we know that part of text is not wrapped
by [url] [/url] but that text will change to a link. how can i disable this feature.
i want only the text between [url] [/url] recognized as a link.
i want to know that is possible to show this sort of links :

http://www.phpbb-seo.com/boards/seo-techniques/locking-the-www-in-urls-vt30.html

in this shape

htxp://www.phpbb-seo.com/boards/seo-techniques/locking-the-www-in-urls-vt30.html

(put text in <b> tag istead of <a> tag or put it in a styled span tag )

?

i think with this trick i can control the amount of external link in my forum
users are very careless about putting dash before URLs Crying or Very sad
SEO chat forum are using this method.

_________________
طراحی وب ، آموزش سئو ، آموزش CSS ، phpbb فارسی ، phpbb3 فارسی ، دروپال فارسی
طراحی وب ، قالب وبلاگ ، استاندارد وب ، آموزش CSS و HTML ، آموزش php
Back to top
Visit poster's website
dcz
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 28 Apr 2006
Posts: 13354

how can i disable the links in text body ?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 :

Code:
   $min_posts = 25;



The bold thing need some changes in make_clickable(), tell me if you really want it Wink

++

_________________
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
Visit poster's website
AmirAbbas
phpBB SEO Team
phpBB SEO Team


Joined: 11 May 2006
Posts: 529
Location: IRAN

how can i disable the links in text body ?Posted: Thu Nov 30, 2006 4:48 am    Post subject: Re: how can i disable the links in text body ?

thanks a lot Surprised

dcz wrote:
The bold thing need some changes in make_clickable(), tell me if you really want it Wink


i need it. could you tell me how can i put link text in bold tag or styled span ? Razz

_________________
طراحی وب ، آموزش سئو ، آموزش CSS ، phpbb فارسی ، phpbb3 فارسی ، دروپال فارسی
طراحی وب ، قالب وبلاگ ، استاندارد وب ، آموزش CSS و HTML ، آموزش php
Back to top
Visit poster's website
AmirAbbas
phpBB SEO Team
phpBB SEO Team


Joined: 11 May 2006
Posts: 529
Location: IRAN

how can i disable the links in text body ?Posted: Sat Dec 02, 2006 1:05 pm    Post subject: Re: how can i disable the links in text body ?

hi

i think you forgot this topic

_________________
طراحی وب ، آموزش سئو ، آموزش CSS ، phpbb فارسی ، phpbb3 فارسی ، دروپال فارسی
طراحی وب ، قالب وبلاگ ، استاندارد وب ، آموزش CSS و HTML ، آموزش php
Back to top
Visit poster's website
dcz
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 28 Apr 2006
Posts: 13354

how can i disable the links in text body ?Posted: Sun Dec 03, 2006 12:00 pm    Post subject: Re: how can i disable the links in text body ?

No I did not, but this is a real mod you're asking for here, not a simple tweak.

I'll take a look at it, I promise Wink

Could you search a bit at phpBB.com and phpbbhacks.com to see if such mod does not already exists ?

++

_________________
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
Visit poster's website
dcz
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 28 Apr 2006
Posts: 13354

how can i disable the links in text body ?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 Wink

Open :

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


Wink

_________________
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
Visit poster's website
AmirAbbas
phpBB SEO Team
phpBB SEO Team


Joined: 11 May 2006
Posts: 529
Location: IRAN

how can i disable the links in text body ?Posted: Tue Dec 05, 2006 2:11 pm    Post subject: Re: how can i disable the links in text body ?

oops Smile

thanks a lot
this is very useful

cdz
another thanks for simple rewrite mod zero dupe you sent for me in PM
i forgot to reply to that PM Wink

_________________
طراحی وب ، آموزش سئو ، آموزش CSS ، phpbb فارسی ، phpbb3 فارسی ، دروپال فارسی
طراحی وب ، قالب وبلاگ ، استاندارد وب ، آموزش CSS و HTML ، آموزش php
Back to top
Visit poster's website
dcz
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 28 Apr 2006
Posts: 13354

how can i disable the links in text body ?Posted: Tue Dec 05, 2006 3:39 pm    Post subject: Re: how can i disable the links in text body ?

You're welcome Wink

_________________
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
Visit poster's website
AmirAbbas
phpBB SEO Team
phpBB SEO Team


Joined: 11 May 2006
Posts: 529
Location: IRAN

how can i disable the links in text body ?Posted: Sat Dec 09, 2006 2:28 pm    Post subject: Re: how can i disable the links in text body ?

hi

another suggestion Wink

how can we add rel"nofollow" to these sort of links ?
its very good because this trick is both user friendly and bot friendly


why you dont release it as a mod in phpbb.com
these mod are very useful Rolling Eyes

_________________
طراحی وب ، آموزش سئو ، آموزش CSS ، phpbb فارسی ، phpbb3 فارسی ، دروپال فارسی
طراحی وب ، قالب وبلاگ ، استاندارد وب ، آموزش CSS و HTML ، آموزش php
Back to top
Visit poster's website
dcz
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 28 Apr 2006
Posts: 13354

how can i disable the links in text body ?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
Visit poster's website
AmirAbbas
phpBB SEO Team
phpBB SEO Team


Joined: 11 May 2006
Posts: 529
Location: IRAN

how can i disable the links in text body ?Posted: Sun Dec 10, 2006 5:52 pm    Post subject: Re: how can i disable the links in text body ?

thank you a lot
Wink

rel="nofollow" is supported with all bots. am i right ?

_________________
طراحی وب ، آموزش سئو ، آموزش CSS ، phpbb فارسی ، phpbb3 فارسی ، دروپال فارسی
طراحی وب ، قالب وبلاگ ، استاندارد وب ، آموزش CSS و HTML ، آموزش php
Back to top
Visit poster's website
dcz
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 28 Apr 2006
Posts: 13354

how can i disable the links in text body ?Posted: Sun Dec 10, 2006 6:05 pm    Post subject: Re: how can i disable the links in text body ?

You're welcome, and yes, at least the major ones do follow the nofollow directive.

It was them to want this new tag to fight against spam indexing in blogs, so they'd better do it Wink

++

_________________
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
Visit poster's website
AmirAbbas
phpBB SEO Team
phpBB SEO Team


Joined: 11 May 2006
Posts: 529
Location: IRAN

how can i disable the links in text body ?Posted: Mon Dec 11, 2006 4:02 pm    Post subject: Re: how can i disable the links in text body ?

a little problem

i have applied changes to bbcode.php but sometimes for some links it doesn't work. for example

http://forum.persia-cms.com/topic-vt150.html
the link in first post

or this one
http://forum.persia-cms.com/topic-vt140.html
the link in first post

Shocked

_________________
طراحی وب ، آموزش سئو ، آموزش CSS ، phpbb فارسی ، phpbb3 فارسی ، دروپال فارسی
طراحی وب ، قالب وبلاگ ، استاندارد وب ، آموزش CSS و HTML ، آموزش php
Back to top
Visit poster's website
dcz
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 28 Apr 2006
Posts: 13354

how can i disable the links in text body ?Posted: Mon Dec 11, 2006 5:44 pm    Post subject: Re: how can i disable the links in text body ?

Have you checked in the source if it was not a BBcode link ?

Because so far we only take car about the links posted without BBcodes for link deactivation.

++

_________________
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
Visit poster's website
AmirAbbas
phpBB SEO Team
phpBB SEO Team


Joined: 11 May 2006
Posts: 529
Location: IRAN

how can i disable the links in text body ?Posted: Tue Dec 12, 2006 2:28 pm    Post subject: Re: how can i disable the links in text body ?

dcz wrote:
Have you checked in the source if it was not a BBcode link ?


yes. i have checked.

when the domain is in this form

http://www.phpbb-seo.com

it works perfectly but when you write URL without http:// it doesn't work

for example
www.phpbb-seo.com

the system won't add rel="nofollow" to above link

_________________
طراحی وب ، آموزش سئو ، آموزش CSS ، phpbb فارسی ، phpbb3 فارسی ، دروپال فارسی
طراحی وب ، قالب وبلاگ ، استاندارد وب ، آموزش CSS و HTML ، آموزش php
Back to top
Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    phpBB SEO » SEO Forum  » phpBB Forum
Page 1 of 3 Goto page 1, 2, 3  Next

Navigation Similar Topics

Jump to: