Changeset 547 for trunk/includes/global.php
- Timestamp:
- Jun 18, 2013, 6:58:22 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/global.php
r546 r547 5 5 include_once(dirname(__FILE__).'/Update.php'); 6 6 include_once(dirname(__FILE__).'/rss.php'); 7 include_once(dirname(__FILE__).'/user.php');8 7 include_once(dirname(__FILE__).'/Page.php'); 9 8 include_once(dirname(__FILE__).'/error.php'); … … 19 18 include_once(dirname(__FILE__).'/../Modules/FrontPage/FrontPage.php'); 20 19 include_once(dirname(__FILE__).'/../Modules/Team/Team.php'); 20 include_once(dirname(__FILE__).'/../Modules/User/User.php'); 21 21 22 22 GlobalInit(); 23 $User = &$System->User; // Back compatibility 23 24 24 25 function GlobalInit() … … 53 54 foreach($_GET as $Index => $Item) $_GET[$Index] = addslashes($_GET[$Index]); 54 55 55 $User = new User($System);56 57 56 set_error_handler('ErrorHandler'); 58 57 set_exception_handler('ExceptionHandler'); … … 62 61 63 62 // Initialize application modules 64 $System->ModuleManager->RegisterModule(new AoWoW($System)); 65 $System->ModuleManager->RegisterModule(new Referrer($System)); 63 $System->ModuleManager->RegisterModule(new ModuleUser($System)); 64 $System->ModuleManager->RegisterModule(new ModuleAoWoW($System)); 65 $System->ModuleManager->RegisterModule(new ModuleReferrer($System)); 66 66 $System->ModuleManager->Modules['Referrer']->Excluded[] = $System->Config['Web']['Host']; 67 $System->ModuleManager->RegisterModule(new FrontPage($System));68 $System->ModuleManager->RegisterModule(new Team($System));67 $System->ModuleManager->RegisterModule(new ModuleFrontPage($System)); 68 $System->ModuleManager->RegisterModule(new ModuleTeam($System)); 69 69 $System->ModuleManager->StartAll(); 70 70 } … … 265 265 'Direction' => $_SESSION['OrderDir'], 266 266 )); 267 }268 269 function FormatOutput($s)270 {271 $out = '';272 $nn = 0;273 $n = 0;274 while($s != '')275 {276 $start = strpos($s, '<');277 $end = strpos($s, '>');278 if($start != 0)279 {280 $end = $start - 1;281 $start = 0;282 }283 $line = trim(substr($s, $start, $end + 1));284 if(strlen($line) > 0)285 if($line[0] == '<')286 {287 if($s[$start + 1] == '/')288 {289 $n = $n - 2;290 $nn = $n;291 } else292 {293 if(strpos($line, ' ')) $cmd = substr($line, 1, strpos($line, ' ') - 1);294 else $cmd = substr($line, 1, strlen($line) - 2);295 //echo('['.$cmd.']');296 if(strpos($s, '</'.$cmd.'>')) $n = $n + 2;297 }298 }// else $line = '['.$line.']';299 //if($line != '') echo(htmlspecialchars(str_repeat(' ',$nn).$line."\n"));300 if($line != '') $out .= (str_repeat(' ', $nn).$line."\n");301 $s = substr($s, $end + 1, strlen($s));302 $nn = $n;303 }304 return($out);305 }306 307 function WriteLanguages($Selected)308 {309 global $System;310 311 $Output = '<select name="Language">';312 $DbResult = $System->Database->select('Language', '`Id`, `Name`', '`Enabled` = 1');313 while($Language = $DbResult->fetch_assoc())314 {315 $Output .= '<option value="'.$Language['Id'].'"';316 if($Selected == $Language['Id'])317 $Output .= ' selected="selected"';318 $Output .= '>'.$Language['Name'].'</option>';319 }320 $Output .= '</select>';321 return($Output);322 267 } 323 268 … … 751 696 } 752 697 698 function WriteLanguages($Selected) 699 { 700 global $System; 701 702 $Output = '<select name="Language">'; 703 $DbResult = $System->Database->select('Language', '`Id`, `Name`', '`Enabled` = 1'); 704 while($Language = $DbResult->fetch_assoc()) 705 { 706 $Output .= '<option value="'.$Language['Id'].'"'; 707 if($Selected == $Language['Id']) 708 $Output .= ' selected="selected"'; 709 $Output .= '>'.$Language['Name'].'</option>'; 710 } 711 $Output .= '</select>'; 712 return($Output); 713 } 714 715 753 716 ?>
Note:
See TracChangeset
for help on using the changeset viewer.