Blog posts
- Airport info API 14 Dec 17
- Admin dashboard hacks 01 Nov 17
- Allow visitor to change skin 24 Oct 17
- Weather and sunrise/sunset 03 Oct 17
- How to create a chatbox 27 Sep 17
I managed to write a few elegant lines so that the user can select the skin. Write the following in your core/codon.config.php
$user_skin=$_GET['user_skin'];
if (isset($user_skin))
SessionManager::Set('user_skin',$user_skin);
$user_skin=SessionManager::Get('user_skin');
if (!empty($user_skin))
define('CURRENT_SKIN',$user_skin);
include CORE_PATH.DS.'bootstrap.inc.php'; // paste the above just before this line
Then, if you write www.yourairline.com/index.php?user_skin=crystal it will change the skin to crystal, or whatever you write there. Note that when the user just goes to the index.php, they get the default skin that you specified in the admin panel. You do not have to retain the ?user_skin= in the url: once it's set to the session, it will remain for the rest of the session!
How could this be useful?
1) if you are working on a new skin for your VA and you don't want others to see whats going on
2) if you created a new skin and want to give your pilots the opportunity to go back to the old one temporarily - maybe they discover some bugs for example
3) If you have multiple airlines on one site and you want a different design for each airline
4) For the very few who create their own skins and want to demonstrate them, all you need is a link to the new skin, and the whole page changes to that skin.
Hope you enjoy!