插件名称:浏览记录
适用版本:v9语言编码:GBK简体 UTF8简体插件作者:hicolor版权所属:hicolor支持网站:www.appqy.com插件介绍:文章浏览记录适用版本号:9.3.3
<?phpheader("Cache-Control: no-cache, must-revalidate");include 'phpcms'.DIRECTORY_SEPARATOR.'base.php';pc_base::load_sys_class('param', '', 0);$contentid = isset($_GET['contentid']) ? intval($_GET['contentid']) : 0;$readid = param::get_cookie('readid');$action = $_GET['action'];if(intval($readid))$readwhere = $readid;switch($action){case 'read':if($contentid){if(intval($readid)){$readid = $contentid.','.$readid;$tmp = explode(",",$readid);$tmp = array_unique($tmp);while(count($tmp) > 10)array_pop($tmp);$readid = implode(",",$tmp);}else $readid = $contentid;param::set_cookie('readid',$readid,time()+3600*365*24);}break;case 'list':include template('content', 'read_fang');break;}?>
<ul>{if $readwhere}{pc:get sql="SELECT * FROM `news` WHERE id IN ($readwhere) AND status = '99' ORDER BY FIND_IN_SET(id,'$readwhere')" rows="10"}{loop $data $key $r}<li><a href="{$r[url]}" title="{$r['title']}">{$r['title']}</a></li>{/loop}{/pc}{else}<li>您还没有浏览过信息</li>{/if}</ul>
<script language="JavaScript" src="readid.php?contentid={$contentid}&action=read"></script>
<script type="text/javascript">$(document).ready(function(){$('#readhouse').load("readid.php?action=list");});</script>
<div id="readhouse"><img src="images/loading.gif" align="absmiddle"> 数据加载中</div>