Changeset 545 for trunk/includes/global.php
- Timestamp:
- Jun 18, 2013, 6:07:52 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:ignore
-
old new 5 5 .project 6 6 .buildpath 7 Query.log
-
- Property svn:ignore
-
trunk/includes/global.php
r538 r545 11 11 include_once(dirname(__FILE__).'/config.php'); 12 12 include_once(dirname(__FILE__).'/Version.php'); 13 include_once(dirname(__FILE__).'/AppModule.php'); 14 15 // Include application modules 16 // TODO: Make modules configurable 17 include_once(dirname(__FILE__).'/../Modules/AoWoW/AoWoW.php'); 18 include_once(dirname(__FILE__).'/../Modules/Referrer/Referrer.php'); 19 include_once(dirname(__FILE__).'/../Modules/FrontPage/FrontPage.php'); 13 20 14 21 GlobalInit(); … … 52 59 // TODO: Global initialized variable should be removed 53 60 $TranslationTree = GetTranslationTree(); 54 55 LogReferrer(); 61 62 // Initialize application modules 63 $System->ModuleManager->RegisterModule(new AoWoW($System)); 64 $System->ModuleManager->RegisterModule(new Referrer($System)); 65 $System->ModuleManager->Modules['Referrer']->Excluded[] = $System->Config['Web']['Host']; 66 $System->ModuleManager->RegisterModule(new FrontPage($System)); 67 $System->ModuleManager->StartAll(); 56 68 } 57 69 … … 633 645 if($Session) $_SESSION[$Name] = $Result; 634 646 return($Result); 635 }636 637 function LogReferrer()638 {639 global $System;640 641 if(array_key_exists('HTTP_REFERER', $_SERVER))642 {643 $Referrer = addslashes($_SERVER['HTTP_REFERER']);644 $HostName = substr($Referrer, strpos($Referrer, '/') + 2);645 $HostName = substr($HostName, 0, strpos($HostName, '/'));646 if($HostName != $System->Config['Web']['Host'])647 {648 $DbResult = $System->Database->query('SELECT `Id` FROM `Referrer` WHERE `Web` = "'.$HostName.'"');649 if($DbResult->num_rows > 0)650 {651 $DbRow = $DbResult->fetch_assoc();652 $System->Database->query('UPDATE `Referrer` SET `Hits` = `Hits` + 1, `DateLast` = NOW(), `LastURL` = "'.addslashes($Referrer).'" WHERE `Id` = '.$DbRow['Id']);653 } else $System->Database->query('INSERT INTO `Referrer` (`Web`, `DateFirst`, `DateLast`, `LastURL`, `Hits`) VALUES ("'.$HostName.'", NOW(), NOW( ), "'.addslashes($Referrer).'", 1)');654 }655 }656 647 } 657 648 … … 744 735 } 745 736 737 function ProcessURL() 738 { 739 if(array_key_exists('REDIRECT_QUERY_STRING', $_SERVER)) 740 $PathString = $_SERVER['REDIRECT_QUERY_STRING']; 741 else $PathString = ''; 742 if(substr($PathString, -1, 1) == '/') $PathString = substr($PathString, 0, -1); 743 $PathItems = explode('/', $PathString); 744 if(strpos($_SERVER['REQUEST_URI'], '?') !== false) 745 $_SERVER['QUERY_STRING'] = substr($_SERVER['REQUEST_URI'], strpos($_SERVER['REQUEST_URI'], '?') + 1); 746 else $_SERVER['QUERY_STRING'] = ''; 747 parse_str($_SERVER['QUERY_STRING'], $_GET); 748 return($PathItems); 749 } 750 746 751 ?>
Note:
See TracChangeset
for help on using the changeset viewer.