Advertisement:

Author Topic: Redirector  (Read 1749 times)

Offline digger

  • Sr. Member
  • ****
  • Posts: 762
  • Gender: Male
    • realdigger on GitHub
    • SMF Russian Community
Redirector
« on: July 03, 2017, 10:29:06 AM »
Link to Mod

SMF Redirector mod

Author: digger
License: The MIT License (MIT)
Hooks only: Yes
Compatible with: SMF 2.0, SMF 2.1
Languages: English, Russian
GitHub: https://github.com/realdigger/SMF-Redirector

Redirect for external links. Hide links from guests.

Features:
* External links redirection
* For guests only redirection
* Members websites redirection
* External links encoding
* Hide links for guests
* Delayed or instantly redirection
* Domains white list
* Option for rel="nofollow noopener".


Offline Shambles

  • SMF Hero
  • ******
  • Posts: 5,421
  • Gender: Male
    • i30 Owners Club
Re: Redirector
« Reply #1 on: July 03, 2017, 12:43:59 PM »
Hi digger. Thanks for this mod.

What does it actually do?

Offline digger

  • Sr. Member
  • ****
  • Posts: 762
  • Gender: Male
    • realdigger on GitHub
    • SMF Russian Community
Re: Redirector
« Reply #2 on: July 03, 2017, 01:57:58 PM »
Hi digger. Thanks for this mod.

What does it actually do?
Hi.
Mod redirects external links over internal forum page.
For examle link https://www.simplemachines.org will be redirected to index.php?action=go;url=aHR0cHM6Ly93d3cuc2ltcGxlbWFjaGluZXMub3Jn

Offline Shambles

  • SMF Hero
  • ******
  • Posts: 5,421
  • Gender: Male
    • i30 Owners Club
Re: Redirector
« Reply #3 on: July 03, 2017, 02:19:22 PM »
Hi thanks.

I might be being thick here, but what does it redirect to? What's at url=aHR0cHM6Ly93d3cuc2ltcGxlbWFjaGluZXMub3Jn ?

Offline digger

  • Sr. Member
  • ****
  • Posts: 762
  • Gender: Male
    • realdigger on GitHub
    • SMF Russian Community
Re: Redirector
« Reply #4 on: July 03, 2017, 02:23:12 PM »
Hi thanks.

I might be being thick here, but what does it redirect to? What's at url=aHR0cHM6Ly93d3cuc2ltcGxlbWFjaGluZXMub3Jn ?
It's encoded string for https://www.simplemachines.org

Offline Shambles

  • SMF Hero
  • ******
  • Posts: 5,421
  • Gender: Male
    • i30 Owners Club
Re: Redirector
« Reply #5 on: July 03, 2017, 02:29:59 PM »
I'm clearly missing something here.

What happens when action=go;url=encoded_string

Apologies for not understanding something that's probably simple, but I just can't understand this. Do we have to write some code to understand the encoded_string?

Offline digger

  • Sr. Member
  • ****
  • Posts: 762
  • Gender: Male
    • realdigger on GitHub
    • SMF Russian Community
Re: Redirector
« Reply #6 on: July 03, 2017, 03:58:03 PM »
It's a SEO magic :)
With this mod external links looks like a forum local links pointed to action=go.
When you go to action=go;url=encoded_string mod decodes encoded url and redirect browser to original url.

Offline Shambles

  • SMF Hero
  • ******
  • Posts: 5,421
  • Gender: Male
    • i30 Owners Club
Re: Redirector
« Reply #7 on: July 03, 2017, 04:55:24 PM »
Maybe say all that in the description, yeah? ;)

Offline shawnb61

  • Developer
  • SMF Hero
  • *
  • Posts: 1,932
    • sbulen on GitHub
Re: Redirector
« Reply #8 on: July 03, 2017, 05:02:39 PM »
Is it dynamic, or are the encoded links stored? 

Wondering if this might impact site moves or https conversions...
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Offline digger

  • Sr. Member
  • ****
  • Posts: 762
  • Gender: Male
    • realdigger on GitHub
    • SMF Russian Community
Re: Redirector
« Reply #9 on: July 04, 2017, 03:12:59 AM »
Is it dynamic, or are the encoded links stored? 

Wondering if this might impact site moves or https conversions...
It is dynamic. Mod change |URL| and |IURL| tags parser.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,980
    • StoryBB/StoryBB on GitHub
Re: Redirector
« Reply #10 on: July 04, 2017, 03:44:19 AM »
Not sure how it actually helps with SEO, if anything I'd wonder if it would hurt because it's been well known for some years that not linking out of a site actually hurts: you want to have good reputation but you don't want to consider anything else worthy of reputation yourself, you don't trust anything, therefore Google considers that you yourself aren't as worthy of trust either.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline Gryzor

  • Sr. Member
  • ****
  • Posts: 787
  • Gender: Male
  • CPCwiki.eu - The Amstrad CPC Encyclopaedia!
    • CPCWiki
Re: Redirector
« Reply #11 on: July 04, 2017, 09:26:02 AM »
Got to agree with Arantor, I don't see how this will help with SEO in the long term. I guess the concept it that you create in-site cross-linking, but since the targets are not indexed pages I doubt it will take long for a search engine to sniff out what happens...

Offline asisehacepro

  • Newbie
  • *
  • Posts: 5
Re: Redirector
« Reply #12 on: March 27, 2020, 11:28:12 AM »
Hello,
First to all, congratulations because of your mod.
But I get the following error when I load the bridge page with x delay before accessing the final website.

Call to undefined function mimespecialchars()

Looking for that function with notepad, I get the following in the .\Sources\Subs-Post.php file

Code: [Select]
Line 73: string mimespecialchars(string text, bool with_charset = true,
Line 674: list (, $from_name) = mimespecialchars(addcslashes($from !== null ? $from : $context['forum_name'], '<>()\'\\"'), true, $hotmail_fix, $line_break);
Line 675: list (, $subject) = mimespecialchars($subject, true, $hotmail_fix, $line_break);
Line 708: list(, $plain_message) = mimespecialchars($no_html_message, false, true, $line_break);
Line 712: list($charset, $plain_charset_message, $encoding) = mimespecialchars($no_html_message, false, false, $line_break);
Line 718: list($charset, $html_message, $encoding) = mimespecialchars($orig_message, false, $hotmail_fix, $line_break);
Line 727: list(, $plain_message) = mimespecialchars($orig_message, false, true, $line_break);
Line 731: list ($charset, $encoded_message, $encoding) = mimespecialchars($orig_message, false, false, $line_break);
Line 1215: function mimespecialchars($string, $with_charset = true, $hotmail_fix = false, $line_break = "\r\n", $custom_charset = null)

If you need any more files, just ask me. I'm using SMF 2.0.17 and everything else works fine for me.

Thank you very much in advance.
Greetings.

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 9,905
  • Hoarding Budweiser in NY
Re: Redirector
« Reply #13 on: March 27, 2020, 12:57:29 PM »
As per the earlier posts, this mod is basically useless.  mimespecialchars() is a core function, the mod is probably calling it before it's defined.

Offline digger

  • Sr. Member
  • ****
  • Posts: 762
  • Gender: Male
    • realdigger on GitHub
    • SMF Russian Community
Re: Redirector
« Reply #14 on: March 27, 2020, 07:22:00 PM »
But I get the following error when I load the bridge page with x delay before accessing the final website.
Call to undefined function mimespecialchars()
Fixed in v1.2.5

Offline asisehacepro

  • Newbie
  • *
  • Posts: 5
Re: Redirector
« Reply #15 on: March 28, 2020, 12:00:27 PM »
But I get the following error when I load the bridge page with x delay before accessing the final website.
Call to undefined function mimespecialchars()
Fixed in v1.2.5

Thank you very much for you answer and update!
I'm using now perfectly!

Thanks again.