comparison showajax.php @ 1104:0a2117349f46

s/true/TRUE/g; s/false/FALSE/g;
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 14 May 2019 14:45:36 +0300
parents 7da8bde9b7be
children b2bca5f6d0ff
comparison
equal deleted inserted replaced
1103:1fe7df7c77fb 1104:0a2117349f46
6 // 6 //
7 require_once "mconfig.inc.php"; 7 require_once "mconfig.inc.php";
8 require_once "msite.inc.php"; 8 require_once "msite.inc.php";
9 9
10 10
11 function stPrintCompoEntry($entry, $class, $compo, $title = false) 11 function stPrintCompoEntry($entry, $class, $compo, $title = FALSE)
12 { 12 {
13 echo 13 echo
14 " <div class=\"".$class."\">\n"; 14 " <div class=\"".$class."\">\n";
15 15
16 if ($title !== false) 16 if ($title !== FALSE)
17 echo 17 echo
18 " <div class=\"entryTitle\">".$title."</div>\n"; 18 " <div class=\"entryTitle\">".$title."</div>\n";
19 19
20 echo 20 echo
21 " <div class=\"entryIndex\">#".$entry["show_id"]."</div>\n". 21 " <div class=\"entryIndex\">#".$entry["show_id"]."</div>\n".
22 " <div class=\"entryName\">".chentities($entry["name"])."</div>\n"; 22 " <div class=\"entryName\">".chentities($entry["name"])."</div>\n";
23 23
24 if ($compo["show_authors"]) 24 if ($compo["show_authors"])
25 { 25 {
26 if ($title === false) 26 if ($title === FALSE)
27 echo " <div class=\"entryBy\">by</div>\n"; 27 echo " <div class=\"entryBy\">by</div>\n";
28 echo " <div class=\"entryAuthor\">".chentities($entry["author"])."</div>\n"; 28 echo " <div class=\"entryAuthor\">".chentities($entry["author"])."</div>\n";
29 } 29 }
30 30
31 if ($title === false) 31 if ($title === FALSE)
32 echo " <div class=\"entryInfo\">".stConvertCommonDesc($entry["info"], TRUE)."</div>\n"; 32 echo " <div class=\"entryInfo\">".stConvertCommonDesc($entry["info"], TRUE)."</div>\n";
33 33
34 echo 34 echo
35 " </div>\n"; 35 " </div>\n";
36 } 36 }
42 " <div class=\"compoHeader\">\n". 42 " <div class=\"compoHeader\">\n".
43 " <div class=\"compoHeaderDiv\"></div>\n". 43 " <div class=\"compoHeaderDiv\"></div>\n".
44 " <div class=\"compoTitle\">".chentities($compo["name"])." competition</div>\n". 44 " <div class=\"compoTitle\">".chentities($compo["name"])." competition</div>\n".
45 " </div>\n"; 45 " </div>\n";
46 46
47 if ($entry === false && $prev === false) 47 if ($entry === FALSE && $prev === FALSE)
48 echo "<div class=\"compoStarting\">... Is about to start ...</div>"; 48 echo "<div class=\"compoStarting\">... Is about to start ...</div>";
49 49
50 if ($entry !== false) 50 if ($entry !== FALSE)
51 stPrintCompoEntry($entry, "compoNext", $compo, false); 51 stPrintCompoEntry($entry, "compoNext", $compo, FALSE);
52 52
53 if ($prev !== false) 53 if ($prev !== FALSE)
54 stPrintCompoEntry($prev, "compoPrev", $compo, "Previous entry"); 54 stPrintCompoEntry($prev, "compoPrev", $compo, "Previous entry");
55 } 55 }
56 56
57 57
58 function stPrintRotationSlide($data) 58 function stPrintRotationSlide($data)
99 stGetDisplayVar("tempSlideSet")) 99 stGetDisplayVar("tempSlideSet"))
100 { 100 {
101 $sql = stPrepareSQL("SELECT * FROM display_slides WHERE id=%d", 101 $sql = stPrepareSQL("SELECT * FROM display_slides WHERE id=%d",
102 stGetDisplayVar("tempSlide")); 102 stGetDisplayVar("tempSlide"));
103 103
104 if (($res = stFetchSQL($sql)) !== false) 104 if (($res = stFetchSQL($sql)) !== FALSE)
105 { 105 {
106 stSetDisplayVar("tempSlideSet", FALSE); 106 stSetDisplayVar("tempSlideSet", FALSE);
107 stSetDisplayVar("activeSlideMode", SMODE_ROTATE); 107 stSetDisplayVar("activeSlideMode", SMODE_ROTATE);
108 stSetDisplayVar("activeSlide", stGetDisplayVar("tempSlide")); 108 stSetDisplayVar("activeSlide", stGetDisplayVar("tempSlide"));
109 stSetDisplayVar("activeSlideExpire", time() + (stGetDisplayVar("tempDuration") * 60)); 109 stSetDisplayVar("activeSlideExpire", time() + (stGetDisplayVar("tempDuration") * 60));
134 $list = stGetDisplayVar("rotateList"); 134 $list = stGetDisplayVar("rotateList");
135 $sql = stPrepareSQL( 135 $sql = stPrepareSQL(
136 "SELECT * FROM rot_list_slides WHERE list_id=%d ORDER BY order_num,id", 136 "SELECT * FROM rot_list_slides WHERE list_id=%d ORDER BY order_num,id",
137 $list); 137 $list);
138 138
139 if (($slideList = stExecSQL($sql)) !== false) 139 if (($slideList = stExecSQL($sql)) !== FALSE)
140 { 140 {
141 // Get slide at current index 141 // Get slide at current index
142 $slides = array(); 142 $slides = array();
143 foreach ($slideList as $slide) 143 foreach ($slideList as $slide)
144 $slides[] = $slide; 144 $slides[] = $slide;
224 if (stGetDisplayVar("activeSlide") > 0) 224 if (stGetDisplayVar("activeSlide") > 0)
225 { 225 {
226 $sql = stPrepareSQL("SELECT * FROM display_slides WHERE id=%d", 226 $sql = stPrepareSQL("SELECT * FROM display_slides WHERE id=%d",
227 stGetDisplayVar("activeSlide")); 227 stGetDisplayVar("activeSlide"));
228 228
229 if (($slide = stFetchSQL($sql)) !== false) 229 if (($slide = stFetchSQL($sql)) !== FALSE)
230 stPrintRotationSlide($slide["text"]); 230 stPrintRotationSlide($slide["text"]);
231 } 231 }
232 else 232 else
233 stGuruMeditation(); 233 stGuruMeditation();
234 break; 234 break;
238 $compo_id = stGetDisplayVar("compoID"); 238 $compo_id = stGetDisplayVar("compoID");
239 $compo = stFetchSQL(stPrepareSQL( 239 $compo = stFetchSQL(stPrepareSQL(
240 "SELECT * FROM compos WHERE id=%d", 240 "SELECT * FROM compos WHERE id=%d",
241 $compo_id)); 241 $compo_id));
242 242
243 if ($compo !== false) 243 if ($compo !== FALSE)
244 { 244 {
245 $prev = stFetchSQL(stPrepareSQL( 245 $prev = stFetchSQL(stPrepareSQL(
246 "SELECT * FROM entries WHERE compo_id=%d AND show_id=%d AND show_id<>0", 246 "SELECT * FROM entries WHERE compo_id=%d AND show_id=%d AND show_id<>0",
247 $compo_id, stGetDisplayVar("compoPrevEntry"))); 247 $compo_id, stGetDisplayVar("compoPrevEntry")));
248 248