Changeset 6 for trunk/index.php
- Timestamp:
- Aug 5, 2018, 8:38:46 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/index.php
r4 r6 12 12 { 13 13 var $NoFullPage = false; 14 14 15 15 function Link($URL) 16 16 { 17 if(substr($URL, 0, 1) == '/') return($this->Config['BaseURL'].substr($URL, 1)); 18 else return($URL); 17 return($this->Config['BaseURL'].$URL); 19 18 } 20 19 … … 68 67 $Output .= '<th>'.$ResourceGroup['Name'].'</th>'; 69 68 } 70 $Output .= '</tr>'; 69 $Output .= '</tr>'; 71 70 $DbResult = $this->Database->select('Dance', '*, (SELECT Name FROM DanceGroup WHERE DanceGroup.Id=Dance.Group) AS GroupName', '1 ORDER BY `Name`'); 72 71 while($Dance = $DbResult->fetch_assoc()) … … 114 113 $MeetSources->ParseAll(); 115 114 } 116 115 117 116 function ShowMeetList() 118 117 { … … 130 129 if (array_key_exists('pohlavi', $_GET) ) { 131 130 if ($_GET['pohlavi'] > 0) $_SESSION['pohlavi'] = $_GET['pohlavi']; 132 else unset($_SESSION['pohlavi']); 131 else unset($_SESSION['pohlavi']); 133 132 } 134 133 } else { … … 136 135 ' var load_timer = 100; 137 136 var ltimer = null; 138 137 139 138 function checkOut(kc,obj){ 140 if(kc==13) $(obj).blur(); 139 if(kc==13) $(obj).blur(); 141 140 } 142 141 function initLTimer(tm){ … … 148 147 ltimer = null; 149 148 } 150 149 151 150 var cf = {}; 152 151 … … 169 168 if(lonreload) initLTimer(1000); else initLTimer(100); 170 169 } 171 170 172 171 function freloader(){ 173 172 ltimer = null; … … 214 213 '</div>'; 215 214 } 216 217 $Where = ''; 215 216 $Where = ''; 218 217 if (array_key_exists('vekod', $_SESSION) and ($_SESSION['vekod'] != '')) $Where .= ' AND (Age >= '.$_SESSION['vekod'].')'; 219 218 if (array_key_exists('vekdo', $_SESSION) and ($_SESSION['vekdo'] != '')) $Where .= ' AND (Age <= '.$_SESSION['vekdo'].')'; … … 224 223 if (array_key_exists('pohlavi', $_SESSION) and ($_SESSION['pohlavi'] != '')) $Where .= ' AND (Gender = '.$_SESSION['pohlavi'].')'; 225 224 if (substr($Where, 0, 4) == ' AND') $Where = substr($Where, 4); 226 if ($Where == '') $Where = '1'; 227 225 if ($Where == '') $Where = '1'; 226 228 227 $DbResult = $this->Database->query('SELECT COUNT(*) FROM `MeetItem` WHERE '.$Where); 229 228 $DbRow = $DbResult->fetch_row(); 230 229 $PageList = GetPageList($DbRow[0]); 231 230 232 231 $Gender = array('', 'Muž', 'Žena'); 233 232 $Output .= '<div id="list_content">'; … … 260 259 '<td>'.$Gender[$MeetItem['Gender']].'</td>'. 261 260 '<td>'.$MeetItem['Message'].'</td>'. 262 '<td><a href="'.$this->Link($MeetItem['SourceURL']).'">'.$MeetItem['SourceName'].'</a></td>'; 261 '<td><a href="'.$this->Link($MeetItem['SourceURL']).'">'.$MeetItem['SourceName'].'</a></td>'; 263 262 $Output .= '</tr>'; 264 263 } … … 269 268 return($Output); 270 269 } 271 270 272 271 function ShowMeetListRss() 273 272 { 274 273 global $Config; 275 274 276 275 $this->NoFullPage = true; 277 276 $RSS = new RSS(); 278 277 $RSS->Title = 'Taneční seznamka'; 279 278 $RSS->Description = ''; 280 $RSS->Link = $ Config['BaseURL'].'seznamka';281 279 $RSS->Link = $this->Link('/seznamka/'); 280 282 281 $DbResult = $this->Database->select('MeetItem', '*, (SELECT MeetSource.Name FROM MeetSource WHERE MeetSource.Id = MeetItem.Source) AS SourceName, '. 283 282 '(SELECT MeetSource.URL FROM MeetSource WHERE MeetSource.Id = MeetItem.Source) AS SourceURL', '1 ORDER BY `Date` DESC LIMIT 30'); … … 291 290 if ($MeetItem['Phone'] != '') $Description .= '<br/>Telefon: '.$MeetItem['Phone']; 292 291 $Description .= '<br/>Škola: <a href="'.$this->Link($MeetItem['SourceURL']).'">'.$MeetItem['SourceName'].'</a>'; 293 $RSS->Items[] = array( 294 'Title' => $Title, 295 'Description' => $Description, 292 $RSS->Items[] = array( 293 'Title' => $Title, 294 'Description' => $Description, 296 295 'Time' => MysqlDateTimeToTime($MeetItem['Date']), 297 'Link' => $ Config['BaseURL'].'seznamka',296 'Link' => $this->Link('/seznamka/'), 298 297 ); 299 298 $Output .= '<tr>'. … … 322 321 '<link rel="stylesheet" href="'.$this->Link('/style.css').'" type="text/css" media="all" />'. 323 322 '<meta http-equiv="content-type" content="application/xhtml+xml; charset='.$this->Config['Encoding'].'" />'. 324 '<script src=" jquery.js"></script>';323 '<script src="'.$this->Link('/jquery.js').'"></script>'; 325 324 $Output .= '<link rel="alternate" title="Taneční seznamka" href="'. 326 $this-> Config['BaseURL'].'seznamka-rss" type="application/rss+xml" />';325 $this->Link('/seznamka-rss/').'" type="application/rss+xml" />'; 327 326 $Output .= '<title>Tance</title>'. 328 327 '</head><body>'; … … 344 343 $this->PathItems = $this->ProcessURL(); 345 344 346 $Output = ''; 347 348 if(count($this->PathItems) > 0) { 345 $Output = ''; 346 347 if(count($this->PathItems) > 0) 348 { 349 349 if($this->PathItems[0] == 'skoly') $Output .= $this->ShowSchoolList(); 350 350 else if($this->PathItems[0] == 'tance') $Output .= $this->ShowDanceList(); … … 354 354 else $Output .= $this->ShowDanceList(); 355 355 } else $Output .= $this->ShowDanceList(); 356 if (!$this->NoFullPage) { 356 if (!$this->NoFullPage) 357 { 357 358 $Output = $this->ShowMenu().$Output; 358 359 echo($this->ShowPage($Output));
Note:
See TracChangeset
for help on using the changeset viewer.