<?php
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 `dede_zj` where aid='$aid' and mid='$mid'");
if(!$row){
$dsql->ExecuteNoneQuery("INSERT INTO dede_zj( `id`, `mid`, `ip`,`aid` ,`logintime`)
VALUES ( '',$mid, '$joinip',$aid,$nowTime) ");
}
$db->SetQuery(" Select title,dede_archives.id From dede_archives join dede_zj on dede_archives.id=dede_zj.aid where dede_zj.mid='$mid' order by logintime desc limit 1,5");
$db->Execute();
while($row = $db->GetArray())
{
echo "document.write("<a href='view.php?aid=".$row['id']."'>");";
echo "document.write('".$row['title']."');";
echo "document.write("</a>");
";
}
}
if(!$mid){
$m = $dsql->GetOne(" Select * From `dede_zjw` where aid='$aid' and ip='$joinip'");
if(!$m){
$dsql->ExecuteNoneQuery("INSERT INTO dede_zjw( `id`, `mid`, `ip`,`aid` ,`logintime`)
VALUES ( '',$mid, '$joinip',$aid,$nowTime) ");
}
$db->SetQuery(" Select title,dede_archives.id From dede_archives join dede_zj on dede_archives.id=dede_zj.aid where dede_zjw.ip='$joinip' order by logintime desc limit 1,5");
$db->Execute();
while($row = $db->GetArray())
{
echo "document.write("<a href='view.php?aid=".$row['id']."'>");";
echo "document.write('".$row['title']."');";
echo "document.write("</a>");
";
}
}
exit();
?>
|