1. 程式人生 > >dede呼叫非同一個數據庫的DZ論壇的帖子

dede呼叫非同一個數據庫的DZ論壇的帖子


{dede:php runphp="yes"}  $GLOBALS['cfg_dbname']="資料庫名";    $tsql = new DedeSql(false);  $tags = '';  $tsql->SetQuery("SELECT cdb_forums.name,cdb_threads.fid,cdb_threads.tid,cdb_threads.subject FROM cdb_threads,cdb_forums where  cdb_threads.fid=cdb_forums.fid and cdb_threads.digest>0 and cdb_threads.displayorder!=-1 order by cdb_threads.lastpost desc  LIMIT 0,10");  $tsql->Execute('t');  $tg_ko=1;  while($tgrow = $tsql->GetArray('t',MYSQL_ASSOC)){  $arr_tgrand=array('5f8b69','2a5c8b','c02846','b17134','006d57','666666','666666');  shuffle($arr_tgrand);      $tgtags .= '<li id="c_po'.$tg_ko.'"><a href="
http://xxx/forum-'.$tgrow[fid].'-1.html
" target="_blank">[<font color="#'.$arr_tgrand[0].'">'.$tgrow[name].']</font></a> <a href=" http://xxx/thread-'.$tgrow['tid'].'-1-1.html" title="'.$tgrow[subject].'" target="_blank">'.$tgrow[subject].'</a></li>    ';    $tg_ko++;               }  @me=$tgtags;  {/dede:php} 
本文轉自小豬站長學院,原文地址:
http://www.pigzz.com/201012/12161RR010.html