推56论坛

 找回密码
 立即注册(限中文)

QQ登录

只需一步,快速开始

    查看: 150|回复: 1

    [ECshop教程] 在ECSHOP文章详情页显示该文章的浏览次数

    [复制链接]
    发表于 2018-4-28 19:28:34 | 显示全部楼层 |阅读模式
    1)、首先需要修改一下数据库结构
    进ECSHOP后台 》 数据库管理 》SQL查询 ,输入下面SQL语句

    ALTER TABLE `ecs_article` ADD `click_count` INT( 10 ) NOT NULL

    点 “提交查询”

    2)、修改 /article.php

    搜索
    else
    {
        $smarty->display('article_pro.dwt', $cache_id);
    }

    在它下面增加一行PHP代码,如下:
    $db->query("update ".$ecs->table('article')." set click_count=click_count+1 where article_id=$article_id") ;

    3)、修改 /themes/default/article.dwt

    找到
    {$article.add_time}

    在它后边增加PHP代码,如下:

    / 浏览次数:{$article.click_count}

    这种修改方法,要清除缓存或者缓存自动更新后才能体现出最新的浏览次数来。

    如果你想能实时显示最新的浏览次数,就要构造一个INSERT函数,并在模板中用 {insert name =“xxx”} 调用。

    学建站、学推广、学赚钱,上56站长论坛就够了!个性签名请到个人资料里面修改……
    发表于 2018-5-22 01:00:30 | 显示全部楼层
    公车千里接送理发师就因他要理理发2018年05月22日2018/5/22 1:04:22
    http://www.bilibili.com/video/av23609145/index_1825884.html
    http://www.bilibili.com/video/av23317705/index_6299391.html
    http://www.bilibili.com/video/av23598062/index_9307979.html
    http://www.bilibili.com/video/av23597700/index_1584090.html
    http://www.bilibili.com/video/av23465856/index_1664447.html
    http://www.bilibili.com/video/av23601794/index_6816071.html
    http://www.bilibili.com/video/av23600078/index_0065566.html
    http://www.bilibili.com/video/av23466717/index_7385320.html
    http://www.bilibili.com/video/av23597812/index_3418845.html
    http://www.bilibili.com/video/av23611304/index_5348432.html
    http://www.bilibili.com/video/av23269057/index_4808080.html
    http://www.bilibili.com/video/av23610665/index_5184233.html
    http://www.bilibili.com/video/av23249818/index_3891172.html
    http://www.bilibili.com/video/av23598596/index_4071365.html
    http://www.bilibili.com/video/av23602170/index_6161232.html
    http://www.bilibili.com/video/av23615378/index_4763408.html
    http://www.bilibili.com/video/av23602975/index_2246012.html
    http://www.bilibili.com/video/av23597838/index_5572690.html
    http://www.bilibili.com/video/av23611161/index_8376148.html
    http://www.bilibili.com/video/av23601994/index_9230908.html
    http://www.bilibili.com/video/av23241936/index_0277741.html
    http://www.bilibili.com/video/av23318188/index_7352431.html
    http://www.bilibili.com/video/av23599074/index_6886426.html
    http://www.bilibili.com/video/av23466539/index_4962502.html
    http://www.bilibili.com/video/av23464467/index_0160034.html
    http://www.bilibili.com/video/av23281282/index_2958580.html
    http://www.bilibili.com/video/av23268648/index_0137173.html
    http://www.bilibili.com/video/av23598415/index_3435826.html
    http://www.bilibili.com/video/av23601914/index_3151487.html
    http://www.bilibili.com/video/av23466379/index_1923963.html
    http://www.bilibili.com/video/av23318544/index_8278353.html
    http://www.bilibili.com/video/av23600220/index_7254297.html
    http://www.bilibili.com/video/av23316104/index_6242089.html
    http://www.bilibili.com/video/av23317099/index_8071938.html
    http://www.bilibili.com/video/av23316158/index_2131104.html
    http://www.bilibili.com/video/av23600634/index_2674726.html
    http://www.bilibili.com/video/av23615336/index_8971995.html
    http://www.bilibili.com/video/av23597835/index_7718840.html
    http://www.bilibili.com/video/av23316184/index_2073254.html
    http://www.bilibili.com/video/av23461323/index_1221834.html
    http://www.bilibili.com/video/av23249297/index_5773520.html
    http://www.bilibili.com/video/av23249278/index_0900325.html
    http://www.bilibili.com/video/av23317101/index_3122539.html
    http://www.bilibili.com/video/av23599444/index_6014717.html
    http://www.bilibili.com/video/av23597886/index_7400611.html
    http://www.bilibili.com/video/av23600803/index_0353191.html
    http://www.bilibili.com/video/av23315706/index_0638397.html
    http://www.bilibili.com/video/av23602170/index_0983949.html
    http://www.bilibili.com/video/av23600797/index_7687033.html
    http://www.bilibili.com/video/av23610317/index_5996143.html
    http://www.bilibili.com/video/av23242522/index_7794476.html
    http://www.bilibili.com/video/av23466846/index_3754296.html
    http://www.bilibili.com/video/av23598948/index_4177623.html
    http://www.bilibili.com/video/av23602261/index_7650685.html
    http://www.bilibili.com/video/av23315150/index_6421543.html
    http://www.bilibili.com/video/av23599394/index_2885733.html
    http://www.bilibili.com/video/av23318032/index_8238370.html
    http://www.bilibili.com/video/av23598128/index_8194299.html
    http://www.bilibili.com/video/av23461790/index_0437916.html
    http://www.bilibili.com/video/av23463867/index_3327422.html
    http://www.bilibili.com/video/av23608407/index_3819899.html
    http://www.bilibili.com/video/av23600322/index_4122048.html
    http://www.bilibili.com/video/av23601198/index_**432.html
    http://www.bilibili.com/video/av23598796/index_3577174.html
    http://www.bilibili.com/video/av23599575/index_9119484.html
    http://www.bilibili.com/video/av23316242/index_2753006.html
    http://www.bilibili.com/video/av23602586/index_3148670.html
    http://www.bilibili.com/video/av23600456/index_1539999.html
    http://www.bilibili.com/video/av23600814/index_3417144.html
    http://www.bilibili.com/video/av23461664/index_0036649.html
    http://www.bilibili.com/video/av23609089/index_5104250.html
    http://www.bilibili.com/video/av23242060/index_4395037.html
    http://www.bilibili.com/video/av23315584/index_5794859.html
    http://www.bilibili.com/video/av23316318/index_3458613.html
    http://www.bilibili.com/video/av23602922/index_0129315.html
    http://www.bilibili.com/video/av23600078/index_4357498.html
    http://www.bilibili.com/video/av23615098/index_0111074.html
    http://www.bilibili.com/video/av23249807/index_2318801.html
    http://www.bilibili.com/video/av23316162/index_7466473.html
    http://www.bilibili.com/video/av23317328/index_2666211.html
    学建站、学推广、学赚钱,上56站长论坛就够了!个性签名请到个人资料里面修改……
    回复 支持 反对

    使用道具 举报

    本版积分规则

    关闭

    推56站长论坛推荐上一条 /3 下一条

    站长QQ
    在线咨询
    咨询热线
    QQ:405327411
    站长

    QQ|广告合作|关于我们|联系我们|免责声明|网站导航|站长论坛 ( 豫ICP备11018337号-5

    王宝臣旗下网站 推56论坛(www.tui56.com|ask.tui56.com|blog.tui56.com|daohang.tui56.com)

    Powered by Discuz! X3.4 Licensed

    ©2001-2013 Comsenz Inc.

    快速回复 返回顶部 返回列表