使用Emlog搭建的站点中想更能直观的展现博客的信息内容,由于官方没有提供特定的模块,因此我们需要自己添加一下查询代码。
以下是整理的Emlog博客网站,调用的统计信息代码。具体可以通过两种方法来实现,各有优缺点,根据具体环境,酌情使用。
调用方法:
将下面代码添加到当前使用的主题模板文件中。
module.php输出部分,或侧边栏输出部分
1、官方缓存类统计代码,优点:加载速度快,缺点:信息更新不如直接查询准确。

2、自查函数,通过SQL语句查询相关数据,优点:实时显示,缺点:此类查询过多导致加载速度缓慢。
查询函数代码:

调用显示代码:
