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
  • 相关阅读:
    SonarQube
    Gerrit
    Jenkins
    Jenkins
    GitLab
    GitLab
    GitLab
    centos7配置国内yum源
    CentOS7 ping: unknown host www.baidu.com
    VirtualBox下安装CentOS7系统
  • 原文地址:https://www.cnblogs.com/wangblognet/p/2728041.html
Copyright © 2011-2022 走看看