Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

DoFollow Signature for members with 100+ posts

shashashasha New
edited February 2014 in Vanilla 2.0 - 2.8

Is there a way to give dofollow signature for members with 100+ posts? i.e their nofollow signature should automatically get converted into dofollow after completing 100 posts.

Thanks in advance.

Tagged:

Comments

  • R_JR_J Ex-Fanboy Munich Admin

    Signature is formatted with Gdn_Format and if you look here https://github.com/vanillaforums/Garden/blob/2.0/library/core/class.format.php you'll find that:

       /**
    * Flag which allows plugins to decide if the output
    * should include rel="nofollow" on any <a> links.
    * Example: a plugin can run on "BeforeCommentBody" to
    * check the current users role and decide if his/her post
    * should contain rel="nofollow" links.
    * The default setting is true, meaning all links will contain
    * the rel="nofollow" attribute.
    */
    public static $DisplayNoFollow = true;
    

    So you might try to set Gdn_Format->DisplayNoFollow = false before that line in the class.signatures.plugin.php: $UserSignature = Gdn_Format::To($Signature, $SigFormat)."<!-- $SigFormat -->"; for every user with CountDiscussions + CountComments > 100 :

    $DisplayNoFollowState = Gdn_Format->DisplayNoFollow; // don't know if needed
    if (GetValue('CountDiscussions', $User) + GetValue('CountComments', $User) > 100 ) {
       Gdn_Format->DisplayNoFollow = FALSE;
    }
    $UserSignature = Gdn_Format::To($Signature, $SigFormat)."<!-- $SigFormat -->";
    Gdn_Format->DisplayNoFollow = $DisplayNoFollowState ; // don't know if needed
    ...
    

    That's only a guess but maybe the way to start...

  • @R_J - Thanks for your input. I ll try if this works. :)

  • did it work?

Sign In or Register to comment.