0) { $result = mysql_query("SELECT * FROM addictions WHERE strArticleType = '$strType' 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 = $strArticleHeader; 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[strArticleType]) > 0) { $result1 = mysql_query("SELECT * FROM treatments WHERE strArticleType = '$strType' LIMIT 1"); $result2 = mysql_query("SELECT * FROM related WHERE strArticleType LIKE '%$strType%' ORDER BY strArticleType, strArticleTitle"); $result3 = mysql_query("SELECT strTypeFull FROM types WHERE strType = '$strType' LIMIT 1"); if(mysql_num_rows($result1) > 0 || mysql_num_rows($result2) > 0) { if($item = mysql_fetch_assoc($result3)) $strSideBarHeader = $item[strTypeFull]; $aSideBarContent = array(); } if($item = mysql_fetch_assoc($result1)) array_push($aSideBarContent, "$item[strArticleTitle]"); while($item = mysql_fetch_assoc($result2)) array_push($aSideBarContent, "$item[strArticleTitle]"); if(isset($aSideBarContent)) array_reverse($aSideBarContent); } } else header("Location: " . PATH_CLIENT_MAIN); } else header("Location: " . PATH_CLIENT_MAIN); ?>