vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Apply "rel=nofollow" attribute to all parsed URLs (https://vborg.vbsupport.ru/showthread.php?t=93780)

kall 08-06-2005 10:00 PM

Apply "rel=nofollow" attribute to all parsed URLs
 
In the first cooperative move for nearly ten years, the major search engines have unveiled a new indexing command for web authors that they all recognize, one that they hope will help reduce the link and comment spam that plagues many web sites....due to removing the point of doing it in the first place.

The new "nofollow" attribute that can be associated with links was originated as an idea by Google in late 2004 and MSN and Yahoo, as well as major blogging vendors have jumped onboard.

The Nofollow Attribute

The new attribute is called "nofollow" with rel="nofollow" being the format inserted within an anchor tag.
When added to any link, it will effectively serve as a flag to tell the search engines that the link has not been explictly approved by the site owner, and therefore "not follow" it, or not use the referring page's (on your site) Page Rank in any way.

For example, this is how the HTML markup for an ordinary link might look:

Quote:

<a href="http://www.somedomain.com/page.html">My forums are the best lol lol lol click here!!</a>
This is how the link would look after the nofollow attribute has been added, with the attribute portion shown in bold

Quote:

<a href="http://www.somedomain.com/page.html" rel="nofollow">My forums are the best lol lol lol click here!!</a>
Once added, the search engines supporting the attribute will understand that the link has not been approved by the site owner.

Think of it as a way to flag to them, "I didn't post this link -- someone else did, don't associate me with it."

Quote:

Originally Posted by Alkatraz
If Google sees nofollow as part of a link, it will:

1. NOT follow through to that page.
2. NOT count the link in calculating PageRank link popularity scores.
3. NOT count the anchor text in determining what terms the page being linked to is relevant for.

The site that is being linked to will gain nothing from the link, so the whole point of doing it in the first place is removed.

This will affect URLs in posts, as well as signatures...anything that goes through the bbcodeparse function as far as I can tell/guess, and will work recursively, or whatever the word is that means 'it will affect all existing posts and signatures'...or it did for me anyway.

To change the conditional number of posts, alter
PHP Code:

OR $post['posts'] > 50

to whatever you like.

I can't see how this could be done as a plugin, but if anyone wants to point out how, that would be nicer....YAY Kirby!

Now all you need to do is unzip the attached file, upload the plugin using your Admin CP - Plugin System - Plugin Manager!

Relax, safe in the knowledge that spammers linking from your site are doing so for no reason whatsoever. :)

To remove the old version:

File to modify: 1

1/ Open your includes/class_bbcode.php file

Find:
PHP Code:

        // standard URL hyperlink
        //return "<a href=\"$rightlink\" target=\"_blank\">$text</a>";

        
global $post;

if (
is_member_of($post6//Admins are exempt
OR is_member_of($post5//Mods are exempt
OR is_member_of($post7//SuperMods are exempt
OR $post['posts'] > 50// People with over 50 posts are exempt
    
{
    
// standard URL hyperlink
    
return "<a href=\"$rightlink\" target=\"_blank\">$text</a>";
    }
    else
    {
     return 
"<a href=\"$rightlink\" rel=\"nofollow\" target=\"_blank\">$text</a>";
    }
    } 


Replace with:
PHP Code:

// standard URL hyperlink
        
return "<a href=\"$rightlink\" target=\"_blank\">$text</a>";
    } 

2/ Save and Upload.

mcncyo 08-07-2005 11:06 AM

I will install this on monday.

bigcurt 08-07-2005 12:48 PM

Good job kall, will work great

~Curt

FleaBag 08-07-2005 11:05 PM

I'm not going to install this as my forum doesn't need it, microscopic in size compared to the majority - but just thought I would post my support for an excellent effort!

Andreas 08-08-2005 03:33 PM

Hook bbcode_create
PHP Code:

$this->tag_list['no_option']['url']['callback'] = 'handle_external';
$this->tag_list['no_option']['url']['external_callback'] = 'handle_bbcode_url_relnofollow';
$this->tag_list['option']['url']['callback'] = 'handle_external';
$this->tag_list['option']['url']['external_callback'] = 'handle_bbcode_url_relnofollow';

if (!
function_exists('handle_bbcode_url_relnofollow'))
{
    function 
handle_bbcode_url_relnofollow(&$parser$text$link)
    {
        global 
$post;
        
// Excempt Mods+ and Users with mor then 50 Posts
        
$parsedurl $parser->handle_bbcode_url($text$link);
        if (
is_member_of($post567) OR $post['posts'] > 50)
        {
            return 
$parsedurl;
        }
        else
        {
            return 
str_replace('href="''rel="nofollow" href="'$parsedurl); 
        }
    }


Or (simpler, but might affect mor then just [url])
Hook: bbcode_parse_complete
PHP Code:

global $post;
if (!
is_member_of($post567) AND !($post['posts'] > 50))
{
    
$text str_replace('href="''rel="nofollow" href="'$text);



ricker 08-09-2005 03:12 AM

This seems to have conflicts with the "PM group leader on join request" plugin. At least it did with mine. :(

mcncyo 08-10-2005 12:57 AM

would the work with grapping of the newsgroup and from mailinglist? Would the plugin work with the nntp newsgroup pulling.

kall 08-11-2005 09:42 PM

Quote:

Originally Posted by ricker
This seems to have conflicts with the "PM group leader on join request" plugin. At least it did with mine. :(

I can't see how .. all this does is add an attribute to the href of a link.. can you please explain?

welo 08-30-2005 05:46 AM

Quote:

Originally Posted by KirbyDE
Hook bbcode_create
PHP Code:

$this->tag_list['no_option']['url']['callback'] = 'handle_external';
$this->tag_list['no_option']['url']['external_callback'] = 'handle_bbcode_url_relnofollow';
$this->tag_list['option']['url']['callback'] = 'handle_external';
$this->tag_list['option']['url']['external_callback'] = 'handle_bbcode_url_relnofollow';

if (!
function_exists('handle_bbcode_url_relnofollow'))
{
    function 
handle_bbcode_url_relnofollow(&$parser$text$link)
    {
        global 
$post;
        
// Excempt Mods+ and Users with mor then 50 Posts
        
$parsedurl $parser->handle_bbcode_url($text$link);
        if (
is_member_of($post567) OR $post['posts'] > 50)
        {
            return 
$parsedurl;
        }
        else
        {
            return 
str_replace('href="''rel="nofollow" href="'$parsedurl); 
        }
    }



For some reason I have no idea whatsoever how to apply this code. Is this basically a replacement in class_bbcode.php for what Kall originally posted?

kall 08-30-2005 11:19 AM

Quote:

Originally Posted by welo
For some reason I have no idea whatsoever how to apply this code. Is this basically a replacement in class_bbcode.php for what Kall originally posted?

You can just upload the attached .xml now, thanks to Kirby. :)

(Could a Mod move this to the Plugins Forum? Ta.)

Paul 09-01-2005 05:27 AM

The plugin is not working for me in 3.5 RC 2. Anyone else have any success with it?

welo 09-01-2005 05:55 AM

Working fine for me. I have min posts set to 50 (51 promotes members to another usergroup) and several usergroups exempted.

Look at the signature for this user f.ex. as opposed to the moderator posting on that thread. Here is a user with 50 posts.

(this is where "View Selection Source" in Firefox comes in handy)

kall 09-01-2005 07:18 AM

Quote:

Originally Posted by Paul
The plugin is not working for me in 3.5 RC 2. Anyone else have any success with it?

I am.

I downloaded it from my plugin system.

SnitchSeeker 09-01-2005 08:14 AM

Will this make ALL links in forum posts get the attribute? Because it would be nice if links posted by admins or mods would not get it since they often link to other pages within our own site.

kall 09-01-2005 08:27 AM

Quote:

Originally Posted by SnitchSeeker
Will this make ALL links in forum posts get the attribute? Because it would be nice if links posted by admins or mods would not get it since they often link to other pages within our own site.

Let's look at the bit in the first post that controls who has their posts/signatures "nofollow"'ed:
PHP Code:

if (is_member_of($post6//Admins are exempt
OR is_member_of($post5//Mods are exempt
OR is_member_of($post7//SuperMods are exempt
OR $post['posts'] > 50// People with over 50 posts are exempt 

:)

Paul 09-02-2005 07:07 AM

Quote:

Originally Posted by welo
Working fine for me. I have min posts set to 50 (51 promotes members to another usergroup) and several usergroups exempted.

Look at the signature for this user f.ex. as opposed to the moderator posting on that thread. Here is a user with 50 posts.

(this is where "View Selection Source" in Firefox comes in handy)

Rather odd. It's simply not working for me whatsoever. I've removed the if clause completely and had it apply the nofollow bit to all links but no luck!

Might this have something to do with vb's parsed post caching?

Logician 09-24-2005 01:23 PM

One of the best hack ideas I have seen for a while. Very good job! :)

Jolten 10-18-2005 08:49 PM

I'd love this for v3.0.9. I can't upgrade to 3.5 and the functions_bbcodeparse.php file is much different.

Crow 10-19-2005 01:39 AM

Great hack.. "Installs"

kall 10-19-2005 06:24 AM

Quote:

Originally Posted by Jolten
I'd love this for v3.0.9. I can't upgrade to 3.5 and the functions_bbcodeparse.php file is much different.

Then look at the 3.0.x hacks in my profile. ;)

G_Gekko 10-29-2005 08:47 PM

Thanks for a great hack

soniceffect 10-29-2005 09:07 PM

Ya know I kinda have mixed feelings on this idea ... personally I would like links in my users sigs to be followed, as some of my users run there own sites and would like to get them ranked well in search engines. I can`t see it causes me any problems, and helps the people who make my site work ..

The ability to choose which forums it stops would be nice .... eg. If I have a forum for people to post links like this, then I would like to disable this on that particular forum.. Hope that makes sense LOL

So, any way to do this?

Chris M 10-30-2005 12:17 PM

Very nice modification kall :)

Chris

pokeraffiliates 12-01-2005 06:18 AM

Do this work for Version 3.5.1?
Cause I installed the plugin but nothing happens.

Robert Fogt 12-03-2005 08:09 AM

This worked great for me in 3.5.1 Except for the homepage URL located in their profile. Any way to add this there?

jdingman 12-22-2005 03:46 AM

I installed this mod and it wouldn't display any threads after I did. Not sure what went wrong with it...

Baldy 12-29-2005 04:02 AM

I would love to see a whitelist exclusion for certain URLs. vBSEO lets you specify, say, smugmug.com, google.com, and vbulletin.com as exclusions so the rel="nofollow" attribute.

I ended up not being able to use vBSEO, so I'm looking for a nofollow plugin to replace it.

IrPr 01-06-2006 10:53 AM

is it workin on 3.5.3 ?

croportal 01-17-2006 03:47 PM

yes i have 3.5.3 and i dont know if this working, can u tell me also, i want to all group have The Nofollow Attribute

Dave-ahfb 01-21-2006 01:23 AM

working for me on 3.5.3

JulianD 01-22-2006 02:43 AM

Installed!! Thanks.

David_R 02-11-2006 03:01 AM

is it possible to make this script work only in few forums ?
i dont want to block links with "rel=nofollow" in all forums

thanks.

InstaNet 02-12-2006 07:42 PM

Hmm, I used the plugin system to upload this hack on a 3.5.3 board but it doesn't seem to be working? Anyone know why? Thanks

David_R 02-14-2006 11:46 AM

Quote:

Originally Posted by InstaNet
Hmm, I used the plugin system to upload this hack on a 3.5.3 board but it doesn't seem to be working? Anyone know why? Thanks

i have this same problem, i am using vbulletin 3.5.3
technically hack should only add rel=nofollow tag to content in posts and users signatures without touching other parts of the forum..

but check this, there are many other areas where the rel=nofollow should not be added:
Code:

<table cellpadding="6" cellspacing="0" border="0" width="100%" class="page" align="center">
<tr>
       
       
        <td class="tfoot" align="right" width="100%">
                <div class="smallfont">
                        <strong>
                                <a href="sendmessage.php" rel="nofollow">Contact Us</a> -
                                <a href="http://www.officehelp.in">Office Help</a> -
                                <a href="admincp/index.php">Admin</a> -
                                <a href="modcp/index.php">Mod</a> -
                                <a href="archive/index.php">Archive</a> -
                               
                                <a href="#top" onclick="self.scrollTo(0, 0); return false;">Top</a>
                        </strong>
                </div>
        </td>
</tr>
</table>

Am i missing something ? or can someone guide for installing this plugin perfectly, seems to be a very good plugin/addon.

thanks.

Problem 2:
Even after disabling the plugin from plugin manager, rel-nofollow still appears for internal forum links.. :surprised:

welo 02-14-2006 12:17 PM

Quote:

Originally Posted by David_R
Problem 2:
Even after disabling the plugin from plugin manager, rel-nofollow still appears for internal forum links.. :surprised:

Look in your templates. Those are all there by VB default.

David_R 02-14-2006 01:26 PM

Quote:

Originally Posted by welo
Look in your templates. Those are all there by VB default.

thanks welo.
i was not aware about this :)

problem 2 solved - courtesy welo
problem 1 - waiting for a solution.

welo 02-14-2006 01:37 PM

Yeah, they did that to prevent unnecessary spidering of 'Post Reply' buttons and stuff like that, along with somewhat controlling the silent spam that sometimes creeps into memberslists in signatures etc.

kall 02-15-2006 03:16 AM

Quote:

Originally Posted by David_R
thanks welo.
i was not aware about this :)

problem 2 solved - courtesy welo
problem 1 - waiting for a solution.

So.. problem 1... does it occur if you disable the plugin?

If so, it is a vB default thing as per welo's post above this one.

David_R 02-15-2006 09:14 AM

Quote:

Originally Posted by kall
So.. problem 1... does it occur if you disable the plugin?

If so, it is a vB default thing as per welo's post above this one.

thanks kall for help, got clarified on problem 2.

can you help me implement the hack, add rel=nofollow for urls in posts table ?
thanks.

Citizen 02-15-2006 05:17 PM

How do I install this? It says its not a product...


All times are GMT. The time now is 12:14 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02398 seconds
  • Memory Usage 1,871KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (7)bbcode_php_printable
  • (15)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete