Current time: 03-22-2010, 03:52 PM Hello There, Guest! (LoginRegister)


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Nofollow Plugin - Dofollow for Admin posts
02-20-2009, 05:05 AM
Post: #1
Nofollow Plugin - Dofollow for Admin posts
I use Nofollow plugin by Juzzi. I see that all URL's from all posts get nofollowed irrespective of the group.

Can someone please tell me the way how I can make nofollow selective? I mean, I want that URLs in posts created by admins and mods shouldn't be nofollowed.

Please let me know how I can do that.
Find all posts by this user
Quote this message in a reply
02-20-2009, 11:21 PM
Post: #2
RE: Nofollow Plugin - Dofollow for Admin posts
I guess that would be complicated to implement, as nofollow usually just hooks into the URL mechanism regardless of who made the posting.

Why do you need it? What do you intend to achieve?
Visit this user's website Find all posts by this user
Quote this message in a reply
02-21-2009, 01:01 AM
Post: #3
RE: Nofollow Plugin - Dofollow for Admin posts
Just alter the function...

add this after the globals in the function.

if($mybb->user['usergroup'] == "4") { return; }

That should stop the function cold for admins posts. If you want to also include Super Moderators

if($mybb->user['usergroup'] == "4" || $mybb->user['usergroup'] == "3") { return; }

Join MyBB Central for exclusive plugins. Downloads require a paid membership.
Do you need free Mybb Support?
[Image: mybbsig.php]
Visit this user's website Find all posts by this user
Quote this message in a reply
02-21-2009, 09:51 AM
Post: #4
RE: Nofollow Plugin - Dofollow for Admin posts
@labrocca:

I tried but didn't work..

First I tried inside the nofollow_parse function
Code:
function nofollow_parse($msg)
{
    if($mybb->user['usergroup'] == "4") { return; }
$msg = preg_replace("#<a href=\"(.+)\" target=\"_blank\">#i", "<a href=\"$1\" target=\"_blank\" rel=\"nofollow\">", $msg);
    return $msg;
}

then tried inside nofollow_info...

Code:
function nofollow_info()
{
    return array(
        "name"            => "NoFollow",
        "description"    => "Adds a rel=\"nofollow\" attribute to user posted links.",
        "website"        => "http://www.msgweb.nl",
        "author"        => "Juzzi",
        "authorsite"    => "http://www.msgweb.nl",
        "version"        => "1.0",
    );
if($mybb->user['usergroup'] == "4") { return; }
}

Seems I didn't get what you mean by add after 'globals in the function'

@frostschutz: Why do you need it? What do you intend to achieve?

I thought the need was quite self-explanatory. Tell me, why did Google introduce nofollow at the first place? So that you can say to SE's that see though I am linking to this site but I 'm not sure about its credibility and don't pass any PR juice from my site... that's what I intend to do... I'm sure about the credibility of sites I am linking to but can't be always sure of the sites my forum members might be linking to.

Trust it is clear now?
Find all posts by this user
Quote this message in a reply
02-21-2009, 10:26 AM
Post: #5
RE: Nofollow Plugin - Dofollow for Admin posts
You might have to use global $mybb; before using the $mybb in a function. Still I'm not sure wether this is going to work. You need to check the group of the user that made the posting that is currently parsed; not the group of the current user.
Visit this user's website Find all posts by this user
Quote this message in a reply
02-24-2009, 05:14 PM (This post was last modified: 02-24-2009 05:14 PM by labrocca.)
Post: #6
RE: Nofollow Plugin - Dofollow for Admin posts
frost is correct...

add globals
Code:
function nofollow_parse($msg)
{
global $mybb;

    if($mybb->user['usergroup'] == "4") { return; }
$msg = preg_replace("#<a href=\"(.+)\" target=\"_blank\">#i", "<a href=\"$1\" target=\"_blank\" rel=\"nofollow\">", $msg);
    return $msg;
}

Join MyBB Central for exclusive plugins. Downloads require a paid membership.
Do you need free Mybb Support?
[Image: mybbsig.php]
Visit this user's website Find all posts by this user
Quote this message in a reply
02-24-2009, 06:47 PM (This post was last modified: 02-24-2009 06:47 PM by aj30.)
Post: #7
RE: Nofollow Plugin - Dofollow for Admin posts
Still it is not working... now it has made all links dofollowed means it has removed nofollow from all the links Sad

am reverting to nofollow till we get some solution
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump: