Mercurial > hg > fapweb
changeset 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 | 83dee3e7c36f |
children | e533955fa055 |
files | dbdefs.inc.php index.php pages/compos.inc.php pages/schedule.inc.php |
diffstat | 4 files changed, 33 insertions(+), 25 deletions(-) [+] |
line wrap: on
line diff
--- a/dbdefs.inc.php Fri Oct 17 02:49:58 2014 +0300 +++ b/dbdefs.inc.php Fri Oct 17 02:50:26 2014 +0300 @@ -1,6 +1,6 @@ <? -$dbVersion = 12; +$dbVersion = 13; // // Site settings and defaults we put in @@ -22,8 +22,10 @@ "requireEMail" => array(VT_BOOL, false, "Require e-mail address in registrations"), - "showNews" => array(VT_BOOL, true, "Enable News link on main menu"), + "showNews" => array(VT_BOOL, true, "Enable News link on main menu + News page"), "showNewsOnAbout" => array(VT_BOOL, true, "Show latest news item on About page"), + "showSchedule" => array(VT_BOOL, true, "Enable Schedule link on main menu + Schedule page"), + "showCompos" => array(VT_BOOL, true, "Enable Compos link on main menu + Compos page"), "registerInfoText" => array(VT_TEXT, "<p> Only your <b>handle</b> and the answer to the botcheck are strictly required.
--- a/index.php Fri Oct 17 02:49:58 2014 +0300 +++ b/index.php Fri Oct 17 02:50:26 2014 +0300 @@ -62,11 +62,11 @@ " ".stGetSetting("siteMenuHeader")."\n". stGetMainPageLink("about", "About"). stGetMainPageLink("news", "News", stGetSetting("showNews")). - stGetMainPageLink("compos", "Compos"). - stGetMainPageLink("schedule", "Schedule"); + stGetMainPageLink("compos", "Compos", stGetSetting("showCompos")). + stGetMainPageLink("schedule", "Schedule", stGetSetting("showSchedule")); if (stGetSetting("showAttendees")) - echo stGetMainPageLink("attendees", "Attendees"); + echo stGetMainPageLink("visitors", "Visitors"); else if (stChkSetting("allowRegister")) echo stGetMainPageLink("register", "Register");
--- a/pages/compos.inc.php Fri Oct 17 02:49:58 2014 +0300 +++ b/pages/compos.inc.php Fri Oct 17 02:50:26 2014 +0300 @@ -4,32 +4,35 @@ // Competitions page // (C) Copyright 2012-2014 Tecnic Software productions (TNSP) // -echo stGetSetting("compoDescription"); - -$sql = "SELECT id,name FROM compos WHERE visible<>0 ORDER BY id ASC"; - -if (($res = stExecSQL($sql)) !== FALSE) +if (stChkSetting("showCompos")) { - $list = array(); - foreach ($res as $item) + echo stGetSetting("compoDescription"); + + $sql = "SELECT id,name FROM compos WHERE visible<>0 ORDER BY id ASC"; + + if (($res = stExecSQL($sql)) !== FALSE) { - $list[] = "<a href=\"#compo".$item["id"]."\">".chentities($item["name"])."</a>"; + $list = array(); + foreach ($res as $item) + { + $list[] = "<a class=\"compo\" href=\"#compo".$item["id"]."\">".chentities($item["name"])."</a>"; + } + echo "<div class=\"compolist\">".join($list, "<span class=\"composep\"> | </span>")."</div>"; } - echo "<p class=\"compolist\">".join($list, " | ")."</p>"; -} -$sql = "SELECT * FROM compos WHERE visible<>0 ORDER BY id ASC"; + $sql = "SELECT * FROM compos WHERE visible<>0 ORDER BY id ASC"; -if (($res = stExecSQL($sql)) !== FALSE) -{ - foreach ($res as $item) + if (($res = stExecSQL($sql)) !== FALSE) { - echo - "<div id=\"compo".$item["id"]."\">\n". - "<h2>".chentities($item["name"])."</h2>\n". - stConvertCommonDesc($item["description"], FALSE). - "</div>\n"; + foreach ($res as $item) + { + echo + "<div id=\"compo".$item["id"]."\">\n". + "<h2>".chentities($item["name"])."</h2>\n". + stConvertCommonDesc($item["description"], FALSE). + "</div>\n"; + } } } ?>
--- a/pages/schedule.inc.php Fri Oct 17 02:49:58 2014 +0300 +++ b/pages/schedule.inc.php Fri Oct 17 02:50:26 2014 +0300 @@ -4,5 +4,8 @@ // Event schedule / description // (C) Copyright 2012-2014 Tecnic Software productions (TNSP) // -echo stGetSetting("eventDescription"); +if (stChkSetting("showSchedule")) +{ + echo stGetSetting("eventDescription"); +} ?>