| <!-- TAG查詢代碼開始 --> <?php require ('./e/class/connect.php'); //引入數(shù)據(jù)庫配置文件和公共函數(shù)文件 require ('./e/class/db_sql.php'); //引入數(shù)據(jù)庫操作文件 require ('./e/data/dbcache/class.php'); //引入欄目緩存文件 $link = db_connect(); //連接MYSQL $empire = new mysqlquery(); //聲明數(shù)據(jù)庫操作類 //獲得TAG分類 $tagclass_sql = $empire->query("select classid,classname from {$dbtbpre}enewstagsclass where classid!=0 order by classid asc"); while ($tagclass_r = $empire->fetch($tagclass_sql)) { echo '<div class="tagbqn clearfix"><h3>' . $tagclass_r['classname'] . '</h3>' . PHP_EOL; /*按分類輸出所有已分類TAG*/ $tag_sql = $empire->query("select tagname from {$dbtbpre}enewstags where cid='{$tagclass_r['classid']}' order by tagid desc"); while ($tag_r = $empire->fetch($tag_sql)) { $tagslink = $public_r['newsurl'] . 'tags-' . urlencode($tag_r['tagname']) . '-0.html'; //TAG標(biāo)簽鏈接 $tag_all.= '<a href="' . $tagslink . '" title="' . $tag_r['tagname'] . '">' . $tag_r['tagname'] . '</a>'; } echo $tag_all . PHP_EOL . '</div>' . PHP_EOL; } /*其他TAG標(biāo)簽*/ echo '<div class="tagbqn clearfix"><h3>未分類標(biāo)簽</h3>' . PHP_EOL; /*按分類輸出所有TAG*/ $tag_sql = $empire->query("select tagname from {$dbtbpre}enewstags where cid=0 order by tagid desc"); while ($tag_r = $empire->fetch($tag_sql)) { $tagslink = $public_r['newsurl'] . 'tags-' . urlencode($tag_r['tagname']) . '-0.html'; //TAG標(biāo)簽鏈接 $tag_other.= '<a href="' . $tagslink . '" title="' . $tag_r['tagname'] . '">' . $tag_r['tagname'] . '</a>'; } echo $tag_other . PHP_EOL . '</div>' . PHP_EOL; db_close(); //關(guān)閉MYSQL鏈接 $empire = null; //注消操作類變量 ?> <!-- TAG查詢代碼結(jié)束 --> |
新聞熱點(diǎn)
疑難解答
圖片精選