⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 block.mtentrieswithsubcategories.php

📁 1. 记录每个帖子的访问人情况
💻 PHP
字号:
<?phpfunction smarty_block_MTEntriesWithSubCategories($args, $content, &$ctx, &$repeat) {    $localvars = array('entries');    if (!isset($content)) {        if (isset($args['category'])) {            $kids = $ctx->mt->db->fetch_categories(array('blog_id' => $ctx->stash('blog_id'), 'label' => $args['category']));        } else {            $cat = $ctx->stash('category') or                   $ctx->stash('archive_category');            if ($cat)                $kids = array($cat);        }        if ($kids) {            $cats = array();            while ($c = array_shift($kids)) {                $cats[] = $c['category_label'];                $children = $ctx->mt->db->fetch_categories(array('category_id' => $c['category_id'], 'children' => 1));                if ($children)                    $kids = array_merge($kids, $children);            }            $args['category'] = implode(' OR ', $cats);            $ctx->localize($localvars);            $ctx->stash('entries', null);            require_once("block.MTEntries.php");        } else {            $repeat = false;            return '';        }    }    $output = smarty_block_MTEntries($args, $content, $ctx, $repeat);    if (!$repeat)        $ctx->restore($localvars);    return $output;}?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -