Hiya,
You may have seen my previous post regarding this. I thought I would post this in a new thread though so that it will all be fresh.
I have now finished the creation of my Logout Redirect extension which is actually an extension and a Plugin. Usage is exceptionally simple and is outlined below :
Plugin code for use in templates
{if logged_in}
{exp:logout_redirect url="http://www.yahoo.com" text="Get Me Out Now" styles="class='logout-link-class' title='Logout Link'"}
{/if}
This will create the standard ExpressionEngine log-out link on any template that you place it on and in conjunction with the extension will log the user out and then re-direct them to the url as specified above.
Installation Instructions
1 Download the Logout Redirect package from the bottom of this post.
2 Copy the ext_logout_redirect.php file to your system->extensions folder.
3 Copy the pi.logout_redirect.php file to your system->plugins folder.
4 Copy the lang.logout_redirect.php file to your system->language->english folder.N.B. You may have a different name for your system folder as you may have changed this upon installation of your ExpressionEngine system.
5 Log in to the Admin section of your site and install the Logout Redirect extension.
6 Place the Plugin code (shown above) into one of your templates.
7 Try logging out on the user side. You should be first of all logged-out and then re-directed to the url that you specified!N.B. You must use the {if logged_in} code and surround the plugin with this.
Also with the plugin code you can do the following kind of thing :
{if logged_in}
{if member_group == "1"}
{exp:logout_redirect url="http://www.yahoo.com" text="Get Me Out Of Here" styles="class='logout' title='Logout'"}
{/if}
{/if}
This can mean that you can place loads of these on a page and have people redirected to different places on logout depending upon their member group.
Enjoy!!
I will be adding to this in the future depending on any feature requests that anyone thinks up and if I can actually figure them out in the first place as this is my first extension that I have created and I am quite proud of it. I’m pretty sure that my code is good but please be aware that there are no warranties with this and you should use it at your own risk. That said I have tested this out many many times and it seems to work very well so hopefully it shouldn’t cause any problems but do remember to backup first just in case.
Hope someone finds it useful.
Best wishes,
Mark
