make skin selection cookie persistent

This commit is contained in:
m-bene 2014-05-01 09:37:39 +02:00
parent 8da9383d5d
commit ed7ca66045
4 changed files with 8 additions and 3 deletions

View File

@ -114,6 +114,11 @@ define( "SCALE_BASE", 100 ); // The additional scalin
define( "STRF_FMT_DATETIME_DB", "%Y-%m-%d %H:%M:%S" ); // Strftime format for database queries, don't change
define( "MYSQL_FMT_DATETIME_SHORT", "%y/%m/%d %H:%i:%S" ); // MySQL date_format shorter format for dates with time
//
// zmSkin Cookie validity
//
define ( "ZMSKIN_COOKIE_EXPIRES", 2147483647 );
require_once( 'database.php' );
loadConfig();

View File

@ -79,7 +79,7 @@ session_start();
if ( !isset($_SESSION['skin']) || isset($_REQUEST['skin']) )
{
$_SESSION['skin'] = $skin;
setcookie( "zmSkin", $skin );
setcookie( "zmSkin", $skin, ZMSKIN_COOKIE_EXPIRES );
}
require_once( 'includes/config.php' );

View File

@ -85,7 +85,7 @@ foreach ( $tabs as $name=>$value )
if($tab == 'skins') {
$current_skin = $_COOKIE['zmSkin'];
if (isset($_GET['skin-choice'])) {
setcookie('zmSkin',$_GET['skin-choice']);
setcookie('zmSkin',$_GET['skin-choice'], ZMSKIN_COOKIE_EXPIRES );
//header("Location: index.php?view=options&tab=skins&reset_parent=1");
echo "<script type=\"text/javascript\">window.opener.location.reload();window.location.href=\"{$_SERVER['PHP_SELF']}?view={$view}&tab={$tab}\"</script>";
}

View File

@ -85,7 +85,7 @@ foreach ( $tabs as $name=>$value )
if($tab == 'skins') {
$current_skin = $_COOKIE['zmSkin'];
if (isset($_GET['skin-choice'])) {
setcookie('zmSkin',$_GET['skin-choice']);
setcookie('zmSkin',$_GET['skin-choice'], ZMSKIN_COOKIE_EXPIRES );
//header("Location: index.php?view=options&tab=skins&reset_parent=1");
echo "<script type=\"text/javascript\">window.opener.location.reload();window.location.href=\"{$_SERVER['PHP_SELF']}?view={$view}&tab={$tab}\"</script>";
}