source: beta/pages/webconfig.php@ 405

Last change on this file since 405 was 405, checked in by zork, 16 years ago
File size: 2.4 KB
Line 
1<?php
2$html -> PrgStart();
3echo "&nbsp;<a href=\"?page=acc\">&lt;- Zpět do správy účtu</a>";
4
5if (isset($_POST["save"]))
6{
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}
15else
16{
17 $msg = "";
18}
19
20
21function Check ($value,$option)
22{
23 if (!isset($_COOKIE["hof-".$value]) OR $_COOKIE["hof-".$value] == "")
24 {
25 $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 }
42 $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\">";
46 }
47 if (isset($_COOKIE["hof-".$value]) AND $_COOKIE["hof-".$value] == $option)
48 {
49 return " checked=\"checked\" ";
50 }
51}
52echo "
53<form method=\"post\">
54<div align=\"left\">
55 <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").">
58 <br />
59 <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").">
62 <br />
63 <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").">
66 <br />
67 <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").">
70
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?>
Note: See TracBrowser for help on using the repository browser.