Mercurial > hg > fapweb
annotate index.php @ 8:4c5f651aa107
Migrate certain settings to SQL database, cleanups, etc.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 06 Dec 2012 13:30:46 +0200 |
parents | 76c3b89d7b11 |
children | e36c4d2b09c4 |
rev | line source |
---|---|
0 | 1 <?php |
2 require "mconfig.inc.php"; | |
3 require "msite.inc.php"; | |
4 require "mcommon.inc.php"; | |
5 | |
8
4c5f651aa107
Migrate certain settings to SQL database, cleanups, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
5
diff
changeset
|
6 |
0 | 7 // Switch to https first, if needed |
8 if (!stCheckHTTPS()) | |
9 { | |
10 header("Location: https://".$_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]); | |
11 exit; | |
12 } | |
13 | |
8
4c5f651aa107
Migrate certain settings to SQL database, cleanups, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
5
diff
changeset
|
14 // Check for cache-controlled pages |
0 | 15 if (isset($_SERVER["REQUEST_URI"]) && |
16 array_key_exists($_SERVER["REQUEST_URI"], $securePages)) | |
5
76c3b89d7b11
Improve voting, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
4
diff
changeset
|
17 stSetupCacheControl(); |
0 | 18 |
8
4c5f651aa107
Migrate certain settings to SQL database, cleanups, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
5
diff
changeset
|
19 // Start output |
0 | 20 printPageHeader($pageTitle, |
21 " <meta http-equiv=\"Pragma\" content=\"no-cache\" />"); | |
22 | |
8
4c5f651aa107
Migrate certain settings to SQL database, cleanups, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
5
diff
changeset
|
23 // Initiate SQL database connection |
0 | 24 if (!stConnectSQLDB()) |
25 { | |
26 printPageFooter(); | |
27 exit; | |
28 } | |
29 | |
8
4c5f651aa107
Migrate certain settings to SQL database, cleanups, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
5
diff
changeset
|
30 // Fetch non-"hardcoded" settings from SQL database |
4c5f651aa107
Migrate certain settings to SQL database, cleanups, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
5
diff
changeset
|
31 stReloadSettings(); |
4c5f651aa107
Migrate certain settings to SQL database, cleanups, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
5
diff
changeset
|
32 |
0 | 33 ?> |
34 <div id="headerbox"> | |
35 <div id="header"> | |
36 <a href="news"><img src="img/fapsm.png" alt="Finnish Amiga Party 2012" class="logo" /></a> | |
37 <div id="date">30.11. - 2.12.2012<br />Helsinki, Finland<br />@ old location<br />Entry 15 EUR + prod</div> | |
38 </div> | |
39 <div id="menu"> | |
40 <a href="news">News</a> | |
41 <a href="compos">Compos</a> | |
42 <a href="event">Event</a> | |
43 <? | |
8
4c5f651aa107
Migrate certain settings to SQL database, cleanups, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
5
diff
changeset
|
44 if (stGetSetting("showAttendees", FALSE)) |
4c5f651aa107
Migrate certain settings to SQL database, cleanups, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
5
diff
changeset
|
45 echo " <a href=\"attendees\">Attendees</a>\n"; |
4c5f651aa107
Migrate certain settings to SQL database, cleanups, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
5
diff
changeset
|
46 |
2
50216ed31d78
Add voting button link, if enabled.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
47 if (stGetSetting("allowVoting", FALSE)) |
0 | 48 echo " <a href=\"vote\">Vote</a>\n"; |
3
916623924bd5
More work on the party management and voting system.
Matti Hamalainen <ccr@tnsp.org>
parents:
2
diff
changeset
|
49 |
916623924bd5
More work on the party management and voting system.
Matti Hamalainen <ccr@tnsp.org>
parents:
2
diff
changeset
|
50 if (stGetSetting("showResults", FALSE)) |
916623924bd5
More work on the party management and voting system.
Matti Hamalainen <ccr@tnsp.org>
parents:
2
diff
changeset
|
51 echo " <a href=\"results\">Results</a>\n"; |
4 | 52 |
53 echo " <a href=\"admin\">Admin</a>\n"; | |
0 | 54 ?> |
55 </div> | |
56 </div> | |
57 | |
58 <div id="maincontent"> | |
59 <div> | |
60 <? | |
61 $pageName = isset($_GET["p"]) ? $_GET["p"] : "news"; | |
62 $pageFilename = basename($pageName).".inc.php"; | |
63 if (file_exists($pageFilename)) | |
64 include($pageFilename); | |
65 ?> | |
66 </div> | |
67 </div> | |
68 <? | |
69 printPageFooter(); | |
70 ?> |