Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: digger on July 03, 2017, 10:29:06 AM

Title: Redirector
Post by: digger on July 03, 2017, 10:29:06 AM
Link to the mod (https://custom.simplemachines.org/index.php?mod=4148)

SMF Redirector mod

Author: digger
License: The MIT License (MIT)
Hooks only: Yes
Compatible with: SMF 2.0, SMF 2.1
Languages: English, Russian, French
GitHub: https://github.com/realdigger/SMF-Redirector (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".

History:
1.2.5 Fix redirect page
1.2.6 French translation by alexetgus

(https://user-images.githubusercontent.com/1187218/77808218-e6a87000-70a3-11ea-9dc0-5f5d336d4fea.png)
Title: Re: Redirector
Post by: Shambles on July 03, 2017, 12:43:59 PM
Hi digger. Thanks for this mod.

What does it actually do?
Title: Re: Redirector
Post by: digger on July 03, 2017, 01:57:58 PM
Quote from: Shambles on July 03, 2017, 12:43:59 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
Title: Re: Redirector
Post by: Shambles 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 ?
Title: Re: Redirector
Post by: digger on July 03, 2017, 02:23:12 PM
Quote from: Shambles 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 ?
It's encoded string for https://www.simplemachines.org
Title: Re: Redirector
Post by: Shambles 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?
Title: Re: Redirector
Post by: digger 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.
Title: Re: Redirector
Post by: Shambles on July 03, 2017, 04:55:24 PM
Maybe say all that in the description, yeah? ;)
Title: Re: Redirector
Post by: shawnb61 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...
Title: Re: Redirector
Post by: digger on July 04, 2017, 03:12:59 AM
Quote from: shawnb61 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...
It is dynamic. Mod change |URL| and |IURL| tags parser.
Title: Re: Redirector
Post by: Arantor 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.
Title: Re: Redirector
Post by: Gryzor 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...
Title: Re: Redirector
Post by: asisehacepro 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

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.
Title: Re: Redirector
Post by: Sir Osis of Liver 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.
Title: Re: Redirector
Post by: digger on March 27, 2020, 07:22:00 PM
Quote from: asisehacepro on March 27, 2020, 11:28:12 AM
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
Title: Re: Redirector
Post by: asisehacepro on March 28, 2020, 12:00:27 PM
Quote from: digger on March 27, 2020, 07:22:00 PM
Quote from: asisehacepro on March 27, 2020, 11:28:12 AM
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.