Skip to main content
Topic: Request - Nofollow attribute for external links (Read 16422 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Re: Request - Nofollow attribute for external links

Reply #15

And now that I wake up completely, I see what I was aiming at with my previous code. xD
Ok, now I even wrote some unit testing to be sure what comes out is the expected behaviour (hoping not to have messed up the tests themselves LOL). So, the attached one should work as expected... I hope.

Re: Request - Nofollow attribute for external links

Reply #16

is getting better  :D

it works for the urls inserted with URL bbcode, but not with direct links
sorry for my bad english

Re: Request - Nofollow attribute for external links

Reply #17

Which part is not working? O:-)
Bugs creator.
Features destroyer.
Template killer.


Re: Request - Nofollow attribute for external links

Reply #19

Ahh okay, so even if the user is allowed, auto-linking doesn't get the "follow".
Yep, this is a limitation and there is no good way to fix it, so I let it pass.
There is no good way because the auto-linking happens at parse_bbc-time, so it cannot be checked without wasting "time" fetching all the users groups and permissions (quite a bit of work) on each and every parse_bbc (that by chance is not even that easy if we want to let it work in the future as well). Do the auto-linking at posting-time, on the other hand, is not easy either because it may breaks other stuff (e.g. video auto-embedding).
And since it's just a matter of wrap the url into and url tag I considered it not worth fixing. ;)
Bugs creator.
Features destroyer.
Template killer.

Re: Request - Nofollow attribute for external links

Reply #20

Thank you Emanuele for all your help! Even if direct links (without url)  from admins and special group has the nofollow attribute this is not a big problem, if I really want to obtain a link without nofollow I have to use the url tag which is fine for me

Just one question, is it possible to not apply this addon for the links to my domain?

p.s. I saw a similar addon to other forum script which does the same thing but in a different way, no membergroups permission but only a whitelist of domains. So if a domain is in the whitelist, no matter who is posting the link, it will not have the nofollow attribute. Is this approach easier to implement into elkarte?
sorry for my bad english

Re: Request - Nofollow attribute for external links

Reply #21

sorry @derived but I don't understand
sorry for my bad english

Re: Request - Nofollow attribute for external links

Reply #22

This has nothing in common with attachments ;)
sorry for my bad english

Re: Request - Nofollow attribute for external links

Reply #23

Quote from: radu81 – Just one question, is it possible to not apply this addon for the links to my domain?

p.s. I saw a similar addon to other forum script which does the same thing but in a different way, no membergroups permission but only a whitelist of domains. So if a domain is in the whitelist, no matter who is posting the link, it will not have the nofollow attribute. Is this approach easier to implement into ElkArte?
A white-list should be generally less of a problem and should be applicable at parse_bbc-time instead of preparsecode. That said, mix the two approaches could be less straightforward, but doable.
The only thing pending is that to be completely honest, I'm not sure it is worth the hassle. :P
Bugs creator.
Features destroyer.
Template killer.

Re: Request - Nofollow attribute for external links

Reply #24

@derived if I understood what you are proposing, I think it's not really related and probably it should be discussed more in details.
Let me try to recap: instead of an "hard" selection of allowed attachment extension (i.e. "this set of extensions is allowed, anything else is rejected"), you would like a kind of "soft" list (along the lines "this set of extensions is allowed, the rest are uploaded, but not downloadable directly, but via some kind of copy&paste thingy like google does for potentially dangerous websites").
Did I get it right?
Bugs creator.
Features destroyer.
Template killer.

Re: Request - Nofollow attribute for external links

Reply #25

Well I don't want to make you loose time on this, but probably there is another simpler way : set all links as no follow and remove the nofollow attribute only  for links inserted with iurl bbcode. I know it doesn't have much sense , but nobody is using the iurl code on my forum, I might say it's a hidden bbcode, not every script has this bbcode. That could be made with just a few edits, I understand I have to controll every update but is the quickest way. What do you think?

P. S. I'm not an expert in seo and I don't know if this will bring me any vantage, but if most forums are having nofollow links  into core from default (xf, wbb, kunena, vanilla,  bbpress) maybe worth some time to invest into this for the next releases 1.1.x or 2.0...
sorry for my bad english

Re: Request - Nofollow attribute for external links

Reply #26

Quote from: derived – the attachment system is already designed to look at certain location, for certain identifiers

copy and split off that "system" so it works separately,
Attachments and bbcode are two different beasts entirely, the attachments check on extensions is just a "pick the last three chars of the string and compare". Easy.
URLs are 1) mixed in the text (so the first thing is to actually find the URL), 2) the domain is mixed in the string (there could be http, https, no http at all and only www, could be mail, ftp, several other variants.

The two problems are different enough not to be easily mixed. ;)
Bugs creator.
Features destroyer.
Template killer.

Re: Request - Nofollow attribute for external links

Reply #27

What is it mirc url catcher? :-[
Bugs creator.
Features destroyer.
Template killer.

Re: Request - Nofollow attribute for external links

Reply #28

Quote from: radu81 – Well I don't want to make you loose time on this,
Don't worry about that, if I work on something it's because I want to, otherwise I just let it slip through. :P

Quote from: radu81 – but probably there is another simpler way : set all links as no follow and remove the nofollow attribute only  for links inserted with iurl bbcode. I know it doesn't have much sense , but nobody is using the iurl code on my forum, I might say it's a hidden bbcode, not every script has this bbcode. That could be made with just a few edits, I understand I have to controll every update but is the quickest way. What do you think?
It's not that I don't know how to solve the problem even with the code at hand, it's just that now I'm not sure what you exactly want, so I'm wary at coding it in a way that is good to solve the problem in a certain way just to discover tomorrow, that the real goal was another and could have been implemented in a totally different way. :P
And it's not so hypothetical, because it's what happened just now: nofollow based on permissions require an approach, nofollow based on a white-list can be achieved much better in another way. You first asked for permissions, now for white-list. So, should I now mix the two approaches and have the worst possible scenario of complexity or should I just give up one of the two? And if the latter which one should I drop? ;)

iurl is another matter altogether. O:-)

Quote from: radu81 – P. S. I'm not an expert in seo and I don't know if this will bring me any vantage, but if most forums are having nofollow links  into core from default (xf, wbb, kunena, vanilla,  bbpress) maybe worth some time to invest into this for the next releases 1.1.x or 2.0...
Well, if we want to nitpick:
1) some of the most famous forums of the world (reddit, stackoverflow) don't even open new windows on each and every link,
2) another one (whose glory is actually in the past, 4chan) is not even creating clickable links out of URLs.

There is variety, I tend to dislike the nofollow, simply because if I link something, it means it's relevant somehow, and if something is relevant it should just get the recognition it deserves (and I tend to expect others do the same with my sites, but I'm pretty sure it's not the case... sigh).
Following the current (and last 5 years) trend, I guess in a couple of years nofollow will not be a problem because search engines google will not give a sh**t about links and just care about what it thinks it's important and all these discussions will be mood. :P

TL;DR: tell me what you want and let's make it a deal. ;)

Don't worry about what I posted, it's not against you, it's just that this evening I'm in a ranting mood. LOL
Bugs creator.
Features destroyer.
Template killer.

Re: Request - Nofollow attribute for external links

Reply #29

I have to admit I did a mess in this topic and I escuse for that, was not my intention. As you can see lots of ideas and all confused  O:-)

What I am trying to obtain is to set all external links as nofollow and and allow links without nofollow atribute only for some domains. The "membergroup permission" is not really needed and in my case probably a whitelist could work better.

Could this be simplier than the previous addon with membergroup permission?

thank you in advance
sorry for my bad english