Okay, I re-read the topic because honestly I had forgot almost everything.
So, at the moment the situation is:
1) there is an addon that allows to post "follow" URLs based on permissions,
2) the need is an addon that has a white-listing feature based on the domain.
Thank you emanuele, is correct what you are saying. Will this addon use custom bbcode or it will be invisible?
Have a look at the attached.
Maintains the permission things (sorry, too lazy to remove it) and adds on top of it a white-listing and the exclusion from the "nofollow rule" of internal links.
Thank you Emanuele, I will try it 8)
I did not forget about this, I've been out in the last 2 weeks ;) Now I see 7 pages of unread topics ;D
I will test it this weekend, thanks again Emanuele
Take your time on catching up! :P
It does the job, no bbcode added to links and whitelisted domains are without nofollow, thank you Emanuele ;)
Once in a while I get some done right! LOL
there is a little problem with the addon: if I insert a link using the button into sceditor, the bbcode became:
[url url=http://www.google.it nofollow=dofollow]prova link[/url]
and if I click on the link it opens a new tab with the same topic: http://www.domain.com/index.php?topic=xx.new
the nofollow bbcode is really necessary? I think not, because all old links non whitelisted are getting correctly the nofollow atribute. Correct me if I am wrong
The reason there is the nofollow attribute is to actually white-list the links: by default anything is nofollow, then I need a way to tell the parser "ok, this is not a nofollow", and there is it the param.
Just to be sure I understand:
1) start a new message,
2) turn on WYSIWYG
3) insert a (named) link
expected: the link points to the address
observed: the link points to the original topic
Did I got it right?
Sorry for the delay, I unistalled the addon from my forum, too many broken links so I installed it in a test board:
I'll update the package, in the meantime, in NoFollow.integrate.php, just find:
$param = \'http://\' . $param;
and add just after:
sorry for the n00b error... :-[
that solved the problem with links pointing to current topic, thank you. I still test it and try to find other bugs ;)
No, you don't have to find bugs. :P
Thanks guys for this plugin, exactly what I was looking for.
I was going to give a poster in my forum the gift of "dofollow" to her blog, until I see she was advertising products on Amazon using keywords. Now, if she wants to give me a percentage.....that's a different story!
Keep finding those bugs for Emanuele folks....
maybe we can start a collection to pay for more coffee for him, while he's up late correcting them! ;D
Interesting... I didn't follow this before, so I'm parking in and will test this later.
It works Ahrasis. Highlight the keywords the poster is linking to, then right click to bring up "inspect element" using FF. Then it shows the link is a nofollow! Why should I be giving away free link juice? No more!
Is it a permission based? I haven't look into the code yet.
I feel email don't really have any reason to be nofollow.
The only option is to mask them somehow, but add the nofollow attribute is not of great help.
I am getting some errors in elkarte log:
Undefined index: host
sources/subs/NoFollow.integrate.php Line: 174
line 174 is:
if (substr($parsed['host'], -strlen($valid_domain)) === $valid_domain)
The errors are related to some topics and in search results. Any suggestion to solve this?
Do you have the URLs of the searches?
and a topic where I see the error sharkracingclub.it/index.php?topic=2944.15
And no other errors?
That's strange... :-\
Memo to self: the code should ignore the www.
I cleared the erros, I just did a search for tag (img] and I get another error:
type of error: Undefined
Undefined index: host
Tomorrow I will look better in the other forum, there I got more errors.
What version of php?
temporary I switched to 5.4, but usually I use 5.6
Exactly what php 5.4 version is it?
And with 5.6 it was working?
/me is temped to blame php and declare 5.6 the minimum version. xD
Seriously: I have to look into it.
with php5.4 I only got 2 errors in the last 8 hours
Type of error: Undefined
Undefined index: host
I switch now to php5.6 to see if I get other errors
I found some errors in Elkarte log, all of them are related to this topic http://www.skodaclub.it/index.php?topic=4799.0
I am using php 5.6
8: Undefined index: host
The strange thing is there is no link on that page, only a youtube video. Could be this?
Another stupid error. :-\
In NoFollow.integrate.php, change:
$message = preg_replace_callback('~<a href="(.*?)" class="bbc_link" rel="nofollow"(?: target=".*?")?>~', array(self::$instance, 'replace_callback'), $message);
$message = preg_replace_callback('~<a href="([^>]*?)" class="bbc_link" rel="nofollow"(?: target="_?\w+")?>~', array(self::$instance, 'replace_callback'), $message);
that should do.
thank you, no more errors from that topic ;)
I just installed this on 1.1 RC2, it installs without errors, but it's not working. If I publish a link like
[url url=https://www.google.it nofollow=dofollow]google.it[/url]
but there is no link visible, only text.
do you have any plans to update this addon for elkarte 1.1? Thank you
is there any improvement?
I installed in version 1.1.6 does not add nofolow
the add-on is not compatible with elkarte 1.1
can you give information about working with code editing?
a detailed revision is required
hmm... BBC parser.
comment I'd say the problem is in the parsing, though right not I'm not entirely sure why it should not work (apart from the fact it still uses create_function and messes with http/https).
This evening I'll try to have a look.
I tried, honestly I didn't test it at all. From this to time this happens to work out well, not always. xD
Thanks @emanuele works, there is a problem but also affects main site links
<a href="https://MAIN-SITE.com" class="bbc_link" rel="noopener noreferrer nofollow" target="_blank">"https://MAIN-SITE.com</a>
<a href="https://EXTERNAL-SITE.com" class="bbc_link" rel="noopener noreferrer nofollow" target="_blank">https://EXTERNAL-SITE.com</a>
I guess I don't like to do assumptions, that's likely why there is a "white list" setting in the admin panel.
Thanks. I found the settings but after saving it gave error
click check box (internal site) and add one site link white link area (https://www.site.com) save setting
error setting page appears;
implode(): Invalid arguments passed
and the setting page always gives the same error
I can access the settings page when I uninstall the plugin
it again error page appears when installing the plugin again
There should be also something else along with the error, like the file and the row number.
a different error appears click "back" button;
Please try changing:
$modSettings['nofollow_whitelist'] = implode("\n", json_decode($modSettings['nofollow_whitelist']));
$modSettings['nofollow_whitelist'] = implode("\n", json_decode($modSettings['nofollow_whitelist'], true));
I've tried. the same error appears
Oook, now I got it.
Try the one attached here.
Thanks it works .
Php 7+ annoying errors... :-\
I noticed a new problem,
If add link editor button is used, is not clickable url. Appears in text format
[url url=https://site.com/sample-post/ nofollow=dofollow]Sample Post[/url]
Edit: + image upload sites BBC image code. Not clickable url. Appears in text format
hmm... that has likely to do with some relatively new feature of the editor.
ETA: I suppose you mean the WYSIWG editor, right?