免费

DESTOON 增加内容页的浏览历史记录

分类 功能类
评论 0
收藏量 0
发布时间 2016-02-10 17:49
下载量 237
体积 0.1M
访问量 5054
请支持知识付费阅读!感谢!

DESTOON 增加内容页的浏览历史记录

一:简介
最近在用destoon弄一个商城模板,考虑到商城都有浏览历史记录,而destoon却没有 无语,所以自己动手弄了一个 要实现的功能:
1、要显示的浏览记录数量。
2、最近浏览的内容排在最前面。
3、保存记录的时间。
4、调用一个文件适用与多个栏目。
5、清除浏览历史记录。
6、伪静态的地址也能用。
二:源代码

 <div class="package fl wfs">
        <h4 class="fl wfs">历史浏览记录</h4>
      
        <div class="canvas1 fl"> 
          <div class="package-container1 fl" id="history">
           <ul class="package-container-items1"> 
          <?php
$MOD_name = "$MOD[moduledir]";
if (!empty($_cookie["$MOD_name"]['history'])){
$history = explode(',', $_cookie["$MOD_name"]['history']);
array_unshift($history, $itemid);
$history = array_unique($history);
while (count($history) > 14){
array_pop($history);
}setcookie("$MOD_name".'[history]', implode(',', $history), time() + 86400 * 7,'/'."$MOD_name","$DT_PATH");
} else {
setcookie("$MOD_name".'[history]', $itemid, time() + 86400 * 7,'/'."$MOD_name","$DT_PATH");
} $history =isset ($_cookie["$MOD_name"]['history']) ? $_cookie["$MOD_name"]['history'] : 0;
if($del=="del"){
setcookie("$MOD_name".'[history]', "", time()-3600);
echo header("Location: $linkurl"); 
};
$query = mysql_query("SELECt * FROM `$table` WHERe `itemid` in ($history) ORDER BY FIELD(itemid,$history)");
while($t = mysql_fetch_array($query)){?>  
          
           <li class="width-item j-width-item"> <a href="{$t[linkurl]}" target="_blank"> <img src="{$t['thumb']}" width="120" height="120" title="{$t[title]}" alt="{$t[alt]}"> </a> <span style="text-align: center;" title="{$t[title]}" alt="{$t[alt]}">{$t[title]}<br><i>&nbsp;¥{$t[price]} 元</i>&nbsp;&nbsp;</span></li>
          
           <?php } ?>
            </ul>
          </div>
        </div>
      </div>      

本文标题: DESTOON 增加内容页的浏览历史记录

本文链接: https://mbkfw.com/down/8.html (转载时请注明来源链接)

本文说明: 本文来源于网络转载,有问题请发送至: 邮箱/kf@dtmuban.com 进行修改或删除

特别鸣谢: 如果您觉得本文对您有帮助,请给我们一个小小的赞,收藏本文更利于反复学习哦!

下班PC阅读不方便?

手机也可以随时学习开发

微信关注公众号“商企云服”
"模板开发网前端开发教学"
每日干货技术分享
 
0

圈友点评

文明上网理性发言,请遵守网络评论服务协议

×

《客户实名在线注册登记》售后一直都在!

关注

微信
关注

微信扫一扫
不同的环境体验

幸运大转盘,好礼等您拿

模板开发网公众号

模板开发网微信小程序

代授权

程序
授权

黑小二

联系
客服

很高兴为您服务
尊敬的用户,欢迎您咨询,我们为新用户准备了优惠好礼。咨询客服

联系客服:

在线QQ: 290948585

客服电话: 18605917465

E_mail邮箱: kf@dtmuban.com

微信公众号: 商企云服

微信小程序: 模板开发

QQ客服 微信客服DT授权代办 在线交谈 智能小云 黑土AI

工作时间:

周一至周五: 09:00 - 18:00

APP下载

安卓
APK

模板开发网安卓版APP

反馈

我要
反馈