主页 > 网站建设 > 建站知识 > dedecms显示最近浏览文章代码

dedecms显示最近浏览文章代码

POST TIME:2020-03-30 20:04

有时为了用户体验,我们想知道最近客户都浏览了什么页面,那么怎么调用呢?下面分享下代码

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(&;&;); ";
}

}
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(&;&;); ";
}

}

exit();

?>




收缩
  • 微信客服
  • 微信二维码
  • 电话咨询

  • 400-1100-266