欢迎访问织梦学习网,加群!!!!!!!!!!!!!!!!
当前位置:主页 > 二次开发 >

dedecms显示最近浏览文章代码

2015-08-02 dedecms二次开发 dedecms,显示,最近,浏览,文章,代码,有时,为了,

有时为了用户体验,我们想知道最近客户都浏览了什么页面,那么怎么调用呢?下面分享下代码
require_once(dirname(__FILE__)."/../include/common.inc.php");
require_once(dirname(__FILE__)."/../member/config.php");
global $cfg_ml;


$mid=$cfg_ml->M_ID;
$joinip = GetIP();
//当前时间戳
$nowTime = time();


if($mid)
{


$row = $dsql->GetOne(" Select * From `xjq_zj`  where aid='$aid' and mid='$mid'");
if(!$row){
$dsql->ExecuteNoneQuery("INSERT INTO xjq_zj( `id`, `mid`, `ip`,`aid` ,`logintime`)
VALUES (  '',$mid, '$joinip',$aid,$nowTime) ");
}
$db->SetQuery(" Select title,xjq_archives.id From xjq_archives  join xjq_zj on xjq_archives.id=xjq_zj.aid where xjq_zj.mid='$mid' order by logintime desc limit 1,5");
$db->Execute();
while($row = $db->GetArray())
{
echo "document.write(\"\");\r\n";
}


}
if(!$mid){
$m = $dsql->GetOne(" Select * From `xjq_zjw`  where aid='$aid' and ip='$joinip'");
if(!$m){
$dsql->ExecuteNoneQuery("INSERT INTO xjq_zjw( `id`, `mid`, `ip`,`aid` ,`logintime`)
VALUES (  '',$mid, '$joinip',$aid,$nowTime) ");
}
$db->SetQuery(" Select title,xjq_archives.id From xjq_archives  join xjq_zj on xjq_archives.id=xjq_zj.aid where xjq_zjw.ip='$joinip' order by logintime desc limit 1,5");
$db->Execute();
while($row = $db->GetArray())
{
echo "document.write(\"\");\r\n";
}


}


exit();


?>