Advertisement:

Author Topic: [TIP/TRICK] Auto [iurl] For Internal Links And "nofollow" For External Links  (Read 44623 times)

Neo_TE

  • Guest
This mod is now approved & is available in the mod site for download in this link, http://custom.simplemachines.org/mods/index.php?mod=3767.

Please use this theme's support thread for further discussions, http://www.simplemachines.org/community/index.php?topic=519432.0.

If you are using this tip/trick then please use the mod from the mod site. Thanks.


Auto [iurl] For Internal Links And "nofollow" For External Links


Features
This mod differentiates the internal links from external links and
  • automatically adds "iurl" tag for internal links, so that internal links are opened in the same window
  • automatically adds "nofollow" only for external links

How-To-Check if this Mod Actually Works in your Forum
Go to a thread that has both internal & external links. Right click -> view page source and then search for the internal & external links.

Before installing this mod, the links will appear like

Code: [Select]
<a href="INTERNAL_LINK" class="bbc_link" target="_blank">INTERNAL LINK</a>
<a href="EXTERNAL_LINK" class="bbc_link" target="_blank">EXTERNAL LINK</a>

After installing the mod, the links will appear like

Code: [Select]
<a href="INTERNAL_LINK" class="bbc_link">INTERNAL LINK</a>
<a href="EXTERNAL_LINK" class="bbc_link" target="_blank" rel="nofollow">EXTERNAL LINK</a>


Supported Themes
Works on all the themes without any custom edits!


Supported SMF Versions
Tested on fresh installation of 2.0.x.


License

This is free and unencumbered tip/trick released into the public domain. For more information, see http://unlicense.org/.

« Last Edit: March 13, 2014, 04:09:11 AM by xPandax »

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 68,042
    • Arantor on GitHub
When did 'size of mod' become a criteria? Hell, one time I submitted a mod that was one line long but because it was packaged it was easier for people to use.
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

You either die a hero or live long enough to see yourself become the villain. It seems you have chosen which, and now I must do the same.

Neo_TE

  • Guest
This is what I received in the PM.

Quote
We're sorry, but we have to reject your modification because it is too small for the mod site. Please post your package in Coding discussion so we can move it to the tips and tricks board.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 68,042
    • Arantor on GitHub
Ridiculous.
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

You either die a hero or live long enough to see yourself become the villain. It seems you have chosen which, and now I must do the same.

Neo_TE

  • Guest
The time it took for me to figure out the regex for this mod was damn too high and now its being rejected as a mod.

Its about time for me to stop making mods for SMF. :-X

Offline sǝๅqɯɐɥS

  • SMF Hero
  • ******
  • Posts: 4,511
  • Gender: Male
    • i30 Owners Club
Too small for a mod  :o

I was looking at Edit and Align Categories earlier today, thinking how small that was, but that's been accepted and registered as a mod.

A strange decision.

You keep working on stuff, xPandax, I'll support you.

Offline emanuele

  • SMF Super Hero
  • *******
  • Posts: 14,156
  • Gender: Male
  • THERE'S JUST ME


Take a peek at what I'm doing! ;D



Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Offline sǝๅqɯɐɥS

  • SMF Hero
  • ******
  • Posts: 4,511
  • Gender: Male
    • i30 Owners Club
So we need a definition of "small", perhaps for discussion in another thread.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 68,042
    • Arantor on GitHub
And size is subjective too. What some would call small, others would call medium. The only thing that can generally be agreed upon is what constitutes a large mod... and that's anything over a medium size :P
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

You either die a hero or live long enough to see yourself become the villain. It seems you have chosen which, and now I must do the same.

Neo_TE

  • Guest
You keep working on stuff, xPandax, I'll support you.

Thank you very much.

But there is actually no use in making new mods when its not accepted as a mod because the majority of users just search for mods in the mod site and the same majority of people don't even know that such a tip/trick board exists.

Ill stop making any more new mods & just provide support for my current mods.



@Arantor & emanuele - Thanks you very much for the support.
« Last Edit: September 07, 2013, 06:04:42 AM by xPandax »

kat

  • Guest
Re: [TIP/TRICK] Auto [iurl] For Internal Links And "nofollow" For External Links
« Reply #10 on: September 07, 2013, 06:03:31 AM »
It does seem a little odd.

If a member wants a feature, they're likely to look at the mods. They're somewhat less likely, I'd submit, to look at the Tips'n'tricks board.

One for discussion with the customisation team, methinks.

kat

  • Guest
Re: [TIP/TRICK] Auto [iurl] For Internal Links And "nofollow" For External Links
« Reply #11 on: September 07, 2013, 06:09:04 AM »
I've started a discussion topic, for the customisation team to discuss this. :)

French

  • Guest
Re: [TIP/TRICK] Auto [iurl] For Internal Links And "nofollow" For External Links
« Reply #12 on: September 07, 2013, 06:27:50 AM »
Why not create a new item on the mod site called minor modifications

kat

  • Guest
Re: [TIP/TRICK] Auto [iurl] For Internal Links And "nofollow" For External Links
« Reply #13 on: September 07, 2013, 06:34:50 AM »
That's already been mentioned. The discussion's running, as I type (We're quick, if nothing else) ;)

We'll try and work something out.

We DO listen. We don't always act, of course, for various reasons. But, we sure do listen. :)

Offline sǝๅqɯɐɥS

  • SMF Hero
  • ******
  • Posts: 4,511
  • Gender: Male
    • i30 Owners Club
Re: [TIP/TRICK] Auto [iurl] For Internal Links And "nofollow" For External Links
« Reply #14 on: September 07, 2013, 11:33:59 AM »
Quote from: K@
We'll try and work something out.
Mod authors just need to know the criteria by which mods are 'graded' - lines of source, number of files edited, number of DB queries required etc.

We now know that mods of this (OP's) size are deemed too small, so there's a benchmark.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 68,042
    • Arantor on GitHub
Re: [TIP/TRICK] Auto [iurl] For Internal Links And "nofollow" For External Links
« Reply #15 on: September 07, 2013, 11:34:46 AM »
There's criteria now?
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

You either die a hero or live long enough to see yourself become the villain. It seems you have chosen which, and now I must do the same.

Offline sǝๅqɯɐɥS

  • SMF Hero
  • ******
  • Posts: 4,511
  • Gender: Male
    • i30 Owners Club
Re: [TIP/TRICK] Auto [iurl] For Internal Links And "nofollow" For External Links
« Reply #16 on: September 07, 2013, 11:37:32 AM »
There must be, if we've already see a rejection by dint of 'too small'.

Neo_TE

  • Guest
Re: [TIP/TRICK] Auto [iurl] For Internal Links And "nofollow" For External Links
« Reply #17 on: September 08, 2013, 05:27:49 AM »
Whoa, I don't think the mod listed in this thread is neither smaller nor simpler than this mod which is available in the mod site.

http://custom.simplemachines.org/mods/index.php?mod=3710




kat

  • Guest
Re: [TIP/TRICK] Auto [iurl] For Internal Links And "nofollow" For External Links
« Reply #18 on: September 08, 2013, 05:31:50 AM »
Yeah, there're a few that seem to scream "Inconsistency!"!, If you look around. There might be reasons, though. Old mod that was updated, when a different policy was in force, that kinda thing.

As I said, it IS being discussed.

So, with the way the SMF wheels are, usually, greased, we may get some kind of decision within the next... hmm.. decade, or so? ;)

Neo_TE

  • Guest
Re: [TIP/TRICK] Auto [iurl] For Internal Links And "nofollow" For External Links
« Reply #19 on: September 10, 2013, 02:48:30 AM »
It does seem a little odd.

If a member wants a feature, they're likely to look at the mods. They're somewhat less likely, I'd submit, to look at the Tips'n'tricks board.

One for discussion with the customisation team, methinks.


Yeah, there're a few that seem to scream "Inconsistency!"!, If you look around. There might be reasons, though. Old mod that was updated, when a different policy was in force, that kinda thing.

As I said, it IS being discussed.

So, with the way the SMF wheels are, usually, greased, we may get some kind of decision within the next... hmm.. decade, or so? ;)

Thank you very much. :)

kat

  • Guest
Re: [TIP/TRICK] Auto [iurl] For Internal Links And "nofollow" For External Links
« Reply #20 on: September 10, 2013, 06:19:34 AM »

Offline Study Force

  • SMF Hero
  • ******
  • Posts: 3,101
    • @studyforceps on Twitter
    • Study Force
Re: [TIP/TRICK] Auto [iurl] For Internal Links And "nofollow" For External Links
« Reply #21 on: September 14, 2013, 02:15:04 PM »
Installed on my SMF 2 forum, what a great idea!

Will try to make this work on SMF 1.

Edit: The edits on SMF 1 are the same, but couldn't get it to work. Appears that both internal and external links get nofollow...
« Last Edit: September 14, 2013, 02:28:30 PM by Liam_michael »

Neo_TE

  • Guest
Re: [TIP/TRICK] Auto [iurl] For Internal Links And "nofollow" For External Links
« Reply #22 on: September 15, 2013, 08:09:07 AM »
Installed on my SMF 2 forum, what a great idea!

Will try to make this work on SMF 1.

Edit: The edits on SMF 1 are the same, but couldn't get it to work. Appears that both internal and external links get nofollow...

Thanks & you're welcome.

Ill check on making it work properly with SMF 1.x.

Offline milcar

  • Newbie
  • *
  • Posts: 9
Thanks a lot for this mod! Installed on my smf 2.0.5

Works well for external links and internal forum links, but there is a problem with other internal links.

I'm not sure is it a bag or feature, but all www.[mysite].com links are getting nofollow too. Forum is in a subfolder (www.[mysite].com/forum) and these links are fine, without the nofollow.

Is there a way to fix this?

Neo_TE

  • Guest
As per the current codes, only the forum links will get [iurl] and all other links will get "no follow". Ill try to fix that when I find time.

Offline Study Force

  • SMF Hero
  • ******
  • Posts: 3,101
    • @studyforceps on Twitter
    • Study Force
As per the current codes, only the forum links will get [iurl] and all other links will get "no follow". Ill try to fix that when I find time.

xPandax, don't forget the 1.x request! Thanks.

Offline radu81

  • Jr. Member
  • **
  • Posts: 315
  • Gender: Male
thank you very much xPandax!
sorry for my bad english

Offline hadesflames

  • SMF Hero
  • ******
  • Posts: 2,773
  • Gender: Male
  • C++ Coder
In my opinion, any edit, no matter how small, that does anything should be packaged up as a mod. This eases the admin's work when upgrading forum, installing themes, etc. So the customization team's decision on this is ridiculous to say the least.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 68,042
    • Arantor on GitHub
The decision was subsequently changed. Even one line mods are permitted (as evidenced by the publication of one minimod of mine)
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

You either die a hero or live long enough to see yourself become the villain. It seems you have chosen which, and now I must do the same.

Offline jackor

  • Newbie
  • *
  • Posts: 2
Thanks you so much !

Offline SirLouen

  • Semi-Newbie
  • *
  • Posts: 36
Would be interesting if we could put selective nofollow tags to certain URL or the other way, exclusivity to certain URL without URL

Neo_TE

  • Guest
Would be interesting if we could put selective nofollow tags to certain URL or the other way, exclusivity to certain URL without URL

That's not possible with the current code.

And the feature you are asking for is highly dynamic and it would require lots of codes (atleast with my current php knowledge) which I can't do as of now.

Neo_TE

  • Guest
In my opinion, any edit, no matter how small, that does anything should be packaged up as a mod. This eases the admin's work when upgrading forum, installing themes, etc. So the customization team's decision on this is ridiculous to say the least.

The decision was subsequently changed. Even one line mods are permitted (as evidenced by the publication of one minimod of mine)

Thanks for the info., ill PM the mod team again and ask them if my mod will be approved now.  :D

Offline punchy

  • Jr. Member
  • **
  • Posts: 145
  • Gender: Male
    • Site Safety Manager
Ok I had this mod installed and nothing seems to happen, I checked in the subs.php and all is there but when i add a link to a post and then view it it stays the same likewise when an rss feed adds to the thread, theres nothing added on?

Am i doing something wrong??  :o

Neo_TE

  • Guest
Ok I had this mod installed and nothing seems to happen, I checked in the subs.php and all is there but when i add a link to a post and then view it it stays the same likewise when an rss feed adds to the thread, theres nothing added on?

Am i doing something wrong??  :o

Instructions are available in the first post to check if this tip/trick is working properly. :)




This mod is now approved & is available in the mod site for download in this link, http://custom.simplemachines.org/mods/index.php?mod=3767.

Please use this theme's support thread for further discussions, http://www.simplemachines.org/community/index.php?topic=519432.0.

If you are using this tip/trick then please use the mod from the mod site. Thanks.

Offline sangham.net

  • Full Member
  • ***
  • Posts: 497
  • Gender: Male


Congaratulations!

Btw, most respected generous Panda: here also the original of the Quote you have in your Avatar (it might transport more that this usual "fake")

Quote
Phenomena are   preceded by the heart,
   ruled by the heart,
   made of the heart.
If you speak or act
with a corrupted heart,
then suffering follows you —
as the wheel of the cart,
   the track of the ox
   that pulls it.

Phenomena are  preceded by the heart,
   ruled by the heart,
   made of the heart.
If you speak or act
with a calm, bright heart,
then happiness follows you,
like a shadow
   that never leaves.

Dhammapada 1-2

Heart means also tendency, innermost decline.

Neo_TE

  • Guest


Congaratulations!

Btw, most respected generous Panda: here also the original of the Quote you have in your Avatar (it might transport more that this usual "fake")

Heart means also tendency, innermost decline.

Yes, thank you very much. And yes I have read in some websites that the quote is fake but a lot of websites say that its real and the exact quote was lost in translation.

And also adding to that, that quote has been 100% right in my life. Some people call it law of attraction (I guess you would have already heard of that).

Since you are into spiritual stuff, I recommend this video for you. Its has scientific proof of spiritual teaching lost in translation. :)  https://www.youtube.com/watch?v=VuW7e1yCVvc


May the force be with you! :P

Offline sangham.net

  • Full Member
  • ***
  • Posts: 497
  • Gender: Male
Does thinking make you suffering?   :) Of course you can develop beautiful thought - garlands but... they will decay.

There is no such thing as "force". There is "just" right or wrong effort:)

And its not a bad news. It's just up to the taste of the right cookie that it becomes a lasting right effort.

"but a lot of..." that is a good indication of wrong (not well explained  ;) just the normal world going on.

Offline Irisado

  • Doc Coordinator
  • SMF Hero
  • *
  • Posts: 9,007
  • Soñando debajo del arco iris
Locked by request of the mod author.  Please read the first post for information on where to comment on this mod from now on.
Soñando con una playa donde brilla el sol, un arco iris ilumina el cielo, y el mar espejea iridescentemente