//****************************************
// Galactic Surf.com - Processor.php
// VERSION: LVIE
//****************************************
header("HTTP/1.0 200 OK");
header("Content-type: text/html; charset=Windows-1252");
//#################################################################################################
// PHP to process the redirect...back from redirect.php
//#################################################################################################
$arrGoTo = split("=", $_SERVER['REQUEST_URI']);
if(eregi("\?redir", $_SERVER['REQUEST_URI']))
{
header("Location: ".$arrGoTo[1]."");
die();
}
//#################################################################################################
// End redirect code
//#################################################################################################
//#################################################################################################
// Include all classes and Global Constants
//#################################################################################################
include_once("classes/globalConstants.php");
include_once("classes/myDatabaseClass.php");
include_once("classes/myDebugClass.php");
include_once("classes/clsFrontendUDP.php");
include_once("classes/clsHTML.php");
include_once("classes/fnLibrary.php");
include_once("classes/EnDecryptText.php");
//#################################################################################################
// Set variables so we can access the classes if they exist
//#################################################################################################
if (class_exists('clsFrontendUDP'))
{
$objFrontEnd = new clsFrontendUDP();
}
if (class_exists('clsHTML'))
{
$objHTML = new clsHTML();
}
if (class_exists('clsFrontendUDP'))
{
$objFrontendUDP = new clsFrontendUDP();
}
//#################################################################################################
// End Setting Classes
//#################################################################################################
// this processor needs to intercept all 404 error pages and process the URL.
// soon as this page is hit, it requests the URL and finds category or subcategory, and displays the results for that page accordingly.
// the http://www.questfinder.com/category/subcategory is checked categories are sent to the page that shows all sub categories
// if it is a sub category, we need to send it to the content
// if the category is actually a sub category, we need to send the person straight on through to the content page.
//echo "'".$_SERVER['REQUEST_URI']."'
";
$strPageRequested = str_replace("/", "",$_SERVER['REQUEST_URI']);
$strPageRequested = $objFrontEnd->transform_urlterm_to_term($strPageRequested);
//echo $strPageRequested;
//#################################################################################################
// Getting the URI , the CATEGORY and the SUB CATEGORY - Uncomment echo lines if confused !
//#################################################################################################
//$strPageRequestedAfterLastSlash = substr($_SERVER['REQUEST_URI'], 6); // For TEST
$strPageRequestedAfterLastSlash = substr($_SERVER['REQUEST_URI'], 1); // For LIVE
// Make sure correct line above is commented out for TEST OR LIVE
$strCategoryName = substr($strPageRequestedAfterLastSlash,0,strpos($strPageRequestedAfterLastSlash,"/"));
// $strSubCategoryName
$strSubCategoryName = substr($strPageRequestedAfterLastSlash, strpos($strPageRequestedAfterLastSlash,"/") + 1, strlen($_SERVER['REQUEST_URI']));
$strURLFormattedSubCategoryName = $objFrontEnd->transform_urlterm_to_term($strSubCategoryName);
// UNCOMMENT Below if confused :o)
//echo "THE URI AFTER HTTP://WWW.DOMAIN.SUFFIX : ".$strPageRequestedAfterLastSlash." ";
//echo "The CATEGORY name is: ".$strCategoryName." ";
//echo "The SUB-CATEGORY is: ".$strSubCategoryName;
if(eregi("\?term=", $_SERVER['REQUEST_URI']))
{
$arrSearchTerm = split("term=",$_SERVER['REQUEST_URI']);
$strSearchTerm = str_replace("%20", " ", $arrSearchTerm[1]);
//echo "Search Term = ". $arrSearchTerm[1];
}
$arrGetLongNameForTitle = $objFrontEnd->getContentByWebsiteIDAndSubCategoryName(WEBSITE_ID, $strURLFormattedSubCategoryName);
//echo "
".print_r($arrGetLongNameForTitle, true)."
";
if(strlen($arrGetLongNameForTitle[0][0]) > 1)
{
$strPageTitle = $arrGetLongNameForTitle[0][0];
}
else
{
$strPageTitle = $arrGetLongNameForTitle[0][8];
}
//#################################################################################################
// END Stripping the URL
//#################################################################################################
//#################################################################################################
// End PHP headers - Start HTML
//#################################################################################################
$strTitle = "";
if(isset($strSearchTerm)){
$strTitle = ucwords(WEBSITE_NAME).".com - Your search for: ".ucwords($strSearchTerm)." - Your Entertainment Portal";
}else{
// $strTitle = $strPageTitle." from Galactic Surf - Your Entertainment Portal";
$strTitle = $strPageTitle." - Add a Link to the Entertainment Directory";
}
?>
echo $strTitle; ?>