Mercurial > hg > fapweb
annotate pages/compos.inc.php @ 587:135efe0c3b49
Add new options for hiding/showing compo and schedule pages.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Fri, 17 Oct 2014 02:50:26 +0300 |
parents | ce11ea112a65 |
children | f1016ed4b05b |
rev | line source |
---|---|
14
e36c4d2b09c4
Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
1 <? |
160 | 2 // |
571
ce11ea112a65
Change the header blurb a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
565
diff
changeset
|
3 // FAPWeb - Simple Web-based Demoparty Management System |
160 | 4 // Competitions page |
565 | 5 // (C) Copyright 2012-2014 Tecnic Software productions (TNSP) |
160 | 6 // |
587
135efe0c3b49
Add new options for hiding/showing compo and schedule pages.
Matti Hamalainen <ccr@tnsp.org>
parents:
571
diff
changeset
|
7 if (stChkSetting("showCompos")) |
193 | 8 { |
587
135efe0c3b49
Add new options for hiding/showing compo and schedule pages.
Matti Hamalainen <ccr@tnsp.org>
parents:
571
diff
changeset
|
9 echo stGetSetting("compoDescription"); |
135efe0c3b49
Add new options for hiding/showing compo and schedule pages.
Matti Hamalainen <ccr@tnsp.org>
parents:
571
diff
changeset
|
10 |
135efe0c3b49
Add new options for hiding/showing compo and schedule pages.
Matti Hamalainen <ccr@tnsp.org>
parents:
571
diff
changeset
|
11 $sql = "SELECT id,name FROM compos WHERE visible<>0 ORDER BY id ASC"; |
135efe0c3b49
Add new options for hiding/showing compo and schedule pages.
Matti Hamalainen <ccr@tnsp.org>
parents:
571
diff
changeset
|
12 |
135efe0c3b49
Add new options for hiding/showing compo and schedule pages.
Matti Hamalainen <ccr@tnsp.org>
parents:
571
diff
changeset
|
13 if (($res = stExecSQL($sql)) !== FALSE) |
193 | 14 { |
587
135efe0c3b49
Add new options for hiding/showing compo and schedule pages.
Matti Hamalainen <ccr@tnsp.org>
parents:
571
diff
changeset
|
15 $list = array(); |
135efe0c3b49
Add new options for hiding/showing compo and schedule pages.
Matti Hamalainen <ccr@tnsp.org>
parents:
571
diff
changeset
|
16 foreach ($res as $item) |
135efe0c3b49
Add new options for hiding/showing compo and schedule pages.
Matti Hamalainen <ccr@tnsp.org>
parents:
571
diff
changeset
|
17 { |
135efe0c3b49
Add new options for hiding/showing compo and schedule pages.
Matti Hamalainen <ccr@tnsp.org>
parents:
571
diff
changeset
|
18 $list[] = "<a class=\"compo\" href=\"#compo".$item["id"]."\">".chentities($item["name"])."</a>"; |
135efe0c3b49
Add new options for hiding/showing compo and schedule pages.
Matti Hamalainen <ccr@tnsp.org>
parents:
571
diff
changeset
|
19 } |
135efe0c3b49
Add new options for hiding/showing compo and schedule pages.
Matti Hamalainen <ccr@tnsp.org>
parents:
571
diff
changeset
|
20 echo "<div class=\"compolist\">".join($list, "<span class=\"composep\"> | </span>")."</div>"; |
193 | 21 } |
22 | |
23 | |
587
135efe0c3b49
Add new options for hiding/showing compo and schedule pages.
Matti Hamalainen <ccr@tnsp.org>
parents:
571
diff
changeset
|
24 $sql = "SELECT * FROM compos WHERE visible<>0 ORDER BY id ASC"; |
8
4c5f651aa107
Migrate certain settings to SQL database, cleanups, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
25 |
587
135efe0c3b49
Add new options for hiding/showing compo and schedule pages.
Matti Hamalainen <ccr@tnsp.org>
parents:
571
diff
changeset
|
26 if (($res = stExecSQL($sql)) !== FALSE) |
0 | 27 { |
587
135efe0c3b49
Add new options for hiding/showing compo and schedule pages.
Matti Hamalainen <ccr@tnsp.org>
parents:
571
diff
changeset
|
28 foreach ($res as $item) |
135efe0c3b49
Add new options for hiding/showing compo and schedule pages.
Matti Hamalainen <ccr@tnsp.org>
parents:
571
diff
changeset
|
29 { |
135efe0c3b49
Add new options for hiding/showing compo and schedule pages.
Matti Hamalainen <ccr@tnsp.org>
parents:
571
diff
changeset
|
30 echo |
135efe0c3b49
Add new options for hiding/showing compo and schedule pages.
Matti Hamalainen <ccr@tnsp.org>
parents:
571
diff
changeset
|
31 "<div id=\"compo".$item["id"]."\">\n". |
135efe0c3b49
Add new options for hiding/showing compo and schedule pages.
Matti Hamalainen <ccr@tnsp.org>
parents:
571
diff
changeset
|
32 "<h2>".chentities($item["name"])."</h2>\n". |
135efe0c3b49
Add new options for hiding/showing compo and schedule pages.
Matti Hamalainen <ccr@tnsp.org>
parents:
571
diff
changeset
|
33 stConvertCommonDesc($item["description"], FALSE). |
135efe0c3b49
Add new options for hiding/showing compo and schedule pages.
Matti Hamalainen <ccr@tnsp.org>
parents:
571
diff
changeset
|
34 "</div>\n"; |
135efe0c3b49
Add new options for hiding/showing compo and schedule pages.
Matti Hamalainen <ccr@tnsp.org>
parents:
571
diff
changeset
|
35 } |
0 | 36 } |
37 } | |
38 ?> |