<!-- TAG查詢代碼開始 --> <?php require ('./e/class/connect.php'); //引入數據庫配置文件和公共函數文件 require ('./e/class/db_sql.php'); //引入數據庫操作文件 require ('./e/data/dbcache/class.php'); //引入欄目緩存文件 $link = db_connect(); //連接MYSQL $empire = new mysqlquery(); //聲明數據庫操作類 //獲得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標簽鏈接 $tag_all.= '<a href="' . $tagslink . '" title="' . $tag_r['tagname'] . '">' . $tag_r['tagname'] . '</a>'; } echo $tag_all . PHP_EOL . '</div>' . PHP_EOL; } /*其他TAG標簽*/ echo '<div class="tagbqn clearfix"><h3>未分類標簽</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標簽鏈接 $tag_other.= '<a href="' . $tagslink . '" title="' . $tag_r['tagname'] . '">' . $tag_r['tagname'] . '</a>'; } echo $tag_other . PHP_EOL . '</div>' . PHP_EOL; db_close(); //關閉MYSQL鏈接 $empire = null; //注消操作類變量 ?> <!-- TAG查詢代碼結束 --> |
新聞熱點
疑難解答