DEDECMS站內(nèi)新聞的最新調(diào)用方法
來源:程序員人生 發(fā)布時間:2014-04-05 13:12:37 閱讀次數(shù):2444次
網(wǎng)(LieHuo.Net)教程 我是個菜鳥站內(nèi)新聞?wù){(diào)用問題。都是一點一點摸索出來。現(xiàn)在把方法公布給大家以便于給那些需要的朋友們。這個是帶超級鏈接還有留言內(nèi)容頁面的。
以下為站長新聞?wù){(diào)用代碼: <ul class="c1 ico2"> {dede:sql sql="Select aid,typeid,title,writer,senddate,body From dede_mynews order by aid desc limit 0,5"} <li class='dotline'><a href="/mynew.php?id=[field:aid/]">[field:title/] </a></li> [field:senddate function="MyDate('m-d',@me)" /]<br>{/dede:sql}</ul>
|
以下為內(nèi)容頁面文件: <?php require_once (dirname(__FILE__) . "/include/common.inc.php"); $id=$_REQUEST['id']; $dsql="select * from dede_mynews where aid='".$id."'"; $result=mysql_query($dsql); while($rs=mysql_fetch_object($result)) { $title=$rs->title; $writer=$rs->writer; $body=$rs->body; $senddate=$rs->senddate; $time=MyDate("Y-m-d",$senddate); } ?> <title><?=$title?></title> <link href="/templets/style/style.css" rel="stylesheet" media="screen" type="text/css" /> <div align="center" class="boxz"> <table width="600"border="0" cellspacing="1" cellpadding="1"> <tr> <td height="80" align="center" bgcolor="#F9F9F9"><b><?=$title?></b></td> </tr> <tr> <td> </td> </tr> <tr> <td><?=$body?></td> </tr> <tr> <td height="30" align="center"> <div align="right"><font color="#666666">發(fā)布人: <?=$writer?> 時間: <?=$time?> </font></div></td> </tr> <tr> <td><div align="center"><a href="http://www.veryhuo.com/">首頁</a></div></td> </tr> </table> </div> |
生活不易,碼農(nóng)辛苦
如果您覺得本網(wǎng)站對您的學習有所幫助,可以手機掃描二維碼進行捐贈