• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP cmsPage类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中cmsPage的典型用法代码示例。如果您正苦于以下问题:PHP cmsPage类的具体用法?PHP cmsPage怎么用?PHP cmsPage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了cmsPage类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: mod_blogs

function mod_blogs($module_id, $cfg)
{
    $inDB = cmsDatabase::getInstance();
    $default_cfg = array('sort' => 'pubdate', 'owner' => 'user', 'shownum' => 5, 'minrate' => 0, 'blog_id' => 0, 'showrss' => 1);
    $cfg = array_merge($default_cfg, $cfg);
    cmsCore::loadClass('blog');
    $inBlog = cmsBlogs::getInstance();
    $inBlog->owner = $cfg['owner'];
    if ($cfg['owner'] == 'club') {
        cmsCore::loadModel('clubs');
        $model = new cms_model_clubs();
        $inDB->addSelect('b.user_id as bloglink');
    } else {
        cmsCore::loadModel('blogs');
        $model = new cms_model_blogs();
    }
    // получаем аватары владельцев
    $inDB->addSelect('up.imageurl');
    $inDB->addJoin('LEFT JOIN cms_user_profiles up ON up.user_id = u.id');
    $inBlog->whereOnlyPublic();
    if ($cfg['minrate']) {
        $inBlog->ratingGreaterThan($cfg['minrate']);
    }
    if ($cfg['blog_id']) {
        $inBlog->whereBlogIs($cfg['blog_id']);
    }
    $inDB->orderBy('p.' . $cfg['sort'], 'DESC');
    $inDB->limit($cfg['shownum']);
    $posts = $inBlog->getPosts(false, $model);
    if (!$posts) {
        return false;
    }
    cmsPage::initTemplate('modules', 'mod_blogs')->assign('posts', $posts)->assign('cfg', $cfg)->display('mod_blogs.tpl');
    return true;
}
开发者ID:4uva4ek,项目名称:svato,代码行数:35,代码来源:module.php


示例2: mod_user_image

function mod_user_image($mod, $cfg) {
    $sql = "SELECT u.id uid, u.nickname author, u.login as login, p.imageurl, p.title, p.id, pr.gender gender
            FROM cms_user_photos p
            LEFT JOIN cms_users u ON u.id = p.user_id
            LEFT JOIN cms_user_profiles pr ON pr.user_id = u.id
            LEFT JOIN cms_user_albums a ON a.id = p.album_id
            WHERE p.allow_who = 'all' AND u.is_deleted = 0 AND u.is_locked = 0
                  AND p.album_id > 0 AND a.allow_who = 'all'
            ORDER BY RAND()
            LIMIT 1";

    $result = cmsCore::c('db')->query($sql) ;

    if (!cmsCore::c('db')->num_rows($result)) { return false; }

    while ($usr = cmsCore::c('db')->fetch_assoc($result)) {
        $usr['genderlink'] = cmsUser::getGenderLink($usr['uid'], $usr['author'], $usr['gender'], $usr['login']);
        $users[] = $usr;
    }

    cmsPage::initTemplate('modules', $cfg['tpl'])->
        assign('users', $users)->
        assign('cfg', $cfg)->
        display();

    return true;
}
开发者ID:Acsac,项目名称:CMS-RuDi,代码行数:27,代码来源:module.php


示例3: f_pages

function f_pages(&$text)
{
    if (mb_strpos($text, 'pagebreak') === false) {
        return true;
    }
    $seolink = urldecode(cmsCore::request('seolink', 'str', ''));
    $seolink = preg_replace('/[^a-zа-я-яёіїєґА-ЯЁІЇЄҐ0-9_\\/\\-]/ui', '', $seolink);
    if (!$seolink) {
        return true;
    }
    $regex = '/{(pagebreak)\\s*(.*?)}/iu';
    $pages = preg_split($regex, $text);
    $n = count($pages);
    if ($n <= 1) {
        return true;
    } else {
        $page = cmsCore::request('page', 'int', 1);
        $text = $pages[$page - 1];
        if (!$text) {
            cmsCore::error404();
        }
        cmsCore::loadModel('content');
        $text .= cmsPage::getPagebar($n, $page, 1, cms_model_content::getArticleURL(null, $seolink, '%page%'));
        return true;
    }
}
开发者ID:vicktorwork,项目名称:cms1,代码行数:26,代码来源:filter.php


示例4: mod_dt_newsslider

function mod_dt_newsslider($module_id, $cfg)
{
    $inDB = cmsDatabase::getInstance();
    cmsCore::loadModel('content');
    $model = new cms_model_content();
    if (!isset($cfg['cat_id'])) {
        $cfg['cat_id'] = 1;
    }
    if ($cfg['cat_id']) {
        if (!$cfg['subs']) {
            $model->whereCatIs($cfg['cat_id']);
        } else {
            $rootcat = $inDB->getNsCategory('cms_category', $cfg['cat_id']);
            if (!$rootcat) {
                return false;
            }
            $model->whereThisAndNestedCats($rootcat['NSLeft'], $rootcat['NSRight']);
        }
    }
    $inDB->orderBy('con.ordering', 'ASC');
    $inDB->limit($cfg['newscount']);
    $slider_list = $model->getArticlesList();
    if (!$slider_list) {
        return false;
    }
    cmsPage::initTemplate('modules', 'mod_dt_newsslider')->assign('slider', $slider_list)->assign('cfg', $cfg)->assign('module_id', $module_id)->display('mod_dt_newsslider.tpl');
    return true;
}
开发者ID:vicktorwork,项目名称:cms1,代码行数:28,代码来源:module.php


示例5: mod_whoonline

function mod_whoonline($module_id, $cfg)
{
    $inDB = cmsDatabase::getInstance();
    if (!isset($cfg['color_admin'])) {
        $cfg['color_admin'] = '#FF0000';
    }
    if (!isset($cfg['color_editor'])) {
        $cfg['color_editor'] = '#009900';
    }
    $online_count = cmsUser::getOnlineCount();
    $users = array();
    $today_users = array();
    if ($online_count['users']) {
        $sql = "SELECT\n                o.user_id as id,\n                u.login,\n                u.nickname,\n                p.gender as gender\n                FROM cms_online o\n                LEFT JOIN cms_users u ON  u.id = o.user_id\n                LEFT JOIN cms_user_profiles p ON p.user_id = u.id\n                WHERE u.is_locked = 0 AND u.is_deleted = 0\n                GROUP BY o.user_id";
        $result = $inDB->query($sql);
        $users = getUsersArray($result, $cfg, $inDB);
    }
    if ($cfg['show_today']) {
        $today = date("Y-m-d");
        $sql = "SELECT u.id as id, u.nickname as nickname, u.login as login, p.gender as gender\n                FROM cms_users u\n                LEFT JOIN cms_user_profiles p ON p.user_id = u.id\n                WHERE u.is_locked = 0 AND u.is_deleted = 0 AND DATE_FORMAT(u.logdate, '%Y-%m-%d')='{$today}'\n                ORDER BY u.logdate DESC";
        $result = $inDB->query($sql);
        if ($inDB->num_rows($result)) {
            $today_users = getUsersArray($result, $cfg, $inDB);
        }
    }
    cmsPage::initTemplate('modules', 'mod_whoonline')->assign('cfg', $cfg)->assign('users', $users)->assign('guests', $online_count['guests'])->assign('today_users', $today_users)->display('mod_whoonline.tpl');
    return true;
}
开发者ID:4uva4ek,项目名称:svato,代码行数:28,代码来源:module.php


示例6: mod_bestcontent

function mod_bestcontent($mod, $cfg)
{
    $inDB = cmsDatabase::getInstance();
    cmsCore::loadModel('content');
    $model = new cms_model_content();
    if (!isset($cfg['shownum'])) {
        $cfg['shownum'] = 5;
    }
    if (!isset($cfg['subs'])) {
        $cfg['subs'] = 1;
    }
    if (!isset($cfg['cat_id'])) {
        $cfg['cat_id'] = 1;
    }
    $inDB->where("con.canrate = 1");
    if ($cfg['cat_id']) {
        if (!$cfg['subs']) {
            //выбираем из категории
            $model->whereCatIs($cfg['cat_id']);
        } else {
            //выбираем из категории и подкатегорий
            $rootcat = $inDB->getNsCategory('cms_category', $cfg['cat_id']);
            if (!$rootcat) {
                return false;
            }
            $model->whereThisAndNestedCats($rootcat['NSLeft'], $rootcat['NSRight']);
        }
    }
    $inDB->orderBy('con.rating', 'DESC');
    $inDB->limitPage(1, $cfg['shownum']);
    $content_list = $model->getArticlesList();
    cmsPage::initTemplate('modules', $cfg['tpl'])->assign('articles', $content_list)->assign('cfg', $cfg)->display($cfg['tpl']);
    return true;
}
开发者ID:deltas1,项目名称:icms1,代码行数:34,代码来源:module.php


示例7: mod_forum

function mod_forum($mod, $cfg)
{
    $inDB = cmsDatabase::getInstance();
    $default_cfg = array('shownum' => 4, 'cat_id' => 0, 'forum_id' => 0, 'subs' => 0, 'show_hidden' => 0, 'show_pinned' => 0, 'showtext' => 1, 'showforum' => 0, 'order' => 'pubdate');
    $cfg = array_merge($default_cfg, $cfg);
    cmsCore::loadModel('forum');
    $model = new cms_model_forum();
    $inDB->addJoin('INNER JOIN cms_forums f ON f.id = t.forum_id');
    $inDB->addSelect('f.title as forum_title');
    if ($cfg['cat_id']) {
        $model->whereForumCatIs($cfg['cat_id']);
    }
    if ($cfg['forum_id']) {
        if ($cfg['subs']) {
            $forum = $model->getForum($cfg['forum_id']);
            if (!$forum) {
                return false;
            }
            $model->whereThisAndNestedForum($forum['NSLeft'], $forum['NSRight']);
        } else {
            $model->whereForumIs($cfg['forum_id']);
        }
    }
    if (!$cfg['show_hidden']) {
        $model->wherePublicThreads();
    }
    if ($cfg['show_pinned']) {
        $model->wherePinnedThreads();
    }
    $inDB->orderBy('t.' . $cfg['order'], 'DESC');
    $inDB->limit($cfg['shownum']);
    $threads = $model->getThreads();
    cmsPage::initTemplate('modules', $cfg['tpl'])->assign('threads', $threads)->assign('cfg', $cfg)->display($cfg['tpl']);
    return true;
}
开发者ID:deltas1,项目名称:icms1,代码行数:35,代码来源:module.php


示例8: mod_user_friend

function mod_user_friend($mod, $cfg)
{
    $inDB = cmsDatabase::getInstance();
    $inUser = cmsUser::getInstance();
    if (!$inUser->id) {
        return false;
    }
    if ($cfg['view_type'] == 'table') {
        $sql = "SELECT\r\n                CASE\r\n                WHEN f.from_id = {$inUser->id}\r\n                THEN f.to_id\r\n                WHEN f.to_id = {$inUser->id}\r\n                THEN f.from_id\r\n                END AS user_id, u.login, u.nickname, u.is_deleted, p.imageurl\r\n                FROM cms_user_friends f\r\n                INNER JOIN cms_online o ON o.user_id = CASE WHEN f.from_id = {$inUser->id} THEN f.to_id WHEN f.to_id = {$inUser->id} THEN f.from_id END\r\n                LEFT JOIN cms_users u ON u.id = o.user_id\r\n                LEFT JOIN cms_user_profiles p ON p.user_id = u.id\r\n                WHERE (from_id = {$inUser->id} OR to_id = {$inUser->id}) AND is_accepted =1 LIMIT " . $cfg['limit'];
    } else {
        $sql = "SELECT\r\n                CASE\r\n                WHEN f.from_id = {$inUser->id}\r\n                THEN f.to_id\r\n                WHEN f.to_id = {$inUser->id}\r\n                THEN f.from_id\r\n                END AS user_id, u.login, u.nickname\r\n                FROM cms_user_friends f\r\n                INNER JOIN cms_online o ON o.user_id = CASE WHEN f.from_id = {$inUser->id} THEN f.to_id WHEN f.to_id = {$inUser->id} THEN f.from_id END\r\n                LEFT JOIN cms_users u ON u.id = o.user_id\r\n                WHERE (from_id = {$inUser->id} OR to_id = {$inUser->id}) AND is_accepted =1 LIMIT " . $cfg['limit'];
    }
    $result = $inDB->query($sql);
    $total = $inDB->num_rows($result);
    if ($total) {
        $friends = array();
        while ($friend = $inDB->fetch_assoc($result)) {
            $friend['avatar'] = $cfg['view_type'] == 'table' ? cmsUser::getUserAvatarUrl($friend['user_id'], 'small', $friend['imageurl'], $friend['is_deleted']) : false;
            $friend['user_link'] = cmsUser::getProfileLink($friend['login'], $friend['nickname']);
            $friends[$friend['user_id']] = $friend;
        }
    }
    cmsPage::initTemplate('modules', $cfg['tpl'])->assign('friends', $friends)->assign('total', $total)->assign('cfg', $cfg)->display($cfg['tpl']);
    return true;
}
开发者ID:deltas1,项目名称:icms1,代码行数:25,代码来源:module.php


示例9: insertSlider

 private function insertSlider($images, $title) {
     return cmsPage::initTemplate('plugins', 'p_content_imgs_'. $this->config['slider_name'])->
         assign('images', $images)->
         assign('title', $title)->
         assign('slider_mode', $this->config['slider_mode'])->
         fetch();
 }
开发者ID:Acsac,项目名称:CMS-RuDi,代码行数:7,代码来源:plugin.php


示例10: mod_pogoda_current

function mod_pogoda_current($mod, $cfg)
{
    $inCore = cmsCore::getInstance();
    //Загрузка настроек компонента
    $component = $inCore->loadComponentConfig('pogoda');
    $component["name_en"] = $component["name_en"] ? $component["name_en"] . '_' : '';
    // Проверяем включен ли компонент и установлен ли city_id
    if (!$component['component_enabled'] || !$component['city_id']) {
        return false;
    }
    cmsCore::loadModel('pogoda');
    $model = new cms_model_pogoda();
    $model->setTable('current');
    $dbWeather = $model->getWeather();
    $xml = simplexml_load_string($dbWeather["xml"]);
    if (!$xml) {
        return true;
    }
    $current = array();
    $current["temperature"] = round($xml->temperature["value"]) . ' &#176;C';
    $current["weather"]["value"] = $xml->weather["value"];
    $current["weather"]["icon"] = $xml->weather["icon"];
    cmsPage::initTemplate('modules', $cfg['tpl'])->assign('current', $current)->display($cfg['tpl']);
    return true;
}
开发者ID:roman-burachenko,项目名称:icms1_com_pogoda,代码行数:25,代码来源:module.php


示例11: mod_actions

function mod_actions($mod, $cfg) {
    global $_LANG;
    
    if (!isset($cfg['action_types'])) {
        echo $_LANG['MODULE_NOT_CONFIGURED'];
        return true;
    }
    
    $cfg = array_merge(
        array(
            'show_target' => 1,
            'limit' => 15,
            'show_link' => 1
        ),
        $cfg
    );
    
    if (!$cfg['show_target']) {
        cmsCore::c('actions')->showTargets(false);
    }

    cmsCore::c('actions')->onlySelectedTypes($cfg['action_types']);
    cmsCore::c('db')->limitIs($cfg['limit']);
    
    $actions = cmsCore::c('actions')->getActionsLog();
    if (!$actions) { return false; }

    cmsPage::initTemplate('modules', $cfg['tpl'])->
        assign('actions', $actions)->
        assign('cfg', $cfg)->
        assign('user_id', cmsCore::c('user')->id)->
        display();

    return true;
}
开发者ID:Acsac,项目名称:CMS-RuDi,代码行数:35,代码来源:module.php


示例12: mod_actions

function mod_actions(array $mod, $cfg)
{
    $inDB = cmsDatabase::getInstance();
    $inActions = cmsActions::getInstance();
    global $_LANG;
    if (!isset($cfg['show_target'])) {
        $cfg['show_target'] = 1;
    }
    if (!isset($cfg['limit'])) {
        $cfg['limit'] = 15;
    }
    if (!isset($cfg['show_link'])) {
        $cfg['show_link'] = 1;
    }
    if (!isset($cfg['action_types'])) {
        echo $_LANG['MODULE_NOT_CONFIGURED'];
        return true;
    }
    if (!$cfg['show_target']) {
        $inActions->showTargets(false);
    }
    $inActions->onlySelectedTypes($cfg['action_types']);
    $inDB->limitIs($cfg['limit']);
    $actions = $inActions->getActionsLog();
    if (!$actions) {
        return false;
    }
    cmsPage::initTemplate('modules', $cfg['tpl'])->assign('actions', $actions)->assign('cfg', $cfg)->assign('user_id', cmsUser::getInstance()->id)->display($cfg['tpl']);
    return true;
}
开发者ID:deltas1,项目名称:icms1,代码行数:30,代码来源:module.php


示例13: mod_menu

function mod_menu($mod, $cfg)
{
    $inCore = cmsCore::getInstance();
    $inUser = cmsUser::getInstance();
    $menuid = $inCore->menuId();
    $full_menu = $inCore->getMenuStruct();
    $current_uri = '/' . $inCore->getUri();
    if (!isset($cfg['menu'])) {
        $menu = 'mainmenu';
    } else {
        $menu = $cfg['menu'];
    }
    if (!isset($cfg['show_home'])) {
        $cfg['show_home'] = 1;
    }
    if (!isset($cfg['is_sub_menu'])) {
        $cfg['is_sub_menu'] = 0;
    }
    // текущий пункт меню
    $currentmenu = isset($full_menu[$menuid]) ? $full_menu[$menuid] : array();
    // результирующий массив меню
    $items = array();
    // id корня меню если обычный вывод меню, $menuid если режим подменю
    if ($cfg['is_sub_menu']) {
        // в подменю не должно быть ссылки на главную
        $cfg['show_home'] = 0;
        // на главной или нет активного пункта меню
        if ($menuid == 1 || !$currentmenu) {
            return false;
        }
        foreach ($full_menu as $item) {
            if ($item['NSLeft'] > $currentmenu['NSLeft'] && $item['NSRight'] < $currentmenu['NSRight'] && in_array($menu, $item['menu']) && ($item['is_lax'] || cmsCore::checkContentAccess($item['access_list'], false)) && $item['published']) {
                $item['link'] = cmsUser::stringReplaceUserProperties($item['link']);
                $item['title'] = cmsUser::stringReplaceUserProperties($item['title'], true);
                $items[] = $item;
                // массивы для сортировки
                $nsl[] = $item['NSLeft'];
                $ord[] = $item['ordering'];
            }
        }
    } else {
        foreach ($full_menu as $item) {
            if (in_array($menu, $item['menu']) && ($item['is_lax'] || cmsCore::checkContentAccess($item['access_list'], false)) && $item['published']) {
                $item['link'] = cmsUser::stringReplaceUserProperties($item['link']);
                $item['title'] = cmsUser::stringReplaceUserProperties($item['title'], true);
                $items[] = $item;
                // массивы для сортировки
                $nsl[] = $item['NSLeft'];
                $ord[] = $item['ordering'];
            }
        }
    }
    if (!$items) {
        return false;
    }
    // сортируем массив
    array_multisort($nsl, SORT_ASC, $ord, SORT_ASC, $items);
    cmsPage::initTemplate('modules', $cfg['tpl'])->assign('menuid', $menuid)->assign('currentmenu', $currentmenu)->assign('current_uri', $current_uri)->assign('menu', $menu)->assign('items', $items)->assign('last_level', 0)->assign('user_id', $inUser->id)->assign('is_admin', $inUser->is_admin)->assign('cfg', $cfg)->display($cfg['tpl']);
    return true;
}
开发者ID:r2git,项目名称:icms1,代码行数:60,代码来源:module.php


示例14: __construct

 public function __construct()
 {
     cmsCore::loadClass('page');
     $this->inCore = cmsCore::getInstance();
     $this->inDB = cmsDatabase::getInstance();
     $this->inPage = cmsPage::getInstance();
 }
开发者ID:4uva4ek,项目名称:svato,代码行数:7,代码来源:plugin.class.php


示例15: mod_category

function mod_category($mod, $cfg)
{
    $inDB = cmsDatabase::getInstance();
    cmsCore::loadModel('content');
    $model = new cms_model_content();
    if (!isset($cfg['category_id'])) {
        $cfg['category_id'] = 0;
    }
    if (!isset($cfg['show_subcats'])) {
        $cfg['show_subcats'] = 1;
    }
    if (!isset($cfg['expand_all'])) {
        $cfg['expand_all'] = 1;
    }
    $rootcat = $inDB->getNsCategory('cms_category', $cfg['category_id']);
    if (!$rootcat) {
        return false;
    }
    $subcats_list = $model->getSubCats($rootcat['id'], $cfg['show_subcats'], $rootcat['NSLeft'], $rootcat['NSRight']);
    if (!$subcats_list) {
        return false;
    }
    $current_seolink = urldecode(cmsCore::request('seolink', 'str', ''));
    cmsPage::initTemplate('modules', $cfg['tpl'])->assign('cfg', $cfg)->assign('current_seolink', $current_seolink)->assign('subcats_list', $subcats_list)->display($cfg['tpl']);
    return true;
}
开发者ID:deltas1,项目名称:icms1,代码行数:26,代码来源:module.php


示例16: mod_cart

function mod_cart($module_id, $cfg)
{
    $inDB = cmsDatabase::getInstance();
    $inUser = cmsUser::getInstance();
    cmsCore::includeFile('components/catalog/includes/shopcore.php');
    $sid = session_id();
    $items = array();
    $total_summ = 0;
    $user_sql = $inUser->id ? "c.user_id='{$inUser->id}'" : "c.session_id='{$sid}'";
    $sql = "SELECT i.title, i.price, i.category_id, i.id, c.itemscount\n            FROM cms_uc_cart c\n            INNER JOIN cms_uc_items i ON i.id = c.item_id\n            WHERE {$user_sql}";
    $result = $inDB->query($sql);
    $items_count = $inDB->num_rows($result);
    if ($items_count) {
        while ($con = $inDB->fetch_assoc($result)) {
            $price = shopDiscountPrice($con['id'], $con['category_id'], $con['price']);
            $totalcost = $con['itemscount'] * $price;
            $total_summ += $totalcost;
            $con['price'] = number_format($price, 2, '.', ' ');
            $con['totalcost'] = number_format($totalcost, 2, '.', ' ');
            $items[] = $con;
        }
    }
    cmsPage::initTemplate('modules', 'mod_cart')->assign('cfg', $cfg)->assign('items_count', $items_count)->assign('total_summ', number_format($total_summ, 2, '.', ' '))->assign('items', $items)->display('mod_cart.tpl');
    return true;
}
开发者ID:4uva4ek,项目名称:svato,代码行数:25,代码来源:module.php


示例17: mod_category

function mod_category($mod, $cfg) {
    $cfg = array_merge(
        array(
            'category_id'  => 0,
            'show_subcats' => 1,
            'expand_all'   => 1
        ),
        $cfg
    );
    
    $rootcat = cmsCore::c('db')->getNsCategory('cms_category', $cfg['category_id']);
    if (!$rootcat) { return false; }

    $subcats_list = cmsCore::m('content')->getSubCats($rootcat['id'], $cfg['show_subcats'], $rootcat['NSLeft'], $rootcat['NSRight']);
    
    if (!$subcats_list) { return false; }

    $current_seolink = urldecode(cmsCore::request('seolink', 'str', ''));

    cmsPage::initTemplate('modules', $cfg['tpl'])->
        assign('cfg', $cfg)->
        assign('current_seolink', $current_seolink)->
        assign('subcats_list', $subcats_list)->
        display();

    return true;
}
开发者ID:Acsac,项目名称:CMS-RuDi,代码行数:27,代码来源:module.php


示例18: mod_clubs

function mod_clubs($module_id, $cfg)
{
    $inDB = cmsDatabase::getInstance();
    if (!isset($cfg['count'])) {
        $cfg['count'] = 5;
    }
    if (!isset($cfg['type'])) {
        $cfg['type'] = 'id';
    }
    if (!isset($cfg['vip_on_top'])) {
        $cfg['vip_on_top'] = 1;
    }
    cmsCore::loadModel('clubs');
    $model = new cms_model_clubs();
    if ($cfg['vip_on_top']) {
        $inDB->orderBy('is_vip', 'DESC, c.' . $cfg['type'] . ' DESC');
    } else {
        $inDB->orderBy('c.' . $cfg['type'], 'DESC');
    }
    $inDB->limit($cfg['count']);
    $clubs = $model->getClubs();
    if (!$clubs) {
        return false;
    }
    cmsPage::initTemplate('modules', 'mod_clubs')->assign('clubs', $clubs)->display('mod_clubs.tpl');
    return true;
}
开发者ID:4uva4ek,项目名称:svato,代码行数:27,代码来源:module.php


示例19: mod_latest_faq

function mod_latest_faq($module_id, $cfg)
{
    $inDB = cmsDatabase::getInstance();
    if (!isset($cfg['newscount'])) {
        $cfg['newscount'] = 2;
    }
    if (!isset($cfg['cat_id'])) {
        $cfg['cat_id'] = 0;
    }
    if (!isset($cfg['maxlen'])) {
        $cfg['maxlen'] = 120;
    }
    if ($cfg['cat_id']) {
        $catsql = 'AND category_id = ' . $cfg['cat_id'];
    } else {
        $catsql = '';
    }
    $sql = "SELECT *\n            FROM cms_faq_quests\n            WHERE published = 1 " . $catsql . "\n            ORDER BY pubdate DESC\n            LIMIT " . $cfg['newscount'];
    $result = $inDB->query($sql);
    $faq = array();
    if ($inDB->num_rows($result)) {
        while ($con = $inDB->fetch_assoc($result)) {
            $con['date'] = cmsCore::dateFormat($con['pubdate']);
            $con['href'] = '/faq/quest' . $con['id'] . '.html';
            $faq[] = $con;
        }
    }
    cmsPage::initTemplate('modules', 'mod_latest_faq')->assign('faq', $faq)->assign('cfg', $cfg)->display('mod_latest_faq.tpl');
    return true;
}
开发者ID:4uva4ek,项目名称:svato,代码行数:30,代码来源:module.php


示例20: mod_clubs

function mod_clubs($mod, $cfg) {
    $cfg = array_merge(array(
        'count'      => 5,
        'type'       => 'id',
        'vip_on_top' => 1
    ), $cfg);

    if ($cfg['vip_on_top']) {
        cmsCore::c('db')->orderBy('is_vip', 'DESC, c.'. $cfg['type'] .' DESC');
    } else {
        cmsCore::c('db')->orderBy('c.'. $cfg['type'], 'DESC');
    }
    
    cmsCore::c('db')->limit($cfg['count']);

    $clubs = cmsCore::m('clubs')->getClubs();
    
    if (!$clubs) { return false; }

    cmsPage::initTemplate('modules', $cfg['tpl'])->
        assign('clubs', $clubs)->
        display();

    return true;
}
开发者ID:Acsac,项目名称:CMS-RuDi,代码行数:25,代码来源:module.php



注:本文中的cmsPage类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP cmsTemplate类代码示例发布时间:2022-05-23
下一篇:
PHP cmsModel类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap