ElkArte Community

Extending Elk => Addons => Topic started by: emanuele on December 03, 2014, 09:06:13 am

Title: [ADDON] Redirect to external website
Post by: emanuele on December 03, 2014, 09:06:13 am
Redirect to external website v0.0.1
Introduction
Just a very basic addon that "catches" boards redirection to external websites (actually, any redirect that passes through redirectexit) and presents a screen informing the user he is leaving the original site.

It doesn't work on links posted in messages.


License
o This ElkArte Addon is subject to the terms of the BSD "3-clause" license. You can obtain a copy of the License at http://opensource.org/licenses/BSD-3-Clause

Repository / Download
Title: Re: [ADDON] Redirect to external website
Post by: emanuele on December 03, 2014, 09:08:14 am
The reason I coded this is because I was thinking to install it here, so that external support boards are "properly" indicated, and people know they are heading to a different site and it is "normal". Objections?
Title: Re: [ADDON] Redirect to external website
Post by: emanuele on December 04, 2014, 09:05:56 am
As usual the uninstall is broken. xD
Title: Re: [ADDON] Redirect to external website
Post by: hkokate on February 27, 2018, 12:16:40 am
@emanuele

This is the exact module I want to uninstall. What do I do? Is it okay if I just delete its files?
Title: Re: [ADDON] Redirect to external website
Post by: ahrasis on February 27, 2018, 12:23:28 am
I think deleting its files should work fine as uninstall.
Title: Re: [ADDON] Redirect to external website
Post by: hkokate on February 27, 2018, 12:26:49 am
@ahrasis

 I had thought so too, but, when I went to delete its files, I got the warning as: "The package you are about to delete is currently installed! If you delete it, you may not be able to uninstall it later.

Are you sure?"

That warning is stopping me from deleting its files. I don't want to break my forum.
Title: Re: [ADDON] Redirect to external website
Post by: emanuele on February 27, 2018, 07:42:49 am
Packages are not the "installed" thing.

When you download a package, you download a zip file.
When you install the the package, the zip file extracted and each file inside of it is placed in a certain place inside the elk file structure.
When you uninstall a package elk deletes all the files that has extracted.
When you delete a package you remove the zip file without uninstalling anything.

This should make clear the distinction between uploading a package and actually install it.

So, if you want to manually uninstall the addon you have to delete the 4 files that constitute the addon:
1) sources/controller/Redirect.controller.php
2) themes/default/languages/english/Redirect.english.php
3) sources/Redirect.integrate.php
4) themes/default/Redirect.template.php
at that point you can delete the zip file even if there is the warning, because the addon is basically uninstalled (actually it's not entirely uninstalled, but it's safe to consider as uninstalled).
Title: Re: [ADDON] Redirect to external website
Post by: ahrasis on February 27, 2018, 07:44:49 pm
I thought I already mentioned clearly "its files" not "its package". :P
Title: Re: [ADDON] Redirect to external website
Post by: derived on February 27, 2018, 09:06:50 pm
Quote from: emanuele – Packages are not the "installed" thing.

When you download a package, you download a zip file.
When you install the the package, the zip file extracted and each file inside of it is placed in a certain place inside the elk file structure.
When you uninstall a package elk deletes all the files that has extracted.
When you delete a package you remove the zip file without uninstalling anything.

This should make clear the distinction between uploading a package and actually install it.

So, if you want to manually uninstall the addon you have to delete the 4 files that constitute the addon:
1) sources/controller/Redirect.controller.php
2) themes/default/languages/english/Redirect.english.php
3) sources/Redirect.integrate.php
4) themes/default/Redirect.template.php
at that point you can delete the zip file even if there is the warning, because the addon is basically uninstalled (actually it's not entirely uninstalled, but it's safe to consider as uninstalled).


The manual uninstall bit, would make a good "sticky" SOMEWHERE
Title: Re: [ADDON] Redirect to external website
Post by: hkokate on February 27, 2018, 10:20:19 pm
@emanuele

I've deleted the files you mentioned from my server and it seems that it has worked. Thanks.
Title: Re: [ADDON] Redirect to external website
Post by: emanuele on February 28, 2018, 02:12:51 am
Quote from: derived – The manual uninstall bit, would make a good "sticky" SOMEWHERE
Yep. :P