zoukankan      html  css  js  c++  java
  • ecshop给文章页增加一个浏览次数

    如何给ecshop的文章增加浏览次数的功能。ecshop默认是没有浏览次数的功能。

    但可以通过修改ecshop文章管理表字段和程序。来实现对ecshop文章页面浏览次数进行统计。

       1:修改ecshop文章表.

         alter table ecs_article add column click_count int(1) default  0;//增加统计浏览次数的字段。

       2:在文章详细页面增加以下程序。

        $db -> query("update ".$ecs->table('article')." set click_count=click_count + 1 where article_id = '$article_id'");

       3:详细页面显示文章浏览次数

        $count = $db -> getOne("select click_count from  ".$ecs->table('article')." where article_id = '$article_id'");

        $smarty -> assign('count',$count);

       4:详细页面调用。

        文章浏览次数:{$count}次。

        以上就完成了ecshop详细页面统计和调用。

    ------------------------------------------华丽丽的分割线--------------------- ------------------------------------

    源厂制造10-10000级洁净无尘车间防静电防尘用品!网址:http://www.lgfjd.com 微信号:614412
  • 相关阅读:
    Vue 项目目录结构分析
    Vue 项目环境搭建
    Vue 组件
    Vue 指令
    Vue 实例成员
    Django 静态文件
    MySQL 索引详解
    Django 请求生命周期
    18. 4Sum (JAVA)
    16. 3Sum Closest (JAVA)
  • 原文地址:https://www.cnblogs.com/wangblognet/p/2728041.html
Copyright © 2011-2022 走看看