当前位置:网站首页>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()}上面步骤操作完成后,进入后台首页点击【清空缓存并重新编译模板】即可。
边栏推荐
- Load MySQL table data consumption quick installation configuration through kafka/flink
- One Minute! No code! Add [statistical analysis] to the website
- @There is a free copyright protection service for enterprises in Dawan District
- There are potential safety hazards Land Rover recalls some hybrid vehicles
- Introduction of thread pool and sharing of practice cases
- Tencent releases the full platform version of reasoning framework TNN, and supports mobile terminal, desktop terminal and server terminal at the same time
- Object store signature generation
- Don't let [mana] destroy your code!
- A set of very good H3C and Tianrongxin Internet cutover scheme templates, with word document download
- What is the difference between a network card and a port
猜你喜欢

Applet - use of template

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

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

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

A survey of training on graphs: taxonomy, methods, and Applications

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

There are potential safety hazards Land Rover recalls some hybrid vehicles
![[go] concurrent programming channel](/img/6a/d62678467bbc6dfb6a50ae42bacc96.jpg)
[go] concurrent programming channel

Some adventurer hybrid versions with potential safety hazards will be recalled
![[leetcode108] convert an ordered array into a binary search tree (medium order traversal)](/img/e1/0fac59a531040d74fd7531e2840eb5.jpg)
[leetcode108] convert an ordered array into a binary search tree (medium order traversal)
随机推荐
[tke] troubleshooting tips for container problems
Little red book, hovering on the edge of listing
If only 2 people are recruited, can the enterprise do a good job in content risk control?
Cause analysis of the failure of web page live broadcast on demand RTMP streaming platform easydss streaming live broadcast
What is the difference between optical fiber jumper and copper wire
[play with Tencent cloud] my operation strategy from domain name application to website filing in Tencent cloud
It may be a good idea to use simulation software in the cloud for simulation
[idea] dynamic planning (DP)
Use Google search like a professional
Introduction to website development for zero foundation Xiaobai
实现TypeScript运行时类型检查
【prometheus】1. Monitoring overview
One article combs multi task learning (mmoe/ple/dupn/essm, etc.)
What is Ethernet
[playing with Tencent cloud] a solution to the impassability of cross-border access to foreign websites using Tencent cloud CVM
Ps\ai and other design software pondering notes
Cognition and difference of service number, subscription number, applet and enterprise number (enterprise wechat)
Tencent releases the full platform version of reasoning framework TNN, and supports mobile terminal, desktop terminal and server terminal at the same time
Bitwise Operators
2021 devopsdays Tokyo Station ends perfectly | coding experts are invited to share the latest technical information