X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=install%2Fcookbook%2Fskinchange.php;fp=install%2Fcookbook%2Fskinchange.php;h=86a281dd20634ddfb32ac3b9a6cb414dc205aa5f;hb=b1b3c24c28967c7218074ee4bba7d387d5181d20;hp=0000000000000000000000000000000000000000;hpb=f7ca53e1a41a81555b2b38cdff0d7f4f29c67e6d;p=wikifarm.git diff --git a/install/cookbook/skinchange.php b/install/cookbook/skinchange.php new file mode 100644 index 0000000..86a281d --- /dev/null +++ b/install/cookbook/skinchange.php @@ -0,0 +1,38 @@ + 'pmwiki', + 'myskin' => 'myskin', + 'classic' => 'myclassicskin'); + + If a URL requests a skin that isn't in this array, then PmWiki + defaults to the skin already defined by $Skin. + + By default, the setskin cookie that is created will expire after + one year. You can set it to expire at the end of the browser + session by setting $SkinCookieExpires=0; +*/ + +SDV($SkinCookie, $CookiePrefix.'setskin'); +SDV($SkinCookieExpires, $Now+60*60*24*365); + +if (isset($_COOKIE[$SkinCookie])) $sk = $_COOKIE[$SkinCookie]; +if (isset($_GET['setskin'])) { + $sk = $_GET['setskin']; + setcookie($SkinCookie, $sk, $SkinCookieExpires, '/'); +} +if (isset($_GET['skin'])) $sk = $_GET['skin']; +if (@$PageSkinList[$sk]) $Skin = $PageSkinList[$sk];