mirror of
https://github.com/php/web-php.git
synced 2026-03-23 23:02:13 +01:00
[beta site] implementing betasite=1 or betasite=0 parameter. this keeps the banners setting working like the myphpnet_beta setting to give a consistent user experience without the need for beta=0 or beta=1.
This commit is contained in:
@@ -83,6 +83,15 @@ if (isset($shortname) && $shortname) {
|
||||
</head>
|
||||
<body class="<?php print $curr; ?> <?php echo $classes; ?>">
|
||||
|
||||
<div id="head-beta-warning">
|
||||
<div id="beta-warning">
|
||||
<a href="#" id="beta-warning-close">X</a>
|
||||
<span class="blurb">
|
||||
Welcome to the php.net beta site. If you want to revert back, <a href="?setbeta=0">click here</a>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<nav id="headnav">
|
||||
|
||||
<ul id="headmenu">
|
||||
|
||||
@@ -63,6 +63,16 @@ include $_SERVER['DOCUMENT_ROOT'] . '/include/last_updated.inc';
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
// SETBETA Setting for temporary banners
|
||||
if(isset($_GET['setbeta']) && !headers_sent()) {
|
||||
global $MYSITE;
|
||||
myphpnet_setbeta( (bool) $_GET['setbeta']);
|
||||
myphpnet_save();
|
||||
header("Location: " . $MYSITE);
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
// Load in the user preferences
|
||||
function myphpnet_load()
|
||||
{
|
||||
@@ -166,12 +176,22 @@ function myphpnet_save()
|
||||
|
||||
// Set all the preferred values for a year
|
||||
mirror_setcookie("MYPHPNET", join(",", $MYPHPNET), 60*60*24*365);
|
||||
|
||||
}
|
||||
|
||||
function myphpnet_setbeta($bool = false) {
|
||||
global $MYPHPNET;
|
||||
|
||||
$MYPHPNET[4] = (bool)$bool;
|
||||
$bool = (bool) $bool;
|
||||
|
||||
// Session check, this is set when the users are clicking the temporary banners
|
||||
if(!isset($_SESSION)) {
|
||||
session_start();
|
||||
}
|
||||
|
||||
$_SESSION['beta_enabled'] = $bool;
|
||||
|
||||
$MYPHPNET[4] = (bool) $bool;
|
||||
}
|
||||
function myphpnet_beta() {
|
||||
global $MYPHPNET;
|
||||
@@ -185,6 +205,15 @@ function myphpnet_beta() {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Session check, this is set when the users are clicking the temporary banners
|
||||
if(!isset($_SESSION)) {
|
||||
session_start();
|
||||
}
|
||||
|
||||
if(isset($_SESSION['beta_enabled'])) {
|
||||
return $_SESSION['beta_enabled'];
|
||||
}
|
||||
|
||||
if (isset($MYPHPNET[4])) {
|
||||
return (bool)$MYPHPNET[4];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user