Git Product home page Git Product logo

teohvisit's Introduction

插件实现的功能非常简单,就只是记录了访问数据,和在需要的界面提供数据

安装

将代码克隆到typecho插件目录,在管理后台找到 TeohVisit 之间开启使用即可

git clone https://github.com/mstzf/TeohVisit.git

使用

具体使用需要修改主题源码,或者自定义独立界面模板

插件提供了两种读取数据的方法

getStat:返回所需要的单个值,具体值为:today,yesterday,month,total

getAllStats:返回全部数据

示例:

if (TeohVisit_Plugin::isPluginEnabled()) {
    $stats = TeohVisit_Plugin::getAllStats();
    $data = [
        'today_unique_visitors' => $stats['today']['unique_visitors'],
        'today_views' => $stats['today']['views'],
        'yesterday_unique_visitors' => $stats['yesterday']['unique_visitors'],
        'yesterday_views' => $stats['yesterday']['views'],
        'month_total_views' => $stats['month']['total_views'],
        'total_total_views' => $stats['total']['total_views']
    ];
}

teohvisit's People

Contributors

mstzf avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.