How to add nofollow to posted links

Discussion in 'PHP' started by Fracisc, Aug 9, 2010.

  1. #1
    How to add nofollow to posted links in Vbulletin?

    I have edited class_bbcode.php


    function handle_bbcode_url($text, $link) will return

    return "<a rel=\"nofollow\" href=\"$rightlink\" target=\"_blank\">$text</a>";


    But nothing changed on the forum. When I comment out that function, I got no error, so that function is not running. I see that cache is disabled.

    Could vbseo be the problem?
     
    Fracisc, Aug 9, 2010 IP
  2. MyVodaFone

    MyVodaFone Well-Known Member

    Messages:
    1,048
    Likes Received:
    42
    Best Answers:
    10
    Trophy Points:
    195
    #2
    When you say "nothing changed" are you looking at posts already made or are you making a new one ? remember all your posts are stored in a database, so you would need to make a new test post to check your script edits.
     
    MyVodaFone, Aug 9, 2010 IP
  3. Fracisc

    Fracisc Well-Known Member

    Messages:
    3,670
    Likes Received:
    10
    Best Answers:
    1
    Trophy Points:
    195
    #3
    I've added new post and the link is do follow. :(

    I just got this forum, it is an old one and was full of spam. I have removed over 300 spam posts. I want to have do follow in signatures only (those will be displayed after the 10th post and only if they write over 100 characters).

    EDIT: I just checked my DB. Links are stored with bbcodes, not html, so, the content is rendered on view.
     
    Last edited: Aug 9, 2010
    Fracisc, Aug 9, 2010 IP
  4. MyVodaFone

    MyVodaFone Well-Known Member

    Messages:
    1,048
    Likes Received:
    42
    Best Answers:
    10
    Trophy Points:
    195
    #4
    MyVodaFone, Aug 9, 2010 IP
  5. Fracisc

    Fracisc Well-Known Member

    Messages:
    3,670
    Likes Received:
    10
    Best Answers:
    1
    Trophy Points:
    195
    #5
    Yep, I know, but that will add nofollow to ALL outgoing links, including their signature, and I want to keep the signatures do follow.
     
    Fracisc, Aug 9, 2010 IP
  6. MyVodaFone

    MyVodaFone Well-Known Member

    Messages:
    1,048
    Likes Received:
    42
    Best Answers:
    10
    Trophy Points:
    195
    #6
    MyVodaFone, Aug 9, 2010 IP
  7. Fracisc

    Fracisc Well-Known Member

    Messages:
    3,670
    Likes Received:
    10
    Best Answers:
    1
    Trophy Points:
    195
    #7
    I already have that mod installed, it is the one that sets the min postcount to show sig. It does not have an option to remove nofollow tags added by the previous mod (vbseo).
     
    Fracisc, Aug 9, 2010 IP
  8. MyVodaFone

    MyVodaFone Well-Known Member

    Messages:
    1,048
    Likes Received:
    42
    Best Answers:
    10
    Trophy Points:
    195
    #8
    Ok well getting back to your first assumption, vbseo must have its own file dealing with bbcodes, you probable need to search deeper within your directory structure for that file, sorry I'm not much help... I don't have VB
     
    MyVodaFone, Aug 9, 2010 IP
  9. danx10

    danx10 Peon

    Messages:
    1,179
    Likes Received:
    44
    Best Answers:
    2
    Trophy Points:
    0
    #9
    Why is the input $link and your returning $rightlink - is their something where missing? - perhaps post the whole function...
     
    danx10, Aug 9, 2010 IP
  10. Brandon Sheley

    Brandon Sheley Illustrious Member

    Messages:
    9,721
    Likes Received:
    612
    Best Answers:
    2
    Trophy Points:
    420
    #10
    the paid vbseo product will take care of all this for you, or there is a mod at the org that will convert all links to nofollow.
    no PHP knowledge is needed ;)
     
    Brandon Sheley, Aug 9, 2010 IP