if (!empty($arrPageObject[0]['article_id'])) { $strErrText = "Article " . $arrPageObject[0]['article_id']; $arrNewPageObject = $CMS->UM->getActiveArticle($arrPageObject[0]['article_id']); $blnRedirected = true; } elseif (!empty($arrPageObject[0]['area_id'])) { $strErrText = "Area " . $arrPageObject[0]['area_id']; $arrNewPageObject = $CMS->UM->getActiveArea($arrPageObject[0]['area_id']); $blnRedirected = true; } else { $CMS->Err_MFail(M_ERR_NO_ROWS_RETURNED, "No article or area id for this url!"); } if ($blnRedirected) { if (!is_array($arrNewPageObject)) { $CMS->Err_MFail(M_ERR_NO_ROWS_RETURNED, "No active entry for item: {$strErrText}"); } httpRedirectPerm($arrNewPageObject[0]['relative_url']); } } // We have an active URL, so off we go! if (!empty($arrPageObject[0]['article_id'])) { $strObject = "article"; $intItemID = $arrPageObject[0]['article_id']; } elseif (!empty($arrPageObject[0]['area_id'])) { $strObject = "area"; $intItemID = $arrPageObject[0]['area_id']; } else { $CMS->Err_MFail(M_ERR_NO_ROWS_RETURNED, "No article or area id for this url!"); } // ** Caching ** // switch ($strObject) { case "area":
function User($intID) { global $CMS; $strTitle = ""; $CMS->TH->SetCurrentLocation(C_TL_PROFILE); // ** Validate user details ** // $arrUserProfile = $CMS->US->Get($intID); if (count($arrUserProfile) == 0) { $CMS->Err_MFail(M_ERR_NO_ROWS_RETURNED, "User: {$intID}"); } if ($CMS->US->IsSuspended($intID)) { $CMS->Err_MFail(M_ERR_USER_SUSPENDED, ""); } $this->intUserProfileID = $intID; // referenced in PluginDisplay.php // ** SEO links ** // $strSEOTitle = $arrUserProfile['seo_username']; $blnRedirect = false; if ($strTitle) { if ($strTitle != $strSEOTitle) { $blnRedirect = true; } } else { $blnRedirect = true; } $CMS->PL->SetTitle($strSEOTitle); $strViewUser = $CMS->PL->ViewUser($intID); if ($blnRedirect) { if ($_SERVER['REQUEST_URI'] == $strViewUser) { // Do nothing - prevent infinite loop } else { httpRedirectPerm($strViewUser); } } $CMS->TH->SetUser($arrUserProfile); $strUserName = $arrUserProfile['username']; /* ********************************************** */ /* * Theme File Calls */ /* ********************************************** */ $this->DoThemeFileCalls("", ""); /* ********************************************** */ /* * System Generic */ /* ********************************************** */ $this->DoSystemGeneric(); /* ********************************************** */ /* * Navigation Bar */ /* ********************************************** */ $this->DoTopLevelNavBar("", ""); /* ********************************************** */ /* * Header - Page Title */ /* ********************************************** */ $CMS->TH->SetHeaderPageTitle("View Profile - {$strUserName}"); /* ********************************************** */ /* * Header - Meta Desc */ /* ********************************************** */ $strMetaDesc = "{$strUserName}'s profile"; $strHeaderMetaDesc = "<meta name=\"description\" content=\"{$strMetaDesc}\" />\n"; $CMS->TH->SetHeaderMetaDesc($strHeaderMetaDesc); /* ********************************************** */ /* * Header - Area Styles */ /* ********************************************** */ $strHeaderAreaStyles = "<link href=\"" . $this->strThemeStyles . "\" rel=\"stylesheet\" type=\"text/css\" />\n"; $CMS->TH->SetHeaderAreaStyles($strHeaderAreaStyles); /* ********************************************** */ /* * Sys - Wrapper */ /* ********************************************** */ $strSysWrapperStart = "<div id=\"user-profile\" class=\"user-profile\">\n"; $strSysWrapperEnd = "</div>\n"; $CMS->TH->SetSysWrapperStart($strSysWrapperStart); $CMS->TH->SetSysWrapperEnd($strSysWrapperEnd); // *** Output *** // require $this->strThemeHeader; require $this->strThemeProfile; require $this->strThemeFooter; // ** Disconnect ** // //$IQP = new IQuery; //$IQP->Disconnect(); $CMS->IQ->Disconnect(); // ** Close the page ** // exit; }