By Ysabel on Friday, 06 June 2014
Posted in General Issues
Likes 0
Views 1.4K
Votes 0
Hello,

My clients forum has been seriously attacked by users tying to post links. It has been like this since day 1 but we manage to delete them regularly. But it seems to be tiring to keep doing it all the time.

I am registered to different websites which has forums and I noticed that each time I add a link it automatically add a rel=nofollow in the link.


In easydiscuss, it automatically create this link;
<a href="http://mywebsite.com">http://wmywebsite.com</a>

How to make all links like this?

<a target="_blank" rel="nofollow" href="http://wmywebsite.com">Test text only</a>

This is not the best solution but at-least they can't any juice from the site.

Thank you in advance.
Hello Ysabel,

Unfortunately it's not possible to do that currently but by default, EasyDiscuss uses the rel="nofollow" when it replaces hyperlinks.

By default we don't actually add nofollow to it but you can edit the file /components/com_easydiscuss/helpers/parser.php
LINE 216

$text = str_ireplace( $urlTags[ $i ] , '<a href="' . $url . '"' . $targetBlank . '>' . $titles[ $i ] . '</a>' , $text );

//Replace

$text = str_ireplace( $urlTags[ $i ] , '<a href="' . $url . '"' . $targetBlank . ' rel="nofollow">' . $titles[ $i ] . '</a>' , $text );
·
Friday, 06 June 2014 09:02
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi,

i upgraded to v4 but missing helpers folder now.

Where can i set the links nofollow again?

Thanks
Marco
·
Tuesday, 03 May 2016 15:41
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey Marco,

The file is located in JoomlaFolder\administrator\components\com_easydiscuss\includes\parser\parser.php LINE 185.

But in Easydiscuss 4, we already created another columns called `preview` from this table #__discuss_posts. In other word, when the user load the discussion page, the system will only get the preview content from that table instead of go through all the bbcode process, then it will improve the site performance speed.

Right now, your previous post is not store this rel="nofollow" tag in the database post content, so you also have to hack this file JoomlaFolder\administrator\components\com_easydiscuss\includes\post\post.php

// line 4612 - 4614
if ($this->post->preview) {
return $this->post->preview;
}

// Replace with

// if ($this->post->preview) {
// return $this->post->preview;
// }
·
Tuesday, 03 May 2016 17:54
·
0 Likes
·
0 Votes
·
0 Comments
·
It would be great if there was an option in the Easy Discuss settings to choose if rel="nofollow" should be appended to all hyper links in posts. That would save hacking system files and improve the forum software too.
·
Saturday, 11 June 2016 09:14
·
0 Likes
·
0 Votes
·
0 Comments
·
I will discuss with our team regarding this and see if we can implement this in the future version.
·
Saturday, 11 June 2016 12:18
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi, for some reason the nofollow isn't showing up for me, I made the amends to this file JoomlaFolder\administrator\components\com_easydiscuss\includes\post\post.php do i need to change anything to this file JoomlaFolder\administrator\components\com_easydiscuss\includes\parser\parser.php ?

Best Regards James
·
Monday, 14 November 2016 21:41
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello James,

Yes, you would need to edit the parser.php file and locate the codes below,


$text = str_ireplace($urlTags[$i], '<a href="' . $url . '"' . $targetBlank . $noFollow .'>' . $titles[ $i ] . '</a>', $text);


With,


$text = str_ireplace( $urlTags[ $i ] , '<a href="' . $url . '"' . $targetBlank . ' rel="nofollow">' . $titles[ $i ] . '</a>' , $text );
·
Monday, 14 November 2016 23:34
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks Mark, tried the above amend but doesn't seem to have had an affect (see attached)

James
·
Monday, 14 November 2016 23:46
·
0 Likes
·
0 Votes
·
0 Comments
·
Did you also apply the hack that Arlex provided earlier to disable the preview? https://stackideas.com/forums/how-to-add-rel-nofollow-to-all-links#reply-267260
·
Monday, 14 November 2016 23:51
·
0 Likes
·
0 Votes
·
0 Comments
·
yep, did that too
·
Tuesday, 15 November 2016 00:01
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello James,

Hm, from what I see from the code you no longer need to add any hacks. You just need to enable the nofollow option in the settings, http://take.ms/JcLxK

You could try reversing these changes to the codes and try with a new post again.
·
Tuesday, 15 November 2016 00:17
·
0 Likes
·
0 Votes
·
0 Comments
·
sorry didn't realise that setting existed within the backend, all good now
·
Tuesday, 15 November 2016 00:23
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks for updating James, I will mark this thread as resolved and lock this to avoid any more confusions.
·
Tuesday, 15 November 2016 00:27
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post