当前位置:网站首页>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()}上面步骤操作完成后,进入后台首页点击【清空缓存并重新编译模板】即可。
边栏推荐
- The mystery of redis data migration capacity
- CDs view permission check
- Introduction to website development for zero foundation Xiaobai
- Snowflake algorithm implemented in go language
- [tke] analysis of CLB loopback in Intranet under IPVS forwarding mode
- What does the router pin mean?
- Popular explanation [redirection] and its practice
- [web] what happens after entering the URL from the address bar?
- Istio FAQ: sidecar stop sequence
- Try catch finally implementation mechanism
猜你喜欢

Ui- first lesson

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

Applet wxss

Ps\ai and other design software pondering notes

Some adventurer hybrid versions with potential safety hazards will be recalled

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

A survey on dynamic neural networks for natural language processing, University of California

There are potential safety hazards Land Rover recalls some hybrid vehicles

Daily algorithm & interview questions, 28 days of special training in large factories - the 15th day (string)
![[go] concurrent programming channel](/img/6a/d62678467bbc6dfb6a50ae42bacc96.jpg)
[go] concurrent programming channel
随机推荐
Customized Tile Map cut - based on Tencent map
[tke] troubleshooting tips for container problems
A memory leak caused by timeout scheduling of context and goroutine implementation
Ui- first lesson
Abstract factory pattern
Greenplum role-based fine-grained permission control
Week7 weekly report
What is the difference between a network card and a port
proxy pattern
How does the easynvr/easygbs live video platform use Wireshark to capture and analyze data locally?
What is zero trust? Three classes will show you how to understand him!
During JMeter pressure measurement, time_ The number of requests does not go up due to many waits. The problem is solved
How to get the response body content in gin?
Some adventurer hybrid versions with potential safety hazards will be recalled
[play with Tencent cloud] my operation strategy from domain name application to website filing in Tencent cloud
Is CICC securities reliable? Is it legal? Is it safe to open a stock account?
How important is it to document the project? I was chosen by the top 100 up leaders and stood up again
Try catch finally implementation mechanism
50 growers | closed door meeting of marketing circle of friends ス gathering Magic City thinking collision to help enterprise marketing growth
Pageadmin CMS solution for redundant attachments in website construction