Where pilots and airlines come together

The virtual airline blog

This is our blog with lots of useful tips about PHPvms and running VA's in general. We've just started but we got a lot in the pipeline, so keep an eye on this space!
Note that not all blog posts are public, so if you're not a member, sign up now to get the best out of this site. If you have any questions, don't hesitate to contact us.

Allow visitor to change skin

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!


Warning: Unknown: open(/var/cpanel/php/sessions/ea-php56/sess_5to0pgugedqdoftunoi5q23477, O_RDWR) failed: No such file or directory (2) in Unknown on line 0

Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/cpanel/php/sessions/ea-php56) in Unknown on line 0