欢迎来到361模板(www.ke361.com),原创精品织梦模板提供商。QQ快速注册登录 网站托管 VIP 网站定制

织梦模板

当前位置:织梦模板 > 技术文档 > 网站技巧 > 织梦列表页获取热搜排行榜文章
这篇文章主要为大家详细介绍了织梦列表页获取热搜排行榜文章,具有一定的参考价值,感兴趣的小伙伴们可以参考一下,有需要的朋友可以收藏方便以后借鉴。

打开织梦/include/extend.func.php 最后加上以下代码:

//列表页获取网友热搜 24小时

function GetHotSearch($tid){global $dsql;$time = time() - 86400;$sql = "select * from dede_archives where typeid = '$tid' and shorttitle <> '' group by shorttitle order by pubdate desc limit 10";$dsql->Execute('me',$sql);$li = '';while($arr = $dsql->GetArray('me')){if($arr['pubdate'] >$time ){$class = 'new';}else{$class = '';}$barr = GetOneArchive($arr['id']);$arcurl = $barr['arcurl'];$li .= '<li><span class="right"><time class="'.$class.'">'.date('Y-m-d',$arr['pubdate']).'</time></span><a rel="nofollow" target="_blank" href="go.php?url='.$arcurl.'" title="'.$arr['shorttitle'].'">'.$arr['shorttitle'].'</a></li>';}return $li;}

//排行榜获取网友热搜 3天

function hot_3_GetHotSearch($tid){global $dsql;$time = time() - 86400;$sql = "select * from dede_archives where pubdate > UNIX_TIMESTAMP( CURDATE( ) - INTERVAL 3 day) and typeid = '$tid' and shorttitle <> '' group by shorttitle order by click desc limit 10";$dsql->Execute('me',$sql);$li = '';while($arr = $dsql->GetArray('me')){if($arr['pubdate'] >$time ){$class = 'new';}else{$class = '';}$barr = GetOneArchive($arr['id']);$arcurl = $barr['arcurl'];$li .= '<li><span class="right"><time class="'.$class.'">'.date('Y-m-d',$arr['pubdate']).'</time></span><a rel="nofollow" target="_blank" href="go.php?url='.$arcurl.'" title="'.$arr['shorttitle'].'">'.$arr['shorttitle'].'</a></li>';}return $li;}

//排行榜获取网友热搜 7天

function hot_7_GetHotSearch($tid){global $dsql;$time = time() - 86400;$sql = "select * from dede_archives where pubdate > UNIX_TIMESTAMP( CURDATE( ) - INTERVAL 7 day) and typeid = '$tid' and shorttitle <> '' group by shorttitle order by click desc limit 10";$dsql->Execute('me',$sql);$li = '';while($arr = $dsql->GetArray('me')){if($arr['pubdate'] >$time ){$class = 'new';}else{$class = '';}$barr = GetOneArchive($arr['id']);$arcurl = $barr['arcurl'];$li .= '<li><span class="right"><time class="'.$class.'">'.date('Y-m-d',$arr['pubdate']).'</time></span><a rel="nofollow" target="_blank" href="go.php?url='.$arcurl.'" title="'.$arr['shorttitle'].'">'.$arr['shorttitle'].'</a></li>';}return $li;}

//排行榜获取网友热搜 30天

function hot_30_GetHotSearch($tid){global $dsql;$time = time() - 86400;$sql = "select * from dede_archives where pubdate > UNIX_TIMESTAMP( CURDATE( ) - INTERVAL 30 day) and typeid = '$tid' and shorttitle <> '' group by shorttitle order by click desc limit 10";$dsql->Execute('me',$sql);$li = '';while($arr = $dsql->GetArray('me')){if($arr['pubdate'] >$time ){$class = 'new';}else{$class = '';}$barr = GetOneArchive($arr['id']);$arcurl = $barr['arcurl'];$li .= '<li><span class="right"><time class="'.$class.'">'.date('Y-m-d',$arr['pubdate']).'</time></span><a rel="nofollow" target="_blank" href="go.php?url='.$arcurl.'" title="'.$arr['shorttitle'].'">'.$arr['shorttitle'].'</a></li>';}return $li;}

//列表页获取栏目关注 30天 14条

function hotword_30_GetHotSearch($tid){global $dsql;$time = time() - 86400;$sql = "select * from dede_archives where pubdate > UNIX_TIMESTAMP( CURDATE( ) - INTERVAL 90 day) and typeid = '$tid' and shorttitle <> '' group by shorttitle order by click desc limit 14";$dsql->Execute('me',$sql);$li = '';while($arr = $dsql->GetArray('me')){if($arr['pubdate'] >$time ){$class = 'new';}else{$class = '';}$barr = GetOneArchive($arr['id']);$arcurl = $barr['arcurl'];$li .= '<a rel="nofollow" target="_blank" href="go.php?url='.$arcurl.'" title="'.$arr['shorttitle'].'">'.$arr['shorttitle'].'</a>';}return $li;} 

以上就是织梦列表页获取热搜排行榜文章的全部内容,希望对大家的学习和解决疑问有所帮助,也希望大家多多支持361模板网。

感谢打赏,我们会为大家提供更多优质资源!

热词标签: 织梦列表页 热搜 排行榜

上一篇dedecms织梦手机站m目录启用二级域名方法

下一篇织梦cms手机站首页不更新的解决办法

取消

感谢您的支持,我们会继续努力的!

扫码支持
扫码打赏,你说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

Powered by361模板网,分享从这里开始,精彩与您同在