0) { $currentoverview=$confi["value"]; } else { $query="SELECT * FROM overviews ORDER BY dateadded DESC LIMIT 1"; $res=mysql_query($query); if ($overview=mysql_fetch_array($res)) $currentoverview=$overview["id"]; } } // Current Aphorism if ($confi=mysql_fetch_array(mysql_query("SELECT * FROM config WHERE attribute = 'Current Aphorism'"))) { $query="SELECT * FROM aphorisms WHERE id='$confi[value]'"; $res=mysql_query($query); if (mysql_num_rows($res) > 0) { $currentaphorism=$confi["value"]; } else { $query="SELECT * FROM aphorisms ORDER BY dateadded DESC LIMIT 1"; $res=mysql_query($query); if ($aphorism=mysql_fetch_array($res)) $currentaphorism=$aphorism["id"]; } } // Current Image if ($confi=mysql_fetch_array(mysql_query("SELECT * FROM config WHERE attribute = 'Current Image'"))) { $query="SELECT * FROM images WHERE id='$confi[value]'"; $res=mysql_query($query); if (mysql_num_rows($res) > 0) { $currentimage=$confi["value"]; } else { $query="SELECT * FROM images ORDER BY dateadded DESC LIMIT 1"; $res=mysql_query($query); if ($image=mysql_fetch_array($res)) $currentimage=$image["id"]; } } // Current MedImage if ($confi=mysql_fetch_array(mysql_query("SELECT * FROM config WHERE attribute = 'Current MedImage'"))) { $query="SELECT * FROM images WHERE id='$confi[value]'"; $res=mysql_query($query); if (mysql_num_rows($res) > 0) { $currentmedimage=$confi["value"]; } else { $query="SELECT * FROM images ORDER BY dateadded DESC LIMIT 1"; $res=mysql_query($query); if ($image=mysql_fetch_array($res)) $currentmedimage=$image["id"]; } } if ($websitetype=="medword") { // Current Medword Overview if ($confi=mysql_fetch_array(mysql_query("SELECT * FROM config WHERE attribute = 'Current Medword'"))) { mysql_select_db($db_medword, $id_con); $query="SELECT * FROM medwords WHERE id='$confi[value]'"; $res=mysql_query($query); if (mysql_num_rows($res) > 0) { $currentmedword=$confi["value"]; } else { $query="SELECT * FROM medwords ORDER BY dateadded DESC LIMIT 1"; $res=mysql_query($query); if ($medword=mysql_fetch_array($res)) $currentmedword=$medword["id"]; } } } // Select language include("lang/".$lang.".php"); $bdnetfolder = "http://www.birthdefects.net/"; ?>