0) { $result = mysql_query("SELECT * FROM articles WHERE LOWER(REPLACE(strArticleUrl, ' ', '')) = LOWER(REPLACE('$strArticle', ' ', '')) LIMIT 1"); if($item = mysql_fetch_assoc($result)) { if(strlen($item[strArticleTitle]) > 0) $strArticleHeader = $item[strArticleTitle]; if(strlen($item[strPageTitle]) > 0) $strTitle = $item[strPageTitle]; else $strTitle = substr($strArticleHeader, 0, 39); $strTitle = "$strTitle"; if(strlen($item[strArticleContent]) > 0) $strArticleContent = str_replace("\r\n", '
', $item[strArticleContent]); if(strlen($item[strArticleDescription]) > 0) $aMeta[desc] = $item[strArticleDescription]; if(strlen($item[strArticleKeywords]) > 0) $aMeta[keywords] = $item[strArticleKeywords]; if(strlen($item[lstRelatedArticleID]) > 0) { $related = explode(",", $item[lstRelatedArticleID]); $condition = array(); foreach($related as $id) { array_push($condition, "iArticleID = '$id'"); } $condition = implode(" OR ", $condition); $result1 = mysql_query("SELECT * FROM articles WHERE $condition"); if(mysql_num_rows($result1) > 0) { $strSideBarHeader = "Related Articles"; //$item[strArticleTitle]; $aSideBarContent = array(); while($item1 = mysql_fetch_assoc($result1)) array_push($aSideBarContent, "$item1[strArticleTitle]"); } } $result2 = mysql_query("SELECT iArticleID, strArticleTitle FROM articles WHERE enumType = 'week' order by LENGTH(REPLACE(strArticleTitle, ' ', '')), strArticleTitle"); $aWeeks = array(); while($item2 = mysql_fetch_array($result2)) $aWeeks[] = array($item2[iArticleID], $item2[strArticleTitle]); if(count($aWeeks) > 0 && ($weekpos = array_search(array($item[iArticleID], $item[strArticleTitle]), $aWeeks)) !== false) { $strArticleContent .= "

"; if($weekpos > 0) $strArticleContent .= '' . $aWeeks[$weekpos - 1][1] . ''; if($weekpos > 0 && $weekpos < count($aWeeks) - 1) $strArticleContent .= " | "; if($weekpos < count($aWeeks) - 1) $strArticleContent .= '' . $aWeeks[$weekpos + 1][1] . ''; $strArticleContent .= "

"; } } else header("Location: " . PATH_CLIENT_MAIN); } else header("Location: " . PATH_CLIENT_MAIN); ?>