annotate pages/compos.inc.php @ 1096:bbc0a3d0b51e

Major renaming / refactor of site messages. Some that were previously modifiable from admin interface are now "hardcoded" in the configuration file. Having these settings made modifiable from there made no sense and just took space in the UI.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 27 Jan 2017 22:15:06 +0200
parents 7e497188e4c6
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1075
7e497188e4c6 Use long tags.
Matti Hamalainen <ccr@tnsp.org>
parents: 1021
diff changeset
1 <?php
160
0980e705dea0 Add some copyright headers.
Matti Hamalainen <ccr@tnsp.org>
parents: 24
diff changeset
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
0980e705dea0 Add some copyright headers.
Matti Hamalainen <ccr@tnsp.org>
parents: 24
diff changeset
4 // Competitions page
1001
ffacd904fd1f Update copyrights.
Matti Hamalainen <ccr@tnsp.org>
parents: 663
diff changeset
5 // (C) Copyright 2012-2015 Tecnic Software productions (TNSP)
160
0980e705dea0 Add some copyright headers.
Matti Hamalainen <ccr@tnsp.org>
parents: 24
diff changeset
6 //
662
2e0b11277f2f Use more descriptive anchor IDs.
Matti Hamalainen <ccr@tnsp.org>
parents: 661
diff changeset
7 function stConvertNameToID($name)
2e0b11277f2f Use more descriptive anchor IDs.
Matti Hamalainen <ccr@tnsp.org>
parents: 661
diff changeset
8 {
2e0b11277f2f Use more descriptive anchor IDs.
Matti Hamalainen <ccr@tnsp.org>
parents: 661
diff changeset
9 return preg_replace("/[^a-z0-9_]/", "", strtolower($name));
2e0b11277f2f Use more descriptive anchor IDs.
Matti Hamalainen <ccr@tnsp.org>
parents: 661
diff changeset
10 }
2e0b11277f2f Use more descriptive anchor IDs.
Matti Hamalainen <ccr@tnsp.org>
parents: 661
diff changeset
11
2e0b11277f2f Use more descriptive anchor IDs.
Matti Hamalainen <ccr@tnsp.org>
parents: 661
diff changeset
12
587
135efe0c3b49 Add new options for hiding/showing compo and schedule pages.
Matti Hamalainen <ccr@tnsp.org>
parents: 571
diff changeset
13 if (stChkSetting("showCompos"))
193
1e4f530c8310 Add link list of compos.
Matti Hamalainen <ccr@tnsp.org>
parents: 160
diff changeset
14 {
661
f1016ed4b05b Add back to page top link for each compo description.
Matti Hamalainen <ccr@tnsp.org>
parents: 587
diff changeset
15 echo
663
7091b0c6c7c1 Change element names.
Matti Hamalainen <ccr@tnsp.org>
parents: 662
diff changeset
16 "<div id=\"top\"></div>\n".
1096
bbc0a3d0b51e Major renaming / refactor of site messages. Some that were previously
Matti Hamalainen <ccr@tnsp.org>
parents: 1075
diff changeset
17 stGetSetting("msgCompoDescription");
587
135efe0c3b49 Add new options for hiding/showing compo and schedule pages.
Matti Hamalainen <ccr@tnsp.org>
parents: 571
diff changeset
18
135efe0c3b49 Add new options for hiding/showing compo and schedule pages.
Matti Hamalainen <ccr@tnsp.org>
parents: 571
diff changeset
19 $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
20
135efe0c3b49 Add new options for hiding/showing compo and schedule pages.
Matti Hamalainen <ccr@tnsp.org>
parents: 571
diff changeset
21 if (($res = stExecSQL($sql)) !== FALSE)
193
1e4f530c8310 Add link list of compos.
Matti Hamalainen <ccr@tnsp.org>
parents: 160
diff changeset
22 {
587
135efe0c3b49 Add new options for hiding/showing compo and schedule pages.
Matti Hamalainen <ccr@tnsp.org>
parents: 571
diff changeset
23 $list = array();
135efe0c3b49 Add new options for hiding/showing compo and schedule pages.
Matti Hamalainen <ccr@tnsp.org>
parents: 571
diff changeset
24 foreach ($res as $item)
135efe0c3b49 Add new options for hiding/showing compo and schedule pages.
Matti Hamalainen <ccr@tnsp.org>
parents: 571
diff changeset
25 {
662
2e0b11277f2f Use more descriptive anchor IDs.
Matti Hamalainen <ccr@tnsp.org>
parents: 661
diff changeset
26 $list[] = "<a class=\"compo\" href=\"#".
2e0b11277f2f Use more descriptive anchor IDs.
Matti Hamalainen <ccr@tnsp.org>
parents: 661
diff changeset
27 stConvertNameToID($item["name"])."\">".
2e0b11277f2f Use more descriptive anchor IDs.
Matti Hamalainen <ccr@tnsp.org>
parents: 661
diff changeset
28 chentities($item["name"])."</a>";
587
135efe0c3b49 Add new options for hiding/showing compo and schedule pages.
Matti Hamalainen <ccr@tnsp.org>
parents: 571
diff changeset
29 }
1021
74b98743697b Work on layout, etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 1001
diff changeset
30 echo "<div class=\"componamelist\">".join($list, "<span class=\"composep\"> | </span>")."</div>\n\n";
193
1e4f530c8310 Add link list of compos.
Matti Hamalainen <ccr@tnsp.org>
parents: 160
diff changeset
31 }
1e4f530c8310 Add link list of compos.
Matti Hamalainen <ccr@tnsp.org>
parents: 160
diff changeset
32
1e4f530c8310 Add link list of compos.
Matti Hamalainen <ccr@tnsp.org>
parents: 160
diff changeset
33
587
135efe0c3b49 Add new options for hiding/showing compo and schedule pages.
Matti Hamalainen <ccr@tnsp.org>
parents: 571
diff changeset
34 $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
35
587
135efe0c3b49 Add new options for hiding/showing compo and schedule pages.
Matti Hamalainen <ccr@tnsp.org>
parents: 571
diff changeset
36 if (($res = stExecSQL($sql)) !== FALSE)
0
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
37 {
1021
74b98743697b Work on layout, etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 1001
diff changeset
38 echo "<div class=\"compolist\">\n";
587
135efe0c3b49 Add new options for hiding/showing compo and schedule pages.
Matti Hamalainen <ccr@tnsp.org>
parents: 571
diff changeset
39 foreach ($res as $item)
135efe0c3b49 Add new options for hiding/showing compo and schedule pages.
Matti Hamalainen <ccr@tnsp.org>
parents: 571
diff changeset
40 {
135efe0c3b49 Add new options for hiding/showing compo and schedule pages.
Matti Hamalainen <ccr@tnsp.org>
parents: 571
diff changeset
41 echo
1021
74b98743697b Work on layout, etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 1001
diff changeset
42 "<div class=\"compo\" id=\"".stConvertNameToID($item["name"])."\">\n".
587
135efe0c3b49 Add new options for hiding/showing compo and schedule pages.
Matti Hamalainen <ccr@tnsp.org>
parents: 571
diff changeset
43 "<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
44 stConvertCommonDesc($item["description"], FALSE).
663
7091b0c6c7c1 Change element names.
Matti Hamalainen <ccr@tnsp.org>
parents: 662
diff changeset
45 "<div class=\"backToTop\"><a href=\"#top\">Back</a></div>\n".
587
135efe0c3b49 Add new options for hiding/showing compo and schedule pages.
Matti Hamalainen <ccr@tnsp.org>
parents: 571
diff changeset
46 "</div>\n";
135efe0c3b49 Add new options for hiding/showing compo and schedule pages.
Matti Hamalainen <ccr@tnsp.org>
parents: 571
diff changeset
47 }
1021
74b98743697b Work on layout, etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 1001
diff changeset
48 echo "</div>\n";
0
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
49 }
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
50 }
8019b357cc03 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
51 ?>