"; print_r($_SESSION); echo ""; */ require_once('index.fns.php'); $frontEnd = new frontEnd(); $content = new content(); if(isset($_REQUEST['contSubCat'])) $contSubCat = $_REQUEST['contSubCat']; else $contSubCat = 'pub'; $id = $frontEnd->getContentId(); $contentId = $id['contentId']; $content->selectContentRow($contentId,$contSubCat); $_SESSION['parentId'] = $content->parentId; if($content->parentId == 1) { $_SESSION['parentId'] = $contentId; } elseif ($content->parentId == 0) { //if it is an orphan $_SESSION['parentId'] = NULL; } // check redirect $redirect = usefulFns::object_from_array(general::select('redirect',array('redirect_from'=>$contentId))); if(is_object($redirect)) { $redirectTo = usefulFns::object_from_array(general::select('content_pub',array('pub_content_id'=>$redirect->redirectTo))); header('Location: /'.$redirectTo->pubModRewriteTitle.''); exit; } $moduleId = $frontEnd->getModuleId(); $action = isset($_POST['action'])?$_POST['action']:NULL; $sentry = new sentry(); if($action) { switch ($action) { case 'quickUpdate': if($sentry->is_user_loged()) { $content->editPubContent(); $content->contentId = $_REQUEST['contentId']; $content->publishContent(); $_SESSION['message'] = 'Page has been successfully updated'; $frontEnd->redirect('index.php?contentId='.$_REQUEST['contentId']); exit; } else { echo 'Invalid access'; } break; case 'defaultSendForm': if(isset($_REQUEST['formId']) && is_numeric($_REQUEST['formId'])) { $_form = new form(); $_form->form($_REQUEST['formId']); if($_form->defaultSendForm()) { $frontEnd->redirect($_form->formThankYou); } else { $_SESSION['message'] = "There was an error processing your form, please check the highlighted fields and try again."; $redir = ereg_replace($_SERVER['SERVER_NAME'], '', $_SERVER['HTTP_REFERER']); $redir = ereg_replace('http:///', '', $redir); $redir = ereg_replace('http://', '', $redir); $frontEnd->redirect($redir); } } else { $_SESSION['message'] = "Error with the form Id"; $frontEnd->redirect($_SERVER['HTTP_REFERER']); } exit; break; case 'sendContactForm': if(email::validateCaptcha()) { $email = new email(0, "ian@redcatgroup.co.uk", $_REQUEST['email'], config::get('CONTACT_PAGE_SUBJECT'), NULL, NULL,NULL); $rejectedFieldsArray = array("security_code","action","Submit"); $requiredFieldsArray = array(); if($email->submitFormData($_POST, $rejectedFieldsArray, $requiredFieldsArray)) { $_SESSION['message'] = config::get('CONTACT_PAGE_THANK_YOU'); } else { $_SESSION['message'] = $email->errorMessage; } } else { $_SESSION['message'] = "Sorry there was an error sending the contact form, please verify that the security codes match."; } usefulFns::storePostInSession('contactForm'); $frontEnd->redirect('index.php?contentId='.config::get('CONTACT_US_PAGE_ID')); exit; break; case 'login': if($sentry->is_user_loged()) { $frontEnd->redirect('index.php?contentId='.$frontEnd->protectedPages[0]); //Redirect to the referrer page if there is one } else { if($sentry->authenticate_user()) { $sentry->logUserIn(); $frontEnd->redirect('index.php?contentId='.$frontEnd->protectedPages[0]); } else { //echo "COULD NOT AUTHORISE YOU"; $frontEnd->redirect('index.php?contentId='.config::get('LOGIN_PAGE_ID')); exit(); } } break; case 'logout': $sentry->logoutUser(); $frontEnd->redirect('index.php?contentId='.config::get('LOGIN_PAGE_ID').''); exit(); break; case 'subscribeToNewsLetter': if($frontEnd->addNewsletterSubscriber()) $frontEnd->redirect('index.php?contentId='.$frontEnd->subscriptionThankyouPageId.''); else $frontEnd->redirect('index.php?contentId='.$frontEnd->subscriptionErrorPageId.''); exit(); break; case 'registerMember': if($frontEnd->addMember()) $frontEnd->redirect('index.php?contentId='.$frontEnd->memberRegistrationThankyouPageId.''); else $frontEnd->redirect('index.php?contentId='.$frontEnd->memberRegistrationErrorPageId.''); exit(); break; case 'forgotPassword': $sentry->forgotPassword(); $frontEnd->redirect('index.php?contentId='.config::get('LOGIN_PAGE_ID').''); exit(); break; default: echo "Invalid Action. IP Logged."; break; } } $protected = new protectedclass(); if($protected->isProtected($contentId,$contSubCat) && $contentId != config::get('LOGIN_PAGE_ID')) { //If the page is protected but not the Login pages if($sentry->is_user_loged()) { //If the user is loged in if($contentId == config::get('LOGIN_PAGE_ID')) //if content Id is the Login page $frontEnd->redirect('index.php?contentId='.$protected->protectedPages[0]); //Redirect to the Welcome page } elseif(!$sentry->is_user_loged()) {//If user is not loged in $frontEnd->redirect('index.php?contentId='.config::get('LOGIN_PAGE_ID')); //redirect to the login page } } elseif($contentId ==config::get('LOGIN_PAGE_ID') && $sentry->is_user_loged()) { $frontEnd->redirect('index.php?contentId='.$protected->protectedPages[0]); //Redirect to the Welcome page } //Unsubscribe user if(isset($_GET['action']) && $_GET['action'] == 'unsubscribe' && isset($_REQUEST['newsletteruserid'])) { $news_ltr_user_id = (get_magic_quotes_gpc()) ? $_REQUEST['newsletteruserid'] : addslashes($_REQUEST['newsletteruserid']); $frontEnd->unsubscribeUser($news_ltr_user_id); } $frontEnd->visitorsCounter(); /*if($frontEnd->cookieUpdatedContent($contentId)) { echo '

PAGE UPDATED SINCE LAST VISIT

'; } $frontEnd->storeContentCookie($contentId);*/ ?> <? echo $content->metaTitle; ?> '; } ?> */ ?> moduleId == config::get('GALLERY_MODULE_ID') || $contentId == config::get('GALLERY_PAGE_ID')) { ?> parentId==7) { ?> parentId==7) { ?>
displayContent($contentId,$frontEnd->getModuleId(),$contSubCat,false); ?>
displayContent($contentId,$frontEnd->getModuleId(),$contSubCat,false); ?> displayContent(17,$frontEnd->getModuleId(),$contSubCat,false); ?> moduleId == config::get('GALLERY_MODULE_ID') || $contentId == config::get('GALLERY_PAGE_ID')) { ?>
showGallery(); else $frontEnd->showGallery($contentId); ?>
displayContent($contentId,$frontEnd->getModuleId(),$contSubCat,false); ?> display(); ?>