Changeset 579 for trunk/pages/webconfig.php
- Timestamp:
- Apr 30, 2009, 8:10:25 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/pages/webconfig.php
r405 r579 1 1 <?php 2 $html ->PrgStart();3 echo " <a href=\"?page=acc\"><- Zpět do správy účtu</a>";2 $html->PrgStart(); 3 echo(' <a href="?page=acc"><- Zpět do správy účtu</a>'); 4 4 5 if (isset($_POST["save"]))5 if(isset($_POST['save'])) 6 6 { 7 7 $year = 7 * 24 * 60 * 60; 8 setcookie("hof-random",$_POST["random"],time()+$year); 9 setcookie("hof-widget",$_POST["widget"],time()+$year); 10 setcookie("hof-quick",$_POST["quick"],time()+$year); 11 setcookie("hof-web",$_POST["web"],time()+$year); 12 $msg = "<center><b>Ukládám změny.</b></center><br /> 13 <meta http-equiv=\"refresh\" content=\"1;url=?page=webconfig\">"; 14 } 15 else 8 setcookie('hof-random', $_POST['random'], time() + $year); 9 setcookie('hof-widget', $_POST['widget'], time() + $year); 10 setcookie('hof-quick', $_POST['quick'], time() + $year); 11 setcookie('hof-web', $_POST['web'], time() + $year); 12 $msg = '<center><b>Ukládám změny.</b></center><br /> 13 <meta http-equiv="refresh" content="1;url=?page=webconfig">'; 14 } else 16 15 { 17 $msg = "";16 $msg = ''; 18 17 } 19 18 20 21 function Check ($value,$option) 19 function Check($value, $option) 22 20 { 23 if (!isset($_COOKIE["hof-".$value]) OR $_COOKIE["hof-".$value] == "")21 if(!isset($_COOKIE['hof-'.$value]) or $_COOKIE['hof-'.$value] == '') 24 22 { 25 23 $day_half = 129600; 26 // default 27 switch ($value) 28 { 29 case "random": 30 $default = "yes"; 31 break; 32 case "widget": 33 $default = "wowhead"; 34 break; 35 case "quick": 36 $default = "yes"; 37 break; 38 case "web": 39 $default = "2"; 40 break; 41 } 24 switch($value) 25 { 26 case 'random': 27 $default = 'yes'; 28 break; 29 case 'widget': 30 $default = 'wowhead'; 31 break; 32 case 'quick': 33 $default = 'yes'; 34 break; 35 case 'web': 36 $default = 2; 37 break; 38 } 42 39 $year = 7 * 24 * 60 * 60; 43 setcookie( "hof-".$value,$default,time()+$year);44 $msg = "<center><b>Nahrávám základní nastavení</b></center><br />45 <meta http-equiv= \"refresh\" content=\"1;url=?page=webconfig\">";40 setcookie('hof-'.$value, $default, time() + $year); 41 $msg = '<center><b>Nahrávám základní nastavení</b></center><br /> 42 <meta http-equiv="refresh" content="1;url=?page=webconfig">'; 46 43 } 47 if (isset($_COOKIE["hof-".$value]) AND $_COOKIE["hof-".$value] == $option)44 if(isset($_COOKIE['hof-'.$value]) and $_COOKIE['hof-'.$value] == $option) 48 45 { 49 return " checked=\"checked\" ";46 return('checked="checked" '); 50 47 } 51 48 } 52 echo " 53 <form method=\"post\"> 54 <div align=\"left\"> 49 echo('<form method="post"> 50 <div align="left"> 55 51 <b>Náhodný obrázek v hlavičce stránky.</b><br /> 56 Ano <input type= \"radio\" name=\"random\" value=\"yes\"".Check("random","yes").">57 Ne <input type= \"radio\" name=\"random\" value=\"no\"".Check("random","no").">52 Ano <input type="radio" name="random" value="yes"'.Check('random', 'yes').'> 53 Ne <input type="radio" name="random" value="no"'.Check('random','no').'> 58 54 <br /> 59 55 <b>Preferovaný tooltip</b><br /> 60 Wowhead <input type= \"radio\" name=\"widget\" value=\"wowhead\"".Check("widget","wowhead").">61 Thottbot <input type= \"radio\" name=\"widget\" value=\"thottbot\"".Check("widget","thottbot").">56 Wowhead <input type="radio" name="widget" value="wowhead"'.Check('widget', 'wowhead').'> 57 Thottbot <input type="radio" name="widget" value="thottbot"'.Check('widget', 'thottbot').'> 62 58 <br /> 63 59 <b>Rychlý přehled</b><br /> 64 Ano <input type= \"radio\" name=\"quick\" value=\"yes\"".Check("quick","yes").">65 Ne <input type= \"radio\" name=\"quick\" value=\"no\"".Check("quick","no").">60 Ano <input type="radio" name="quick" value="yes"'.Check('quick', 'yes').'> 61 Ne <input type="radio" name="quick" value="no"'.Check('quick', 'no').'> 66 62 <br /> 67 63 <b>Zobrazovat web</b><br /> 68 Web 1.0 (původní menu vlevo) <input type=\"radio\" name=\"web\" value=\"1\"".Check("web","1")."><br /> 69 Web 2.0 (nový menu vpravo) <input type=\"radio\" name=\"web\" value=\"2\"".Check("web","2")."> 64 Web 1.0 (původní menu vlevo) <input type="radio" name="web" value="1"'.Check('web', 1).'><br /> 65 Web 2.0 (nový menu vpravo) <input type="radio" name="web" value="2"'.Check('web', 2).'> 66 <br /> 67 <input type="submit" value="Uložit" name="save"> 68 </form>'.$msg.'</div>'); 70 69 70 $html->PrgStop(); 71 71 72 73 <br />74 <input type=\"submit\" value=\"Uložit\" name=\"save\">75 </form>76 77 ".$msg."78 </div>79 ";80 81 82 83 84 $html -> PrgStop();85 72 ?>
Note:
See TracChangeset
for help on using the changeset viewer.