Mercurial > hg > fapweb
annotate index.php @ 232:aad9ededea6c
Reorder some meta tags.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 19 Nov 2013 22:48:07 +0200 |
parents | b6c8aa562069 |
children | 734781881e47 |
rev | line source |
---|---|
136
aeebfedb5709
Add some copyright headers.
Matti Hamalainen <ccr@tnsp.org>
parents:
131
diff
changeset
|
1 <? |
aeebfedb5709
Add some copyright headers.
Matti Hamalainen <ccr@tnsp.org>
parents:
131
diff
changeset
|
2 // |
aeebfedb5709
Add some copyright headers.
Matti Hamalainen <ccr@tnsp.org>
parents:
131
diff
changeset
|
3 // FAPWeb Simple Demoparty System |
aeebfedb5709
Add some copyright headers.
Matti Hamalainen <ccr@tnsp.org>
parents:
131
diff
changeset
|
4 // Main HTML page wrapper |
aeebfedb5709
Add some copyright headers.
Matti Hamalainen <ccr@tnsp.org>
parents:
131
diff
changeset
|
5 // (C) Copyright 2012-2013 Tecnic Software productions (TNSP) |
aeebfedb5709
Add some copyright headers.
Matti Hamalainen <ccr@tnsp.org>
parents:
131
diff
changeset
|
6 // |
175
8df523e6326a
User require_once instead of require.
Matti Hamalainen <ccr@tnsp.org>
parents:
174
diff
changeset
|
7 require_once "mconfig.inc.php"; |
8df523e6326a
User require_once instead of require.
Matti Hamalainen <ccr@tnsp.org>
parents:
174
diff
changeset
|
8 require_once "msite.inc.php"; |
8df523e6326a
User require_once instead of require.
Matti Hamalainen <ccr@tnsp.org>
parents:
174
diff
changeset
|
9 require_once "msession.inc.php"; |
0 | 10 |
174
63c840590476
Move common code from mcommon.inc.php to msitegen module.
Matti Hamalainen <ccr@tnsp.org>
parents:
171
diff
changeset
|
11 cmLocaleInit(); |
8
4c5f651aa107
Migrate certain settings to SQL database, cleanups, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
5
diff
changeset
|
12 |
0 | 13 // Switch to https first, if needed |
39 | 14 if (!stCheckHTTPS() && isset($_SERVER["REQUEST_URI"]) && |
15 array_key_exists($_SERVER["REQUEST_URI"], $securePages)) | |
0 | 16 { |
17 header("Location: https://".$_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]); | |
18 exit; | |
19 } | |
20 | |
39 | 21 |
8
4c5f651aa107
Migrate certain settings to SQL database, cleanups, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
5
diff
changeset
|
22 // Check for cache-controlled pages |
0 | 23 if (isset($_SERVER["REQUEST_URI"]) && |
24 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
|
25 stSetupCacheControl(); |
0 | 26 |
8
4c5f651aa107
Migrate certain settings to SQL database, cleanups, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
5
diff
changeset
|
27 // Start output |
34
8ecf7c04a837
Update to match with common web code API.
Matti Hamalainen <ccr@tnsp.org>
parents:
33
diff
changeset
|
28 cmPrintPageHeader($pageTitle, |
232 | 29 " <meta http-equiv=\"Pragma\" content=\"no-cache\" />\n". |
30 " <meta name=\"viewport\" content=\"width=device-width\" />\n"); | |
0 | 31 |
8
4c5f651aa107
Migrate certain settings to SQL database, cleanups, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
5
diff
changeset
|
32 // Initiate SQL database connection |
0 | 33 if (!stConnectSQLDB()) |
34 { | |
39 | 35 // Error occured, bail out early |
34
8ecf7c04a837
Update to match with common web code API.
Matti Hamalainen <ccr@tnsp.org>
parents:
33
diff
changeset
|
36 cmPrintPageFooter(); |
0 | 37 exit; |
38 } | |
39 | |
8
4c5f651aa107
Migrate certain settings to SQL database, cleanups, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
5
diff
changeset
|
40 // 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
|
41 stReloadSettings(); |
4c5f651aa107
Migrate certain settings to SQL database, cleanups, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
5
diff
changeset
|
42 |
0 | 43 ?> |
40 | 44 <div id="header"> |
14
e36c4d2b09c4
Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
45 <? echo stGetSetting("siteInfoText") ?> |
40 | 46 </div> |
47 | |
48 <div id="menu"> | |
43 | 49 <? echo stGetSetting("siteMenuHeader") ?> |
104 | 50 |
123
5837b9333964
Add new "about" page, and setting for default page.
Matti Hamalainen <ccr@tnsp.org>
parents:
106
diff
changeset
|
51 <a href="about">About</a> |
5837b9333964
Add new "about" page, and setting for default page.
Matti Hamalainen <ccr@tnsp.org>
parents:
106
diff
changeset
|
52 <? |
5837b9333964
Add new "about" page, and setting for default page.
Matti Hamalainen <ccr@tnsp.org>
parents:
106
diff
changeset
|
53 if (stGetSetting("showNews")) |
5837b9333964
Add new "about" page, and setting for default page.
Matti Hamalainen <ccr@tnsp.org>
parents:
106
diff
changeset
|
54 echo "<a href=\"news\">News</a>\n"; |
5837b9333964
Add new "about" page, and setting for default page.
Matti Hamalainen <ccr@tnsp.org>
parents:
106
diff
changeset
|
55 ?> |
0 | 56 <a href="compos">Compos</a> |
131
ed05cc69e1c2
The event page was renamed to schedule.
Matti Hamalainen <ccr@tnsp.org>
parents:
123
diff
changeset
|
57 <a href="schedule">Schedule</a> |
0 | 58 <? |
78 | 59 $visibility = stAdmSessionAuth(TRUE); |
60
4e09327ed4d0
Show certain menu options always if we are inside an admin session.
Matti Hamalainen <ccr@tnsp.org>
parents:
51
diff
changeset
|
60 |
17 | 61 if (stGetSetting("showAttendees")) |
8
4c5f651aa107
Migrate certain settings to SQL database, cleanups, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
5
diff
changeset
|
62 echo " <a href=\"attendees\">Attendees</a>\n"; |
103
c6b9041078ec
Add hard limit option for attendees, and add feature of using "0" to disable
Matti Hamalainen <ccr@tnsp.org>
parents:
78
diff
changeset
|
63 else |
c6b9041078ec
Add hard limit option for attendees, and add feature of using "0" to disable
Matti Hamalainen <ccr@tnsp.org>
parents:
78
diff
changeset
|
64 if (stChkSetting("allowRegister")) |
c6b9041078ec
Add hard limit option for attendees, and add feature of using "0" to disable
Matti Hamalainen <ccr@tnsp.org>
parents:
78
diff
changeset
|
65 echo " <a href=\"register\">Register</a>\n"; |
8
4c5f651aa107
Migrate certain settings to SQL database, cleanups, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
5
diff
changeset
|
66 |
17 | 67 if (stGetSetting("allowVoting")) |
0 | 68 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
|
69 |
60
4e09327ed4d0
Show certain menu options always if we are inside an admin session.
Matti Hamalainen <ccr@tnsp.org>
parents:
51
diff
changeset
|
70 if ($visibility || stGetSetting("showResults")) |
3
916623924bd5
More work on the party management and voting system.
Matti Hamalainen <ccr@tnsp.org>
parents:
2
diff
changeset
|
71 echo " <a href=\"results\">Results</a>\n"; |
4 | 72 |
60
4e09327ed4d0
Show certain menu options always if we are inside an admin session.
Matti Hamalainen <ccr@tnsp.org>
parents:
51
diff
changeset
|
73 if ($visibility || stGetSetting("showAdmin")) |
171
705dabdc37d4
Move administration interface page to separate layout, to make things less cramped.
Matti Hamalainen <ccr@tnsp.org>
parents:
157
diff
changeset
|
74 echo " <a href=\"admin.php\">Admin</a>\n"; |
0 | 75 ?> |
47 | 76 <? echo stGetSetting("siteMenuFooter") ?> |
0 | 77 </div> |
78 | |
149 | 79 <? |
80 echo stGetSetting("siteExtraHTML"); | |
106
324f3a415237
Add extra HTML + sponsors box to layout.
Matti Hamalainen <ccr@tnsp.org>
parents:
104
diff
changeset
|
81 |
149 | 82 // Get the name of the page |
157
5136563c1f04
Oops, use defaultPage here, too.
Matti Hamalainen <ccr@tnsp.org>
parents:
149
diff
changeset
|
83 $pageName = isset($_GET["p"]) ? $_GET["p"] : stGetSetting("defaultPage"); |
44 | 84 $pageBasename = basename($pageName); |
85 $pageFilename = $pageBasename.".inc.php"; | |
149 | 86 |
87 // Default to set default page if selected page does not exist | |
88 if (!file_exists($pageBasename.".inc.php")) | |
89 $pageBasename = stGetSetting("defaultPage"); | |
90 | |
91 | |
92 echo "<div id=\"infobox\">".strtoupper($pageBasename)."</div>\n"; | |
44 | 93 ?> |
201
a4be19c4d99d
Modularize admin pages tab system.
Matti Hamalainen <ccr@tnsp.org>
parents:
175
diff
changeset
|
94 <div id="mainContent"> |
0 | 95 <div> |
96 <? | |
149 | 97 if (file_exists($pageBasename.".inc.php")) |
98 include($pageBasename.".inc.php"); | |
0 | 99 ?> |
100 </div> | |
101 </div> | |
102 <? | |
34
8ecf7c04a837
Update to match with common web code API.
Matti Hamalainen <ccr@tnsp.org>
parents:
33
diff
changeset
|
103 cmPrintPageFooter(); |
0 | 104 ?> |