svn: /web/php/trunk/ include/prepend.inc my.php

From: Date: Sun, 26 Dec 2010 16:06:23 +0000
Subject: svn: /web/php/trunk/ include/prepend.inc my.php
Groups: php.webmaster 
Request: Send a blank email to php-webmaster+get-9822@lists.php.net to get a copy of this message
bjori Sun, 26 Dec 2010 16:06:23 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=306685 Log: Add beta feature Changed paths: U web/php/trunk/include/prepend.inc U web/php/trunk/my.php Modified: web/php/trunk/include/prepend.inc =================================================================== --- web/php/trunk/include/prepend.inc 2010-12-26 14:41:40 UTC (rev 306684) +++ web/php/trunk/include/prepend.inc 2010-12-26 16:06:23 UTC (rev 306685) @@ -69,7 +69,7 @@ global $MYPHPNET; // Empty the preferences array - $MYPHPNET = array(FALSE, FALSE, "NONE", 0); + $MYPHPNET = array(FALSE, FALSE, "NONE", 0, FALSE); // If we have a cookie, set the values in the array if (!empty($_COOKIE['MYPHPNET'])) { @@ -158,3 +158,19 @@ // 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; +} +function myphpnet_beta() { + global $MYPHPNET; + + if (isset($MYPHPNET[4])) { + return $MYPHPNET[4]; + } + + return false; +} + Modified: web/php/trunk/my.php =================================================================== --- web/php/trunk/my.php 2010-12-26 14:41:40 UTC (rev 306684) +++ web/php/trunk/my.php 2010-12-26 16:06:23 UTC (rev 306685) @@ -67,6 +67,10 @@ myphpnet_hidesuggest($_POST['hidesuggest']); } +if (isset($_POST['beta'])) { + myphpnet_setbeta($_POST['beta']); +} + myphpnet_save(); site_header("My PHP.net"); @@ -269,6 +273,21 @@ </select> </div> + +<h2>PHP.net beta</h2> + +<p> + php.net is undergoing plastic surgery these days. If you want to see + how the site may look in the feature, you can join our beta program. +</p> + +<div class="indent"> + <select name="beta"> + <option value="0" <?php echo myphpnet_beta() ? "" : "selected" ?>>Disable</option> + <option value="1" <?php echo myphpnet_beta() ? "selected" : "" ?>>Enable</option> + </select> +</div> + <p class="center"> <input type="submit" value="Set All Preferences" /> </p>

« previous php.webmaster (#9822) next »