当前位置: 首页>>代码示例>>PHP>>正文


PHP cmsPage::getPagebar方法代码示例

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


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

示例1: 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

示例2: mod_latest

function mod_latest($module_id, $cfg)
{
    $inDB = cmsDatabase::getInstance();
    cmsCore::loadModel('content');
    $model = new cms_model_content();
    if (!isset($cfg['showrss'])) {
        $cfg['showrss'] = 1;
    }
    if (!isset($cfg['subs'])) {
        $cfg['subs'] = 1;
    }
    if (!isset($cfg['cat_id'])) {
        $cfg['cat_id'] = 1;
    }
    if (!isset($cfg['newscount'])) {
        $cfg['newscount'] = 5;
    }
    if (!isset($cfg['is_pag'])) {
        $cfg['is_pag'] = 0;
    }
    if (!isset($cfg['page'])) {
        $cfg['page'] = 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->where("con.showlatest = 1");
    if ($cfg['is_pag']) {
        $total = $model->getArticlesCount();
    }
    $inDB->orderBy('con.pubdate', 'DESC');
    $inDB->limitPage($cfg['page'], $cfg['newscount']);
    $content_list = $model->getArticlesList();
    if (!$content_list) {
        return false;
    }
    $pagebar = $cfg['is_pag'] ? cmsPage::getPagebar($total, $cfg['page'], $cfg['newscount'], 'javascript:conPage(%page%, ' . $module_id . ')') : '';
    cmsPage::initTemplate('modules', 'mod_latest')->assign('articles', $content_list)->assign('pagebar_module', $pagebar)->assign('module_id', $module_id)->assign('cfg', $cfg)->display('mod_latest.tpl');
    return true;
}
开发者ID:4uva4ek,项目名称:svato,代码行数:50,代码来源:module.php

示例3: applet_main

function applet_main()
{
    $inCore = cmsCore::getInstance();
    global $_LANG;
    cmsCore::c('page')->setTitle($_LANG['PATH_HOME']);
    $new = array();
    $tpl = cmsCore::c('page')->initTemplate('applets', 'main')->assign('users_count', cmsCore::c('db')->rows_count('cms_users', 'is_deleted=0'))->assign('today_users_count', (int) cmsCore::c('db')->get_field('cms_users', "DATE_FORMAT(regdate, '%d-%m-%Y') = DATE_FORMAT(NOW(), '%d-%m-%Y') AND is_deleted = 0", 'COUNT(id)'))->assign('week_users_count', (int) cmsCore::c('db')->get_field('cms_users', "regdate >= DATE_SUB(NOW(), INTERVAL 7 DAY)", 'COUNT(id)'))->assign('month_users_count', (int) cmsCore::c('db')->get_field('cms_users', "regdate >= DATE_SUB(NOW(), INTERVAL 1 MONTH)", 'COUNT(id)'))->assign('people', cmsUser::getOnlineCount());
    if ($inCore->isComponentEnable('content')) {
        $tpl->assign('content_enable', true);
        $new['content'] = (int) newContent('cms_content');
    }
    if ($inCore->isComponentEnable('photos')) {
        $tpl->assign('photos_enable', true);
        $new['photos'] = (int) newContent('cms_photo_files');
    }
    if ($inCore->isComponentEnable('video')) {
        $tpl->assign('video_enable', true);
        $new['video'] = (int) newContent('cms_video_movie');
    }
    if ($inCore->isComponentEnable('maps')) {
        $tpl->assign('maps_enable', true);
        $new['maps'] = (int) newContent('cms_map_items');
    }
    if ($inCore->isComponentEnable('faq')) {
        $tpl->assign('faq_enable', true);
        $new['faq'] = (int) newContent('cms_faq_quests');
    }
    if ($inCore->isComponentEnable('board')) {
        $tpl->assign('board_enable', true);
        $new['board'] = (int) newContent('cms_board_items');
    }
    if ($inCore->isComponentEnable('catalog')) {
        $tpl->assign('catalog_enable', true);
        $new['catalog'] = (int) newContent('cms_uc_items');
    }
    if ($inCore->isComponentEnable('forum')) {
        $tpl->assign('forum_enable', true);
        $new['forum'] = (int) newContent('cms_forum_posts');
    }
    cmsCore::c('actions')->showTargets(true);
    $total = cmsCore::c('actions')->getCountActions();
    cmsCore::c('db')->limitPage(1, 10);
    $actions_html = cmsCore::c('page')->initTemplate('components', 'actions_list')->assign('actions', cmsCore::c('actions')->getActionsLog())->assign('pagebar', cmsPage::getPagebar($total, 1, 10, '#" onclick="$.post(\'/admin/ajax/getActions.php\', \'page=%page%\', function(m){ $(\'#actions\').html(m); }); return false'))->fetch();
    $tpl->assign('new', $new)->assign('rssfeed_installed', $inCore->isComponentInstalled('rssfeed'))->assign('actions_html', $actions_html)->assign('new_quests', cmsCore::c('db')->rows_count('cms_faq_quests', 'published = 0'))->assign('new_content', cmsCore::c('db')->rows_count('cms_content', 'published = 0 AND is_arhive = 0'))->assign('new_catalog', cmsCore::c('db')->rows_count('cms_uc_items', 'on_moderate = 1'))->display();
}
开发者ID:CMS-RuDi,项目名称:CMS-RuDi,代码行数:45,代码来源:main.php

示例4: mod_latest

function mod_latest($mod, $cfg) {
    $cfg = array_merge(array(
        'showrss'  => 1,
        'subs'     => 1,
        'cat_id'   => 1,
        'newscount'=> 5,
        'is_pag'   => 0,
        'page'     => 1
    ),$cfg);

    if ($cfg['cat_id']) {
        if (!$cfg['subs']) {
            //выбираем из категории
            cmsCore::m('content')->whereCatIs($cfg['cat_id']);
        } else {
            //выбираем из категории и подкатегорий
            $rootcat = cmsCore::c('db')->getNsCategory('cms_category', $cfg['cat_id']);
            if (!$rootcat) { return false; }
            cmsCore::m('content')->whereThisAndNestedCats($rootcat['NSLeft'], $rootcat['NSRight']);
        }
    }

    cmsCore::c('db')->where("con.showlatest = 1");

    if ($cfg['is_pag']) {
        $total = cmsCore::m('content')->getArticlesCount();
    }

    cmsCore::c('db')->orderBy('con.pubdate', 'DESC');
    cmsCore::c('db')->limitPage($cfg['page'], $cfg['newscount']);

    $content_list = cmsCore::m('content')->getArticlesList();
    if (!$content_list) { return false; }

    $pagebar = $cfg['is_pag'] ? cmsPage::getPagebar($total, $cfg['page'], $cfg['newscount'], 'javascript:conPage(%page%, '. $mod['id'] .')') : '';

    cmsPage::initTemplate('modules', $cfg['tpl'])->
        assign('articles', $content_list)->
        assign('pagebar_module', $pagebar)->
        assign('module_id', $mod['id'])->
        assign('cfg', $cfg)->
        display();

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

示例5: users


//.........这里部分代码省略.........
        if ($age_to) {
            $model->whereAgeTo($age_to);
            $stext[] = $_LANG['NOT_OLD'] . " {$age_fr} " . $_LANG['YEARS'];
        }
        // Считаем общее количество согласно выборки
        $total = $model->getUsersCount($only_online);
        if ($total) {
            //устанавливаем сортировку
            $inDB->orderBy($orderby, $orderto);
            //устанавливаем номер текущей страницы и кол-во пользователей на странице
            $inDB->limitPage($page, $model->config['users_perpage']);
            // Загружаем пользователей согласно выборки
            $users = $model->getUsers($only_online);
        } else {
            $inDB->resetConditions();
        }
        $link['latest'] = '/users';
        $link['positive'] = '/users/positive.html';
        $link['rating'] = '/users/rating.html';
        if ($orderby == 'regdate') {
            $link['selected'] = 'latest';
        }
        if ($orderby == 'karma') {
            $link['selected'] = 'positive';
        }
        if ($orderby == 'rating') {
            $link['selected'] = 'rating';
        }
        $pagebar_link = '/users/' . $link['selected'] . '%page%.html';
        if ($group_id) {
            $link['selected'] = 'group';
            $pagebar_link = '/users/' . $link['selected'] . '/' . $group_id . '-%page%';
        }
        cmsPage::initTemplate('components', 'com_users_view')->assign('stext', $stext)->assign('orderby', $orderby)->assign('orderto', $orderto)->assign('users', $users)->assign('total', $total)->assign('only_online', $only_online)->assign('gender', $gender)->assign('name', stripslashes($name))->assign('city', stripslashes($city))->assign('hobby', stripslashes($hobby))->assign('age_to', $age_to)->assign('age_fr', $age_fr)->assign('cfg', $model->config)->assign('link', $link)->assign('pagebar', cmsPage::getPagebar($total, $page, $model->config['users_perpage'], $pagebar_link))->display('com_users_view.tpl');
    }
    //============================================================================//
    //======================= Редактирование профиля  ============================//
    //============================================================================//
    if ($do == 'editprofile') {
        // неавторизованным, не владельцам и не админам тут делать нечего
        if (!$inUser->id || $inUser->id != $id && !$inUser->is_admin) {
            cmsCore::error404();
        }
        $usr = $model->getUser($id);
        if (!$usr) {
            cmsCore::error404();
        }
        $opt = cmsCore::request('opt', 'str', 'edit');
        // главного админа может редактировать только он сам
        if ($id == 1 && $inUser->id != $id) {
            cmsCore::error404();
        }
        // показываем форму
        if ($opt == 'edit') {
            $inPage->setTitle($_LANG['CONFIG_PROFILE'] . ' - ' . $usr['nickname']);
            $inPage->addPathway($usr['nickname'], cmsUser::getProfileURL($usr['login']));
            $inPage->addPathway($_LANG['CONFIG_PROFILE']);
            $private_forms = array();
            if (isset($model->config['privforms'])) {
                if (is_array($model->config['privforms'])) {
                    foreach ($model->config['privforms'] as $form_id) {
                        $private_forms = array_merge($private_forms, cmsForm::getFieldsHtml($form_id, $usr['formsdata']));
                    }
                }
            }
            cmsPage::initTemplate('components', 'com_users_edit_profile')->assign('opt', $opt)->assign('usr', $usr)->assign('private_forms', $private_forms)->assign('cfg_forum', $inCore->loadComponentConfig('forum'))->assign('cfg', $model->config)->display('com_users_edit_profile.tpl');
开发者ID:deltas1,项目名称:icms1,代码行数:67,代码来源:frontend.php

示例6: battleways

function battleways()
{
    $inCore = cmsCore::getInstance();
    $inPage = cmsPage::getInstance();
    $inDB = cmsDatabase::getInstance();
    $inUser = cmsUser::getInstance();
    global $_LANG;
    $inCore->loadModel('battleways');
    $model = new cms_model_battleways();
    $usr = cmsCore::request('id', 'int', 0);
    $cfg = $inCore->loadComponentConfig('battleways');
    // Проверяем включени ли компонент
    if (!$cfg['component_enabled']) {
        cmsCore::error404();
    }
    $id = $inCore->request('id', 'int', 0);
    $do = $inCore->request('do', 'str', 'view');
    $tag = $inCore->request('tag', 'str', '');
    $color = $inCore->request('color', 'str', '');
    $page = $inCore->request('page', 'int', 1);
    $select_tag = 0;
    $t = urldecode($tag);
    if (!empty($t)) {
        $sql = "SELECT * \nFROM `cms_battleways` \nWHERE `type` LIKE '%" . $t . "%'";
        if ($inDB->query($sql)) {
            $select_tag = 1;
        }
    }
    if (!isset($cfg['perpage'])) {
        $cfg['perpage'] = 10;
    }
    if (!isset($cfg['images'])) {
        $cfg['images'] = 0;
    }
    if ($_SESSION['user']['id'] == 0) {
        echo "Гостям запрещено просматривать данный раздел";
    } else {
        if ($do == 'view_battleway') {
            //if($model->authorBattleway($id))
            //{
            $battleway = $model->getBattleway($id);
            $smarty = $inCore->initSmarty('components', 'com_battleways_view.tpl');
            $smarty->assign('is_posts_view', (bool) sizeof($battleway));
            $smarty->assign('pagetitle', $battleway['title']);
            $smarty->assign('content', $battleway['content']);
            $smarty->display('com_battleways_view.tpl');
            // }
            // else
            //  {
            //  	cmsCore::error404();
            // }
        }
        if ($do == 'del') {
            $del = $model->delBattleway($id);
            $inCore->redirect('/battleways/');
        }
        if ($do == 'view') {
            if ($select_tag == 0) {
                $total_battleways = $model->totalPosts();
                $pagination = cmsPage::getPagebar($total_battleways, $page, $cfg['perpage'], '/battleways/page%page%.html');
            }
            $user_id = $inUser->id;
            //GET ENTRIES
            $posts_list = $model->getAllPosts($page, $cfg['perpage'], $select_tag, $t, $color, $user_id);
            if ($posts_list) {
                foreach ($posts_list as $post) {
                    $post['datetime'] = $inCore->dateFormat($post['datetime'], 1, 0, 1);
                    /*  if(!empty($post['type']))
                        {
                        $sql="select * from `cms_battleways_color` where `id`='".$post['color']."';";
                        
                        
                        $result = $inDB->query($sql);
                        if ($inDB->num_rows($result)){
                        	 
                         $color = $inDB->fetch_assoc($result);
                         $post['status']	= "<a href='/battleways/".$post['type']."/".$post['color']."/' style='background: ".$color['color'].";border-radius: 3px;color: ".$color['font_color'].";display: inline-block;height: 19px;margin: 5px 3px 2px 2px;outline: #FFFFFF 0px;padding: 1px 4px;text-decoration: none;text-indent: 0px;vertical-align: middle;white-space: nowrap;'>".$post['type']."</a>";
                         }
                         else
                         {
                         	 $post['status']	= "<a href='/battleways/".$post['type']."/' style='background: #E6E6E6;border:1px solid #e1e1e1;padding:5px;border-radius: 8px;border-radius: 3px;color:#333333;text-shadow: #FFFFFF 1px 1px 0px;display: inline-block;height: 19px;margin: 5px 3px 2px 2px;outline: #FFFFFF 0px;padding: 1px 4px;text-decoration: none;text-indent: 0px;vertical-align: middle;white-space: nowrap;cursor:pointer;'>".$post['type']."</a>";
                         	 
                         }
                        } */
                    $posts[] = $post;
                }
            }
            $smarty = $inCore->initSmarty('components', 'com_battleways_view.tpl');
            $smarty->assign('is_posts', (bool) sizeof($posts_list));
            if ($select_tag == 0) {
                $smarty->assign('pagination', $pagination);
            }
            $smarty->assign('mark', $model->getMarks());
            $smarty->assign('pagetitle', "Ваши минизаписки");
            if ($posts) {
                $smarty->assign('posts', $posts);
            }
            $smarty->display('com_battleways_view.tpl');
        }
        if ($do == 'add_battleway') {
//.........这里部分代码省略.........
开发者ID:4uva4ek,项目名称:svato,代码行数:101,代码来源:frontend.php

示例7: comments

function comments($target = '', $target_id = 0, $labels = array())
{
    $inCore = cmsCore::getInstance();
    $inPage = cmsPage::getInstance();
    $inDB = cmsDatabase::getInstance();
    $inUser = cmsUser::getInstance();
    cmsCore::loadModel('comments');
    $model = new cms_model_comments($labels);
    // Проверяем включени ли компонент
    if (!$inCore->isComponentEnable('comments')) {
        return false;
    }
    // Инициализируем права доступа для группы текущего пользователя
    $model->initAccess();
    global $_LANG;
    $do = $inCore->do;
    $page = cmsCore::request('page', 'int', 1);
    $id = cmsCore::request('id', 'int', 0);
    $login = cmsCore::strClear(urldecode(cmsCore::request('login', 'html', '')));
    $inPage->addHeadJS('components/comments/js/comments.js');
    $inPage->addHeadJsLang(array('EDIT_COMMENT', 'CONFIRM_DEL_COMMENT', 'COMMENT_IN_LINK'));
    //========================================================================================================================//
    //========================================================================================================================//
    if ($do == 'view' && !$target && !$target_id) {
        if (!$login) {
            $myprofile = false;
            $page_title = $inCore->getComponentTitle();
            $inPage->addHead('<link rel="alternate" type="application/rss+xml" title="' . $_LANG['COMMENTS'] . '" href="' . HOST . '/rss/comments/all/feed.rss">');
        } else {
            // проверяем что пользователь есть
            $user = cmsUser::getShortUserData($login);
            if (!$user) {
                cmsCore::error404();
            }
            // Мои комментарии
            $myprofile = $inUser->id == $user['id'];
            $page_title = $_LANG['COMMENTS'] . ' - ' . $user['nickname'];
            $inPage->addPathway($user['nickname'], cmsUser::getProfileURL($user['login']));
            // Добавляем условие в выборку
            $model->whereUserIs($user['id']);
        }
        $inPage->setTitle($page_title);
        $inPage->addPathway($page_title);
        $inPage->setDescription($model->config['meta_desc'] ? $model->config['meta_desc'] : $page_title);
        $inPage->setKeywords($model->config['meta_keys'] ? $model->config['meta_keys'] : $page_title);
        // флаг модератора
        $is_moder = $inUser->is_admin || $model->is_can_moderate;
        // Не админам только открытые комментарии
        if (!($is_moder || $myprofile)) {
            $model->whereIsShow();
        }
        // Общее количество комментариев
        $total = $model->getCommentsCount(!($is_moder || $myprofile));
        // Сортировка и разбивка на страницы
        $inDB->orderBy('c.pubdate', 'DESC');
        $inDB->limitPage($page, $model->config['perpage']);
        // Сами комментарии
        $comments = $total ? $model->getComments(!($is_moder || $myprofile)) : array();
        $inDB->resetConditions();
        if (!$comments && $page > 1) {
            cmsCore::error404();
        }
        // пагинация
        if (!$login) {
            $pagebar = cmsPage::getPagebar($total, $page, $model->config['perpage'], '/comments/page-%page%');
        } else {
            $pagebar = cmsPage::getPagebar($total, $page, $model->config['perpage'], 'javascript:centerLink(\'/comments/by_user_' . $user['login'] . '/page-%page%\')');
        }
        // Отдаем в шаблон
        cmsPage::initTemplate('components', 'com_comments_list_all')->assign('comments_count', $total)->assign('comments', $comments)->assign('pagebar', $pagebar)->assign('is_user', $inUser->id)->assign('page_title', $page_title)->assign('cfg', $model->config)->assign('is_admin', $is_moder)->display('com_comments_list_all.tpl');
    }
    //========================================================================================================================//
    //========================================================================================================================//
    if (!in_array($do, array('add', 'edit', 'delete')) && $target && $target_id) {
        if (!$model->config['cmm_ajax']) {
            $model->whereTargetIs($target, $target_id);
            $inDB->orderBy('c.pubdate', 'ASC');
            $comments = cmsCore::callEvent('BEFORE_SHOW_COMMENTS', $model->getComments(!($inUser->is_admin || $model->is_can_moderate), true));
            $total = count($comments);
            ob_start();
            cmsPage::initTemplate('components', 'com_comments_list')->assign('comments_count', $total)->assign('comments', $comments)->assign('user_can_moderate', $model->is_can_moderate)->assign('user_can_delete', $model->is_can_delete)->assign('user_can_add', $model->is_can_add)->assign('is_admin', $inUser->is_admin)->assign('is_user', $inUser->id)->assign('cfg', $model->config)->assign('labels', $model->labels)->assign('target', $target)->assign('target_id', $target_id)->display('com_comments_list.tpl');
            $html = ob_get_clean();
        } else {
            $model->whereTargetIs($target, $target_id);
            $total = $model->getCommentsCount(!($inUser->is_admin || $model->is_can_moderate));
            $inDB->resetConditions();
        }
        cmsPage::initTemplate('components', 'com_comments_view')->assign('comments_count', $total)->assign('target', $target)->assign('target_id', $target_id)->assign('is_admin', $inUser->is_admin)->assign('labels', $model->labels)->assign('is_user', $inUser->id)->assign('cfg', $model->config)->assign('user_can_add', $model->is_can_add)->assign('html', isset($html) ? $html : '')->assign('add_comment_js', "addComment('" . $target . "', '" . $target_id . "', 0)")->assign('user_subscribed', cmsUser::isSubscribed($inUser->id, $target, $target_id))->display('com_comments_view.tpl');
    }
    //========================================================================================================================//
    //========================================================================================================================//
    // Добавление комментария, форма добавления в addform.php
    if ($do == 'add') {
        // Только аякс
        if (!cmsCore::isAjax()) {
            cmsCore::error404();
        }
        // Очищаем буфер
        ob_end_clean();
        // Добавлять могут только админы и те, кому разрешено в настройках группы
//.........这里部分代码省略.........
开发者ID:vicktorwork,项目名称:cms1,代码行数:101,代码来源:frontend.php

示例8: clubs

function clubs() {
    $inCore = cmsCore::getInstance();
    $inPage = cmsPage::getInstance();
    $inDB   = cmsDatabase::getInstance();
    $inUser = cmsUser::getInstance();

    global $_LANG;

    $model = new cms_model_clubs();

    $inPhoto = $model->initPhoto();

    define('IS_BILLING', $inCore->isComponentInstalled('billing'));
    if (IS_BILLING) { cmsCore::loadClass('billing'); }

	// js только авторизованным
	if($inUser->id){
		$inPage->addHeadJS('components/clubs/js/clubs.js');
	}

	$pagetitle = $inCore->getComponentTitle();

	$id   = cmsCore::request('id', 'int', 0);
	$do   = $inCore->do;
	$page = cmsCore::request('page', 'int', 1);

	$inPage->setTitle($pagetitle);
        $inPage->setDescription($model->config['meta_desc'] ? $model->config['meta_desc'] : $pagetitle);
        $inPage->setKeywords($model->config['meta_keys'] ? $model->config['meta_keys'] : $pagetitle);
	$inPage->addPathway($pagetitle, '/clubs');
    $inPage->addHeadJsLang(array('NO_PUBLISH','EDIT_PHOTO','YOU_REALLY_DELETE_PHOTO','YOU_REALLY_DELETE_ALBUM','RENAME_ALBUM','ALBUM_TITLE','ADD_PHOTOALBUM','REALY_EXIT_FROM_CLUB','JOINING_CLUB','SEND_MESSAGE','CREATE','CREATE_CLUB','SEND_INVITE_CLUB','YOU_NO_SELECT_USER'));

//////////////////////// КЛУБЫ ПОЛЬЗОВАТЕЛЯ/////////////////////////////////////
if ($do == 'user_clubs') {
    if (!cmsCore::isAjax()) { return false; }

    $inPage->displayLangJS(array('CREATE','CREATE_CLUB'));

    $user_id = cmsCore::request('user_id', 'int', $inUser->id);

    $user = cmsUser::getShortUserData($user_id);
    if (!$user) { return false; }

    // получаем клубы, в которых пользователь админ
    $model->whereAdminIs($user['id']);
   	$inDB->orderBy('c.pubdate', 'DESC');
    $clubs = $model->getClubs();

    // получаем клубы, в которых состоит пользователь
    $inDB->addSelect('uc.role');
    $inDB->addJoin("INNER JOIN cms_user_clubs uc ON uc.club_id = c.id AND uc.user_id = '{$user['id']}'");
   	$inDB->orderBy('uc.role', 'DESC, uc.pubdate DESC');
    $inclubs = $model->getClubs();

	cmsPage::initTemplate('components', 'com_clubs_user')->
            assign('can_create', (($inUser->id == $user['id']) && ($model->config['cancreate'] || $inUser->is_admin)))->
            assign('clubs', array_merge($clubs, $inclubs))->
            assign('user', $user)->
            assign('my_profile', $user['id'] == $inUser->id)->
            display();

}
//////////////////////// ВСЕ КЛУБЫ /////////////////////////////////////////////
if ($do=='view'){

	$inDB->orderBy('is_vip', 'DESC, rating DESC');
	$inDB->limitPage($page, $model->config['perpage']);

	$total = $model->getClubsCount();

        $clubs = $model->getClubs();
	if (!$clubs && $page > 1) { return false; }
        
        if ($page > 1) {
            foreach ($clubs as $c) {
                $keys[] = $c['title'];
            }
            $inPage->setKeywords(implode(',', $keys));
        }

	cmsPage::initTemplate('components', 'com_clubs_view')->
            assign('pagetitle', $pagetitle)->
            assign('can_create', ($inUser->id && $model->config['cancreate'] || $inUser->is_admin))->
            assign('clubs', $clubs)->
            assign('total', $total)->
            assign('pagination', cmsPage::getPagebar($total, $page, $model->config['perpage'], '/clubs/page-%page%'))->
            display();

}
/////////////////////// ПРОСМОТР КЛУБА /////////////////////////////////////////
if ($do=='club'){
    $club = $model->getClub($id);
    if (!$club) { return false; }

    if (!$club['published'] && !$inUser->is_admin) { return false; }

    $inPage->setTitle($club['pagetitle'] ? $club['pagetitle'] : $club['title']);
    $inPage->setKeywords($club['meta_keys'] ? $club['meta_keys'] : $club['title']);
    if (!$club['meta_desc']) {
        if ($club['description']) {
//.........这里部分代码省略.........
开发者ID:Acsac,项目名称:CMS-RuDi,代码行数:101,代码来源:frontend.php

示例9: header

<?php

header('Content-Type: text/html; charset=utf-8');
header('X-Frame-Options: DENY');
session_start();
define("VALID_CMS", 1);
define("VALID_CMS_ADMIN", 1);
define('PATH', $_SERVER['DOCUMENT_ROOT']);
require PATH . '/core/cms.php';
require PATH . '/admin/includes/cp.php';
$inCore = cmsCore::getInstance(false, true);
cmsCore::loadClass('page');
cmsCore::loadClass('user');
cmsCore::loadClass('actions');
if (!cmsCore::c('user')->update() || !cmsCore::isAjax()) {
    cmsCore::error404();
}
if (!cmsCore::c('user')->is_admin) {
    cmsCore::halt($_LANG['ACCESS_DENIED']);
}
cmsCore::c('actions')->showTargets(true);
$total = cmsCore::c('actions')->getCountActions();
$page = cmsCore::request('page', 'int', 1);
cmsCore::c('db')->limitPage($page, 10);
cmsCore::c('page')->initTemplate('components', 'actions_list')->assign('actions', cmsCore::c('actions')->getActionsLog())->assign('pagebar', cmsPage::getPagebar($total, $page, 10, '#" onclick="$.post(\'/admin/ajax/getActions.php\', \'page=%page%\', function(m){ $(\'#actions\').html(m); }); return false'))->display();
开发者ID:CMS-RuDi,项目名称:CMS-RuDi,代码行数:25,代码来源:getActions.php

示例10: photos

function photos()
{
    $inCore = cmsCore::getInstance();
    $inPage = cmsPage::getInstance();
    $inDB = cmsDatabase::getInstance();
    $inUser = cmsUser::getInstance();
    cmsCore::loadClass('photo');
    $inPhoto = cmsPhoto::getInstance();
    global $_LANG;
    $model = new cms_model_photos();
    $pagetitle = $inCore->menuTitle();
    $root_album_id = $inDB->getNsRootCatId('cms_photo_albums');
    $id = cmsCore::request('id', 'int', $root_album_id);
    $do = $inCore->do;
    $page = cmsCore::request('page', 'int', 1);
    $inPage->addPathway($inCore->getComponentTitle(), '/photos');
    // только авторизованные пользуются js
    if ($inUser->id) {
        $inPage->addHeadJS('components/photos/js/photos.js');
        $inPage->addHeadJsLang(array('NO_PUBLISH', 'EDIT_PHOTO', 'YOU_REALLY_DELETE_PHOTO', 'MOVE_PHOTO'));
    }
    $inPage->setDescription($model->config['meta_desc'] ? $model->config['meta_desc'] : $pagetitle);
    $inPage->setKeywords($model->config['meta_keys'] ? $model->config['meta_keys'] : $pagetitle);
    /////////////////////////////// Просмотр альбома ///////////////////////////////////////////////////////////////////////////////////////////
    if ($do == 'view') {
        $album = $inDB->getNsCategory('cms_photo_albums', $id, null);
        if (!$album && $inCore->menuId() !== 1) {
            cmsCore::error404();
        }
        // Неопубликованные альбомы показываем только админам
        if (!$album['published'] && !$inUser->is_admin) {
            cmsCore::error404();
        }
        $album = cmsCore::callEvent('GET_PHOTO_ALBUM', $album);
        // если не корневой альбом
        if ($album['id'] != $root_album_id) {
            $path_list = $inDB->getNsCategoryPath('cms_photo_albums', $album['NSLeft'], $album['NSRight'], 'id, title, NSLevel');
            if ($path_list) {
                foreach ($path_list as $pcat) {
                    $inPage->addPathway($pcat['title'], '/photos/' . $pcat['id']);
                }
            }
            $pagetitle = $pagetitle && $inCore->isMenuIdStrict() ? $pagetitle : $album['title'] . ' - ' . $_LANG['PHOTOGALLERY'];
            $inPage->setTitle($album['pagetitle'] ? $album['pagetitle'] : $pagetitle);
        } else {
            $pagetitle = $pagetitle && $inCore->isMenuIdStrict() ? $pagetitle : $_LANG['PHOTOGALLERY'];
            $inPage->setTitle($pagetitle);
            $album['title'] = $pagetitle;
        }
        //Формируем подкатегории альбома
        $inDB->orderBy('f.' . $model->config['orderby'], $model->config['orderto']);
        $subcats = $inPhoto->getAlbums($album['id']);
        // Сортировка фотографий
        $orderby = cmsCore::getSearchVar('orderby', $album['orderby']);
        $orderto = cmsCore::getSearchVar('orderto', $album['orderto']);
        if (!in_array($orderby, array('title', 'pubdate', 'rating', 'hits'))) {
            $orderby = $album['orderby'];
        }
        if (!in_array($orderto, array('desc', 'asc'))) {
            $orderto = $album['orderto'];
        }
        // Устанавливаем альбом
        $inPhoto->whereAlbumIs($album['id']);
        // Общее количество фото по заданным выше условиям
        $total = $inPhoto->getPhotosCount($inUser->is_admin);
        //устанавливаем сортировку
        $inDB->orderBy('f.' . $orderby, $orderto);
        //устанавливаем номер текущей страницы и кол-во фото на странице
        $inDB->limitPage($page, $album['perpage']);
        $photos = $inPhoto->getPhotos($inUser->is_admin, $album['showdate']);
        if (!$photos && $page > 1) {
            cmsCore::error404();
        }
        if ($album['id'] != $root_album_id) {
            // meta description
            if ($album['meta_desc']) {
                $meta_desc = $album['meta_desc'];
            } elseif (mb_strlen(strip_tags($album['description'])) >= 250) {
                $meta_desc = crop($album['description']);
            } else {
                $meta_desc = $album['title'];
            }
            $inPage->setDescription($meta_desc);
            // meta keywords
            if ($album['meta_keys']) {
                $meta_keys = $album['meta_keys'];
            } elseif ($photos) {
                foreach ($photos as $p) {
                    $k[] = $p['title'];
                }
                $meta_keys = implode(', ', $k);
            } else {
                $meta_keys = $album['title'];
            }
            $inPage->setKeywords($meta_keys);
        }
        cmsPage::initTemplate('components', 'com_photos_view')->assign('root_album_id', $root_album_id)->assign('cfg', $model->config)->assign('album', $album)->assign('can_add_photo', $album['public'] && $inUser->id || $inUser->is_admin)->assign('subcats', $subcats)->assign('photos', $photos)->assign('pagebar', cmsPage::getPagebar($total, $page, $album['perpage'], '/photos/' . $album['id'] . '-%page%'))->assign('total', $total)->assign('orderby', $orderby)->assign('orderto', $orderto)->display('com_photos_view.tpl');
        // если есть фотограйии в альбоме и включены комментарии в альбоме, то показываем их
        if ($album['is_comments'] && $photos && $inCore->isComponentInstalled('comments')) {
            cmsCore::includeComments();
//.........这里部分代码省略.........
开发者ID:deltas1,项目名称:icms1,代码行数:101,代码来源:frontend.php

示例11: actions

function actions()
{
    $inCore = cmsCore::getInstance();
    $inUser = cmsUser::getInstance();
    $inPage = cmsPage::getInstance();
    $inDB = cmsDatabase::getInstance();
    $inActions = cmsActions::getInstance();
    $model = new cms_model_actions();
    global $_LANG;
    $do = $inCore->do;
    $page = cmsCore::request('page', 'int', 1);
    $user_id = cmsCore::request('user_id', 'int', 0);
    $perpage = 6;
    $pagetitle = $inCore->getComponentTitle();
    $inPage->setTitle($pagetitle);
    $inPage->addPathway($pagetitle, '/actions');
    $inPage->setDescription($model->config['meta_desc'] ? $model->config['meta_desc'] : $pagetitle);
    $inPage->setKeywords($model->config['meta_keys'] ? $model->config['meta_keys'] : $pagetitle);
    //============================================================================//
    if ($do == 'delete') {
        if (!$inUser->is_admin) {
            cmsCore::error404();
        }
        $id = cmsCore::request('id', 'int', 0);
        if (!$id) {
            cmsCore::error404();
        }
        $model->deleteAction($id);
        cmsCore::redirectBack();
    }
    //============================================================================//
    if ($do == 'view') {
        $inActions->showTargets($model->config['show_target']);
        if ($model->config['act_type'] && !$model->config['is_all']) {
            $inActions->onlySelectedTypes($model->config['act_type']);
        }
        $total = $inActions->getCountActions();
        $inDB->limitPage($page, $model->config['perpage']);
        $actions = $inActions->getActionsLog();
        if (!$actions && $page > 1) {
            cmsCore::error404();
        }
        cmsPage::initTemplate('components', 'com_actions_view')->assign('actions', $actions)->assign('pagetitle', $pagetitle)->assign('total', $total)->assign('user_id', $inUser->id)->assign('pagebar', cmsPage::getPagebar($total, $page, $model->config['perpage'], '/actions/page-%page%'))->display('com_actions_view.tpl');
    }
    //============================================================================//
    if ($do == 'view_user_feed') {
        if (!$inUser->id) {
            cmsCore::error404();
        }
        if (!cmsCore::isAjax()) {
            cmsCore::error404();
        }
        // Получаем друзей
        $friends = cmsUser::getFriends($inUser->id);
        $friends_total = count($friends);
        // нам нужно только определенное количество друзей
        $friends = array_slice($friends, ($page - 1) * $perpage, $perpage, true);
        if ($friends) {
            $inActions->onlyMyFriends();
            $inActions->showTargets($model->config['show_target']);
            $inDB->limitIs($model->config['perpage_tab']);
            $actions = $inActions->getActionsLog();
        } else {
            $actions = array();
        }
        cmsPage::initTemplate('components', 'com_actions_view_tab')->assign('actions', $actions)->assign('friends', $friends)->assign('user_id', $user_id)->assign('page', $page)->assign('cfg', $model->config)->assign('total_pages', ceil($friends_total / $perpage))->assign('friends_total', $friends_total)->display('com_actions_view_tab.tpl');
    }
    //============================================================================//
    if ($do == 'view_user_feed_only') {
        if (!$inUser->id) {
            cmsCore::error404();
        }
        if (!cmsCore::isAjax()) {
            cmsCore::error404();
        }
        if ($user_id) {
            if (!cmsUser::isFriend($user_id)) {
                cmsCore::error404();
            }
            $inActions->whereUserIs($user_id);
        } else {
            $inActions->onlyMyFriends();
        }
        $inActions->showTargets($model->config['show_target']);
        $inDB->limitIs($model->config['perpage_tab']);
        $actions = $inActions->getActionsLog();
        // получаем последний элемент массива для выборки имя пользователя и ссылки на профиль.
        if ($actions) {
            $user = end($actions);
        } else {
            $user = cmsUser::getShortUserData($user_id);
        }
        cmsPage::initTemplate('components', 'com_actions_tab')->assign('actions', $actions)->assign('user_id', $user_id)->assign('user', $user)->assign('cfg', $model->config)->display('com_actions_tab.tpl');
    }
    //============================================================================//
    if ($do == 'view_user_friends_only') {
        if (!$inUser->id) {
            cmsCore::error404();
        }
        if (!cmsCore::isAjax()) {
//.........这里部分代码省略.........
开发者ID:deltas1,项目名称:icms1,代码行数:101,代码来源:frontend.php

示例12: forum

function forum()
{
    $inCore = cmsCore::getInstance();
    $inPage = cmsPage::getInstance();
    $inDB = cmsDatabase::getInstance();
    $inUser = cmsUser::getInstance();
    $model = new cms_model_forum();
    define('IS_BILLING', $inCore->isComponentInstalled('billing'));
    if (IS_BILLING) {
        cmsCore::loadClass('billing');
    }
    global $_LANG;
    $pagetitle = $inCore->getComponentTitle();
    $inPage->addPathway($pagetitle, '/forum');
    $inPage->setTitle($pagetitle);
    $inPage->setDescription($model->config['meta_desc'] ? $model->config['meta_desc'] : $pagetitle);
    $inPage->setKeywords($model->config['meta_keys'] ? $model->config['meta_keys'] : $pagetitle);
    $id = cmsCore::request('id', 'int', 0);
    $do = $inCore->do;
    $page = cmsCore::request('page', 'int', 1);
    $inPage->addHeadJS('components/forum/js/common.js');
    $inPage->addHeadJsLang(array('CONFIRM_DELETE_POLL', 'CONFIRM_DEL_POST', 'CONFIRM_DEL_THREAD', 'MOVE_THREAD', 'MOVE_POST', 'RENAME_THREAD', 'CONFIRM_DELETE_FILE', 'SELECT_NEW_FILE_UPLOAD', 'SELECT_TEXT_QUOTE', 'CONFIRM_DELETE_ALL_USER_POSTS'));
    //============================================================================//
    //=============================== Список Форумов  ============================//
    //============================================================================//
    if ($do == 'view') {
        $inPage->addHead('<link rel="alternate" type="application/rss+xml" title="' . $_LANG['FORUMS'] . '" href="' . HOST . '/rss/forum/all/feed.rss">');
        $forums = $model->getForums();
        cmsPage::initTemplate('components', 'com_forum_list')->assign('pagetitle', $pagetitle)->assign('forums', $forums)->assign('forum', array())->assign('user_id', $inUser->id)->assign('cfg', $model->config)->display('com_forum_list.tpl');
    }
    //============================================================================//
    //================ Список тем форума + список подфорумов  ====================//
    //============================================================================//
    if ($do == 'forum') {
        $forum = $model->getForum($id);
        if (!$forum) {
            cmsCore::error404();
        }
        $forum = translations::process(cmsConfig::getConfig('lang'), 'forum_forums', $forum);
        $moderators = $model->getForumModerators($forum['moder_list']);
        // опции просмотра
        $order_by = cmsCore::getSearchVar('order_by', 'pubdate');
        $order_to = cmsCore::getSearchVar('order_to', 'desc');
        if (!in_array($order_by, array('pubdate', 'title', 'post_count', 'hits'))) {
            $order_by = 'pubdate';
        }
        if (!in_array($order_to, array('asc', 'desc'))) {
            $order_to = 'desc';
        }
        $daysprune = (int) cmsCore::getSearchVar('daysprune');
        if (!cmsCore::checkContentAccess($forum['access_list'])) {
            cmsPage::includeTemplateFile('special/accessdenied.php');
            return;
        }
        $inPage->addHead('<link rel="alternate" type="application/rss+xml" title="' . htmlspecialchars($forum['title']) . '" href="' . HOST . '/rss/forum/' . $forum['id'] . '/feed.rss">');
        $inPage->setTitle($forum['pagetitle'] ? $forum['pagetitle'] : $forum['title']);
        $inPage->setDescription($forum['meta_desc'] ? $forum['meta_desc'] : crop($forum['description'] ? $forum['description'] : $forum['title']));
        $inPage->setKeywords($forum['meta_keys'] ? $forum['meta_keys'] : $forum['title']);
        // Получаем дерево форумов
        $path_list = $inDB->getNsCategoryPath('cms_forums', $forum['NSLeft'], $forum['NSRight'], 'id, title, access_list, moder_list');
        // Строим глубиномер
        if ($path_list) {
            $path_list = translations::process(cmsConfig::getConfig('lang'), 'forum_forums', $path_list);
            foreach ($path_list as $pcat) {
                if (!cmsCore::checkContentAccess($pcat['access_list'])) {
                    cmsPage::includeTemplateFile('special/accessdenied.php');
                    return;
                }
                $inPage->addPathway($pcat['title'], '/forum/' . $pcat['id']);
            }
        }
        // Получим подфорумы
        $model->whereNestedForum($forum['NSLeft'], $forum['NSRight']);
        $sub_forums = $model->getForums();
        cmsPage::initTemplate('components', 'com_forum_list')->assign('pagetitle', $forum['title'])->assign('forums', $sub_forums)->assign('forum', $forum)->assign('cfg', $model->config)->assign('user_id', $inUser->id)->display('com_forum_list.tpl');
        // Получим темы
        if ($daysprune) {
            $model->whereDayIntervalIs($daysprune);
        }
        $model->whereForumIs($forum['id']);
        $inDB->orderBy('t.pinned', 'DESC, t.' . $order_by . ' ' . $order_to);
        $inDB->limitPage($page, $model->config['pp_forum']);
        $threads = $model->getThreads();
        if (!$threads && $page > 1) {
            cmsCore::error404();
        }
        cmsPage::initTemplate('components', 'com_forum_view')->assign('threads', $threads)->assign('show_panel', true)->assign('order_by', $order_by)->assign('order_to', $order_to)->assign('daysprune', $daysprune)->assign('moderators', $moderators)->assign('pagination', cmsPage::getPagebar($forum['thread_count'], $page, $model->config['pp_forum'], '/forum/' . $forum['id'] . '-%page%'))->display('com_forum_view.tpl');
    }
    //============================================================================//
    //======================== Просмотр темы форума  =============================//
    //============================================================================//
    if ($do == 'thread') {
        $thread = $model->getThread($id);
        if (!$thread) {
            cmsCore::error404();
        }
        // Строим глубиномер
        $path_list = $inDB->getNsCategoryPath('cms_forums', $thread['NSLeft'], $thread['NSRight'], 'id, title, access_list, moder_list');
        if ($path_list) {
            $path_list = translations::process(cmsConfig::getConfig('lang'), 'forum_forums', $path_list);
//.........这里部分代码省略.........
开发者ID:deltas1,项目名称:icms1,代码行数:101,代码来源:frontend.php

示例13: cpListTable


//.........这里部分代码省略.........
                                        }
                                    } else {
                                        if (isset($_fields[$key]['prc'])) {
                                            // функция обработки под названием $_fields[$key]['prc']
                                            // какие параметры передать функции - один ключ или произвольный массив ключей
                                            if (is_array($_fields[$key]['field'])) {
                                                foreach ($_fields[$key]['field'] as $func_field) {
                                                    $in_func_array[$func_field] = $item[$func_field];
                                                }
                                                $data = call_user_func($_fields[$key]['prc'], $in_func_array);
                                            } else {
                                                $data = call_user_func($_fields[$key]['prc'], $item[$_fields[$key]['field']]);
                                            }
                                            if (is_array($data) && isset($data['link'])) {
                                                $data = str_replace('%id%', $item['id'], $data['link']);
                                            }
                                        } else {
                                            $data = $item[$_fields[$key]['field']];
                                            if (isset($_fields[$key]['maxlen'])) {
                                                if (mb_strlen($data)>$_fields[$key]['maxlen']) {
                                                    $data = mb_substr($data, 0, $_fields[$key]['maxlen']).'...';
                                                }
                                            }
                                        }

                                        //nested sets otstup
                                        if (isset($item['NSLevel']) && ($_fields[$key]['field'] == 'title' || (is_array($_fields[$key]['field']) && in_array('title', $_fields[$key]['field'])))) {
                                            $otstup = str_repeat('&nbsp;&nbsp;&nbsp;&nbsp;', ($item['NSLevel']-1));
                                            if ($item['NSLevel']-1 > 0) { $otstup .=  ' &raquo; '; }
                                        } else { $otstup = ''; }

                                        echo '<td class="'.$row_class.'" valign="middle">'.$otstup.$data.'</td>'. "\n";
                                    }
                                } else {
                                    if (isset($_fields[$key]['do'])) { $do = 'do=config&id='.(int)$_REQUEST['id'].'&'.$_fields[$key]['do']; } else { $do = 'do'; }
                                    if (isset($_fields[$key]['do_suffix'])) { $dos = $_fields[$key]['do_suffix']; $ids = 'item_id'; } else { $dos = ''; $ids = 'id'; }
                                    echo '<td class="'.$row_class.'" valign="middle">
                                            <a title="'.$_LANG['AD_DOWN'].'" href="?view='.cmsAdmin::getApplet().'&'.$do.'=move_down&co='.$item[$_fields[$key]['field']].'&'.$ids.'='.$item['id'].'"><img src="images/actions/down.gif" border="0"/></a>';
                                    if ($table != 'cms_menu' && $table != 'cms_category'){
                                        echo '<input class="lt_input" type="text" size="4" name="ordering[]" value="'.$item['ordering'].'" />';
                                        echo '<input name="ids[]" type="hidden" value="'.$item['id'].'" />';
                                    } else {
                                        echo '<input class="lt_input" type="text" size="4" name="ordering[]" value="'.$item['ordering'].'" disabled/>';
                                    }

                                    echo '<a title="'.$_LANG['AD_UP'].'" href="?view='.cmsAdmin::getApplet().'&'.$do.'=move_up&co='.$item[$_fields[$key]['field']].'&'.$ids.'='.$item['id'].'"><img src="images/actions/top.gif" border="0"/></a>'.
                                                        '</td>'. "\n";
                                }
                            }
                        }

                        if ($is_actions) {
                            echo '<td width="110" class="'.$row_class.'" align="right" valign="middle"><div style="padding-right:8px">';
                            
                            foreach($_actions as $action) {
                                if (isset($action['condition'])) {
                                    $print = $action['condition']($item);
                                } else {
                                    $print = true;
                                }

                                if ($print) {
                                    $icon   = $action['icon'];
                                    $title  = $action['title'];
                                    $link   = $action['link'];

                                    foreach($item as $f=>$v) {
                                        $link = str_replace('%'.$f.'%', $v, $link);
                                    }
                                    
                                    if (!isset($action['confirm'])) {
                                        echo '<a href="'. $link .'" class="uittip" title="'. $title .'"'. (isset($action['target']) ? ' target="'. $action['target'] .'"' : '') .'><img hspace="2" src="images/actions/'. $icon .'" border="0" alt="'. $title .'"/></a>';
                                    } else {
                                        echo '<a href="#" class="uittip" onclick="jsmsg(\''. $action['confirm'] .'\', \''. $link .'\')"  title="'. $title .'"><img hspace="2" src="images/actions/'. $icon .'" border="0" alt="'. $title .'"/></a>';
                                    }
                                }
                            }

                            echo '</div></td>'. "\n";
                        }

                        echo '</tr>'."\n";
                    }
                    
        echo '</tbody></table></form>';
        echo '<style>tr#lt_row2{ background:#eeeeee !important; } tr#lt_row1:hover td,tr#lt_row2:hover{ background:#cccccc !important; }</style>';
        echo '<script type="text/javascript">trClickChecked();</script>';

        $link = '?view='. cmsAdmin::getApplet();
        
        if ($sort) {
            $link .= '&sort='.$sort;
            if (cmsCore::inRequest('so')) { $link .= '&so='.cmsCore::request('so'); }
        }

        echo cmsPage::getPagebar($total, $page, $perpage, $_SERVER['PHP_SELF'] .'?'. cpAddParam($_SERVER['QUERY_STRING'], 'page', '%page%'));
    } else {
        echo '<p class="cp_message">'.$_LANG['OBJECTS_NOT_FOUND'].'</p>';
    }
}
开发者ID:Acsac,项目名称:CMS-RuDi,代码行数:101,代码来源:cp.php

示例14: cpListTable


//.........这里部分代码省略.........
                                $qs2 = cpAddParam($qs2, $ids, $item['id']);
                                $it['link'] = "javascript:pub(" . $item['id'] . ", '" . $qs . "', '" . $qs2 . "', 'on', 'off');";
                                $it['icon'] = 'images/actions/off.gif';
                                $it['title'] = $_LANG['SHOW'];
                            }
                        } else {
                            $it['type'] = 'default';
                            if (isset($_fields[$key]['prc'])) {
                                // функция обработки под названием $_fields[$key]['prc']
                                // какие параметры передать функции - один ключ или произвольный массив ключей
                                if (is_array($_fields[$key]['field'])) {
                                    foreach ($_fields[$key]['field'] as $func_field) {
                                        $in_func_array[$func_field] = $item[$func_field];
                                    }
                                    $it['title'] = call_user_func($_fields[$key]['prc'], $in_func_array);
                                } else {
                                    $it['title'] = call_user_func($_fields[$key]['prc'], $item[$_fields[$key]['field']]);
                                }
                                if (is_array($it['title']) && isset($it['title']['link'])) {
                                    $it['title'] = str_replace('%id%', $item['id'], $it['title']['link']);
                                }
                            } else {
                                $it['title'] = $item[$_fields[$key]['field']];
                                if (isset($_fields[$key]['maxlen'])) {
                                    if (mb_strlen($it['title']) > $_fields[$key]['maxlen']) {
                                        $it['title'] = mb_substr($it['title'], 0, $_fields[$key]['maxlen']) . '...';
                                    }
                                }
                            }
                            //nested sets otstup
                            if (isset($item['NSLevel']) && ($_fields[$key]['field'] == 'title' || is_array($_fields[$key]['field']) && in_array('title', $_fields[$key]['field']))) {
                                $otstup = str_repeat('&nbsp;&nbsp;&nbsp;&nbsp;', $item['NSLevel'] - 1);
                                if ($item['NSLevel'] - 1 > 0) {
                                    $otstup .= ' &raquo; ';
                                }
                            } else {
                                $otstup = '';
                            }
                            $it['otstup'] = $otstup;
                        }
                    } else {
                        $it['type'] = 'ordering';
                        if (isset($_fields[$key]['do'])) {
                            $do = 'do=config&id=' . (int) $_REQUEST['id'] . '&' . $_fields[$key]['do'];
                        } else {
                            $do = 'do';
                        }
                        if (isset($_fields[$key]['do_suffix'])) {
                            $dos = $_fields[$key]['do_suffix'];
                            $ids = 'item_id';
                        } else {
                            $dos = '';
                            $ids = 'id';
                        }
                        $it['link_down'] = '?view=' . cmsAdmin::getApplet() . '&' . $do . '=move_down&co=' . $item[$_fields[$key]['field']] . '&' . $ids . '=' . $item['id'];
                        $it['link_up'] = '?view=' . cmsAdmin::getApplet() . '&' . $do . '=move_up&co=' . $item[$_fields[$key]['field']] . '&' . $ids . '=' . $item['id'];
                        $it['value'] = $item['ordering'];
                    }
                }
                $itms[] = $it;
            }
            if ($is_actions) {
                $actions[$item['id']] = array();
                foreach ($_actions as $action) {
                    if (isset($action['condition'])) {
                        $print = $action['condition']($item);
                    } else {
                        $print = true;
                    }
                    if ($print) {
                        $icon = $action['icon'];
                        $title = $action['title'];
                        $link = $action['link'];
                        foreach ($item as $f => $v) {
                            $link = str_replace('%' . $f . '%', $v, $link);
                            if (isset($action['confirm'])) {
                                $action['confirm'] = str_replace('%' . $f . '%', $v, $action['confirm']);
                            }
                        }
                        $acts = array('link' => $link, 'title' => $title, 'icon' => 'images/actions/' . $icon, 'target' => isset($action['target']) ? $action['target'] : false);
                        if (isset($action['confirm'])) {
                            $acts['link'] = "javascript:jsmsg('" . $action['confirm'] . "', '" . $link . "');";
                        }
                        $actions[$item['id']][] = $acts;
                    }
                }
            }
            $items[$item['id']] = $itms;
        }
        $link = '?view=' . cmsAdmin::getApplet();
        if ($sort) {
            $link .= '&sort=' . $sort;
            if (cmsCore::inRequest('so')) {
                $link .= '&so=' . cmsCore::request('so');
            }
        }
    }
    cmsCore::c('page')->initTemplate('special', 'list_table')->assign('applet', cmsAdmin::getApplet())->assign('filters', $filters)->assign('f_html', $f_html)->assign('f', $f)->assign('query_str', $_SERVER['QUERY_STRING'])->assign('sort', $sort)->assign('so', $so)->assign('actions', $actions)->assign('table', $table)->assign('fields', $_fields)->assign('items', $items)->display();
    echo cmsPage::getPagebar($total, $page, $perpage, $_SERVER['PHP_SELF'] . '?' . cpAddParam($_SERVER['QUERY_STRING'], 'page', '%page%'));
}
开发者ID:CMS-RuDi,项目名称:CMS-RuDi,代码行数:101,代码来源:cp.php

示例15: IN

        $page_title = $_LANG['NOTICES'];
        $show_notice = true;
        $inDB->where("m.to_id = '{$id}'");
        $msg_count = $model->getMessagesCount($show_notice);
        $pagebar = cmsPage::getPagebar($msg_count, $page, $perpage, 'javascript:centerLink(\'/users/' . $id . '/messages-notices%page%.html\')');
        break;
    case 'history':
        if ($whith_id) {
            $with_usr = cmsUser::getShortUserData($whith_id);
            if (!$with_usr) {
                cmsCore::error404();
            }
            $page_title = $_LANG['MESSEN_WITH'] . ' ' . $with_usr['nickname'];
            $inDB->addJoin("INNER JOIN cms_user_msg m ON m.from_id = u.id AND\n                            m.from_id IN ({$id}, {$with_usr['id']}) AND\n                            m.to_id IN ({$id}, {$with_usr['id']}) AND\n                            m.from_del = 0 AND m.to_del = 0");
            $msg_count = $model->getMessagesCount();
            $pagebar = cmsPage::getPagebar($msg_count, $page, $perpage, 'javascript:centerLink(\'/users/' . $id . '/messages-history' . $with_usr['id'] . '-%page%.html\')');
        } else {
            $page_title = $_LANG['DIALOGS'];
            $msg_count = 0;
        }
        break;
    default:
        return;
}
$inDB->orderBy('m.id', 'DESC');
$inDB->limitPage($page, $perpage);
$records = $msg_count ? $model->getMessages($show_notice) : array();
$inDB->resetConditions();
if ($new_msg['messages'] && $opt == 'in') {
    $model->markAsReadMessage($id, $perpage);
}
开发者ID:4uva4ek,项目名称:svato,代码行数:31,代码来源:messages.php


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