= '".$lastday."' order by articlestat_visit desc limit 0,".$num); while ($STR_ARRAY = mysql_fetch_array($result)){ $article_id[] = $STR_ARRAY['articlestat_articleid']; } include "/caaa.cn/config/config.inc.php"; for($i=0; $i<7; $i++){ $sql = "select article_title,article_id,article_class from caaa_article where article_id = ".$article_id[$i].""; $result = mysql_query($sql); $STR_ARRAY = mysql_fetch_array($result); // 读取文章相应栏目名 $lanmu_result = mysql_query("select class1_id from caaa_class2 where class_id = ".$STR_ARRAY['article_class']); $lanmu_array = mysql_fetch_array($lanmu_result); $lanmu_result = mysql_query("select class1_name from caaa_class1 where class1_id = ".$lanmu_array['class1_id']); $lanmu_array = mysql_fetch_array($lanmu_result); if (strlen($STR_ARRAY['article_title']) > 34){ $STR_ARRAY['article_title'] = msubstr($STR_ARRAY['article_title'],32).".."; } echo "[".$lanmu_array['class1_name']."] ".$STR_ARRAY['article_title']."
\n"; } } ?>