当前位置:网站首页>zblog系统实现前台调用当天发布文章数量的教程
zblog系统实现前台调用当天发布文章数量的教程
2022-06-24 16:46:00 【壳屋栏-文曦】
今天在做一个Zblog模板的时候需要调用今日发布的文章数量,经过一番查询,网上基本上都是给的24小时内发布的文章数量,后又通过查询验证解决了问题,记录下方法以免忘记。
调用ZBlog网站今日发布文章总数需要自行写一个函数查询数据库实现,方法如下: 在主题的”include.php“文件里面复制粘贴如下函数:
function get_todayArticleNum(){
global $zbp;
$db = $zbp->db->sql->get();
$sql = $db->select('zbp_post')->count('log_id', 'num')->where(array(array('=','log_Status','0'),array('CUSTOM','log_PostTime>UNIX_TIMESTAMP(CAST(SYSDATE()AS DATE))')))->sql;
$result = GetValueInArrayByCurrent($zbp->db->Query($sql), 'num');
return $result;}在要显示统计数量的地方添加下面的调用代码
{get_todayArticleNum()}上面步骤操作完成后,进入后台首页点击【清空缓存并重新编译模板】即可。
边栏推荐
- Tencent releases the full platform version of reasoning framework TNN, and supports mobile terminal, desktop terminal and server terminal at the same time
- Ui- first lesson
- Where is the most formal and safe account opening for speculation futures? How to open a futures account?
- Problems encountered in the work of product manager
- Edit distance (linear dp+ violence matching)
- How to perform concurrent stress testing on RTSP video streams distributed by audio and video streaming servers?
- How important is it to document the project? I was chosen by the top 100 up leaders and stood up again
- Load MySQL table data consumption quick installation configuration through kafka/flink
- Annual contribution! Tencent cloud middleware product upgrade conference is in hot registration!
- Try catch finally implementation mechanism
猜你喜欢

Daily algorithm & interview questions, 28 days of special training in large factories - the 15th day (string)

A survey on model compression for natural language processing (NLP model compression overview)

Cognition and difference of service number, subscription number, applet and enterprise number (enterprise wechat)

Applet - use of template

A survey of training on graphs: taxonomy, methods, and Applications
![[go] concurrent programming channel](/img/6a/d62678467bbc6dfb6a50ae42bacc96.jpg)
[go] concurrent programming channel

Ps\ai and other design software pondering notes

C. K-th not divisible by n (Mathematics + thinking) codeforces round 640 (Div. 4)

Problems encountered in the work of product manager

Some adventurer hybrid versions with potential safety hazards will be recalled
随机推荐
How does easydss, an online classroom / online medical live on demand platform, separate audio and video data?
Embedded Software Engineer written interview guide arm system and architecture
An error is reported during SVN uploading -svn sqlite[s13]
Popular explanation [redirection] and its practice
Abnormal dockgeddon causes CPU 100%
Introduction to koa (III) koa routing
50 growers | closed door meeting of marketing circle of friends ス gathering Magic City thinking collision to help enterprise marketing growth
There are potential safety hazards Land Rover recalls some hybrid vehicles
Go deep into the implementation principle of go language defer
The TKE cluster node reports an error when executing kubectl
【prometheus】1. Monitoring overview
Comparison of jmeter/k6/locust pressure measuring tools (not completed yet)
6 things all engineers should know before FEA
Abstract factory pattern
Tencent cloud database mysql:sql flow restriction
Enterprise service growth path (7): what key factors will affect SaaS' sales performance?
Prometheus deployment
Dismantle the industrial chain of synthetic rubber industry, and the supply chain may become a sharp weapon for breakthrough
Script design for automatic login and command return
Go kit microservice integrates Promtheus to solve monitoring alarm problems