How to remove the rel="nofollow" for links in discussions and comments
I found a similar discussion by @dtbaker where he was able to remove the rel="nofollow" in links for specific users, see here.
When implemented, it removed the rel="nofollow" from the first post in a discussion for a specific user, however, the rel="nofollow" still showed up in the comments underneath the first post for the same specified user.
My question: Is there any way to remove the rel="nofollow" attribute for a specific user, both in the first post of a discussion and for all subsequent comments by that user?
In case anybody's wondering, I added
Gdn_Format::$DisplayNoFollow = ($Aut``hor->UserID!=1);
to helper_functions.php, to remove the rel="nofollow" from the first post of a discussion.
@peregrine - You seem like a smart ole chap, any advice?
Comments
Don't modify the core like that, restore it. Post parse with
AfterCommentFormat
hook in a plugin, usinggrep is your friend.
you would
grep is your friend.
grep is your friend.
Thanks @x00 - I'll give that a try.
A lot of links are shared on my forum. Is the "nofollow" enabled by default on Vanilla 2.0?
IIRC, yes. Any site that doesn't put nofollow on links that are user generated are a prime target for spammers.
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
Could you explain what this means? I only know enough coding to get things working but I don't understand the jargon.
If someone wanted to remove "nofollow" tags from say the administrator, are you saying you need to do the following.
Or is there some existing file you're supposed to add the code to?
Thanks!
The preferred method of modifications is to run them through plugins.
So download the example plugin and put in the hooks and code you want.
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
Downloaded the example plugin, but I fear this has gone beyond my programming abilities. I'm assuming the changes would be made in the class.example.plugin.php file?
Any tutorial out there on how to make a plugin? Or maybe, does a plugin already exist to do this?
http://vanillawiki.homebrewforums.net/index.php/Writing_Plugins_for_Vanilla
Vanilla Wiki, Tastes Great! 31,000 viewers can't be wrong. || Plugin Development Explained
also http://vanillawiki.homebrewforums.net/index.php/Hello_World_Plugin
Vanilla Wiki, Tastes Great! 31,000 viewers can't be wrong. || Plugin Development Explained
and a few other pages on the wiki. you can find them.
Vanilla Wiki, Tastes Great! 31,000 viewers can't be wrong. || Plugin Development Explained
Your first plugin will be up and running faster than you ever thought it would be possible!