dedecms显示最近浏览文章代码

时间:2014-09-24

有时为了用户体验,我们想知道最近客户都浏览了什么页面,那么怎么调用呢?下面分享下代码
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();


?>


上一条:如何去掉栏目导航URL中的index.html 下一条:数据保存到数据库附加表 `dede_addonarticle` 时出错

相关文章

最新文章