当前位置:网站首页>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()}上面步骤操作完成后,进入后台首页点击【清空缓存并重新编译模板】即可。
边栏推荐
- Istio FAQ: sidecar stop sequence
- Sigai intelligent container damage identification products are deployed in Rizhao Port and Yingkou Port
- Tencent cloud database mysql:sql flow restriction
- Nonholonomic constrained robot
- How does easydss, an online classroom / online medical live on demand platform, separate audio and video data?
- Handling of communication failure between kuberbetes pod
- Talk about some good ways to participate in the project
- Istio FAQ: virtualservice route matching sequence
- Development trend of CAE simulation analysis software
- One Minute! No code! Add [statistical analysis] to the website
猜你喜欢

A survey on dynamic neural networks for natural language processing, University of California
![[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)

Some adventurer hybrid versions with potential safety hazards will be recalled
![[go] concurrent programming channel](/img/6a/d62678467bbc6dfb6a50ae42bacc96.jpg)
[go] concurrent programming channel

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

Applet - use of template

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

Problems encountered in the work of product manager

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

There are potential safety hazards Land Rover recalls some hybrid vehicles
随机推荐
Nonholonomic constrained robot
An error is reported during SVN uploading -svn sqlite[s13]
Istio FAQ: sidecar stop sequence
Video intelligent analysis platform easycvr derivative video management platform menu bar small screen adaptive optimization
Page scrolling effect library, a little skinny
[go] concurrent programming channel
Mathematics in machine learning -- point estimation (IV): maximum posteriori probability (map)
Applet wxss
Object store signature generation
Where is the most formal and safe account opening for speculation futures? How to open a futures account?
05. Tencent cloud IOT device side learning -- mqtt protocol client implementation
Clickhouse high performance column storage core principle
Comparison of jmeter/k6/locust pressure measuring tools (not completed yet)
The million bonus competition is about to start, and Ti-One will be upgraded to help you win the championship!
Introduction to website development for zero foundation Xiaobai
CDs view permission check
【Prometheus】2. Overview and deployment
Load MySQL table data consumption quick installation configuration through kafka/flink
Istio FAQ: sidecar startup sequence
How to customize the log output format of zap?