织梦模板资源网站 本站不设vip账户,所有模板金币购买,金币不限时间,可长期使用!

您现在的位置:织梦无忧 > 织梦教程 >

dedecms织梦会员中心如何调用热门文章以及最新文章

来源:织梦无忧 发布时间:2020-03-25热度:
摘要:织梦会员中心调用文章代码: ?php $sql = SELECT * FROM `dede_archives` WHERE arcrank -1 ORDER BY click desc LIMIT 10;$dsql-SetQuery($sql);$dsql-Execute(t);$result = ;while($row = $dsql-GetArray(t)){$arcrow = GetOneArchive($row[id]);$row[arcu...

织梦会员中心调用文章代码:
 
<?php    $sql = "SELECT * FROM `dede_archives` WHERE arcrank > -1 ORDER BY click desc LIMIT 10";
$dsql->SetQuery($sql);
$dsql->Execute('t');
$result = '';while($row = $dsql->GetArray('t'))
{
$arcrow = GetOneArchive($row['id']);
$row['arcurl'] = $arcrow['arcurl'];
$row['pubdate'] = MyDate('Y-m-d',$row['pubdate']);
$row['litpic'] = $row['litpic'] = $row['litpic']=='' ? '/images/defaultpic.gif' : $row['litpic'];
$result .= "<li><a href=\"{$row['arcurl']}\"><img src=\"{$row['litpic']}\">{$row['title']}</a></li>";
}echo $result;?>
 
织梦会员中心最新文章调用代码:
 
<?php    $sql = "SELECT * FROM `dede_archives` WHERE arcrank > -1 ORDER BY click id LIMIT 10";
$dsql->SetQuery($sql);
$dsql->Execute('t');
$result = '';while($row = $dsql->GetArray('t'))
{
$arcrow = GetOneArchive($row['id']);
$row['arcurl'] = $arcrow['arcurl'];
$row['pubdate'] = MyDate('Y-m-d',$row['pubdate']);
$row['litpic'] = $row['litpic'] = $row['litpic']=='' ? '/images/defaultpic.gif' : $row['litpic'];
$result .= "<li><a href=\"{$row['arcurl']}\"><img src=\"{$row['litpic']}\">{$row['title']}</a></li>";
}echo $result;?>

如果需要单独调用某个栏目下的文章,只需在sql语句中加 typeid=xx即可。


本文地址:http://www.dedewuyou.com/jiaocheng/14.html