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


PHP cmsForm::getFieldsValues方法代码示例

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


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

示例1: users


//.........这里部分代码省略.........
        }
        // обрезаем список
        $usr['friends'] = array_slice($usr['friends'], 0, 6);
        // выясняем друзья ли мы с текущим пользователем
        $usr['isfriend'] = !$myprofile ? cmsUser::isFriend($usr['id']) : false;
        // награды пользователя
        $usr['awards'] = $model->config['sw_awards'] ? $model->getUserAwards($usr['id']) : false;
        // стена
        if ($model->config['sw_wall']) {
            $inDB->limitPage(1, $model->config['wall_perpage']);
            $usr['wall_html'] = cmsUser::getUserWall($usr['id'], 'users', $myprofile, $inUser->is_admin);
        }
        // можно ли пользователю изменять карму
        $usr['can_change_karma'] = $model->isUserCanChangeKarma($usr['id']) && $inUser->id;
        // Фотоальбомы пользователя
        if ($model->config['sw_photo']) {
            $usr['albums'] = $model->getPhotoAlbums($usr['id'], $usr['isfriend'], !$inCore->isComponentEnable('photos'));
            $usr['albums_total'] = sizeof($usr['albums']);
            $usr['albums_show'] = 6;
            if ($usr['albums_total'] > $usr['albums_show']) {
                array_splice($usr['albums'], $usr['albums_show']);
            }
        }
        $usr['board_count'] = $model->config['sw_board'] ? $inDB->rows_count('cms_board_items', "user_id='{$usr['id']}' AND published=1") : 0;
        $usr['comments_count'] = $model->config['sw_comm'] ? $inDB->rows_count('cms_comments', "user_id='{$usr['id']}' AND published=1") : 0;
        $usr['forum_count'] = $model->config['sw_forum'] ? $inDB->rows_count('cms_forum_posts', "user_id = '{$usr['id']}'") : 0;
        $usr['files_count'] = $model->config['sw_files'] ? $inDB->rows_count('cms_user_files', "user_id = '{$usr['id']}'") : 0;
        $cfg_reg = $inCore->loadComponentConfig('registration');
        $usr['invites_count'] = $inUser->id && $myprofile && $cfg_reg['reg_type'] == 'invite' ? $model->getUserInvitesCount($inUser->id) : 0;
        $usr['blog'] = $model->config['sw_blogs'] ? $inDB->get_fields('cms_blogs', "user_id = '{$usr['id']}' AND owner = 'user'", 'title, seolink') : false;
        $usr['form_fields'] = array();
        if (is_array($model->config['privforms'])) {
            foreach ($model->config['privforms'] as $form_id) {
                $usr['form_fields'] = array_merge($usr['form_fields'], cmsForm::getFieldsValues($form_id, $usr['formsdata']));
            }
        }
        if ($usr['city']) {
            cmsCore::loadModel('geo');
            $geo = new cms_model_geo();
            $city_parents = $geo->getCityParents($usr['city']);
            if ($city_parents) {
                $usr['country'] = $city_parents['country_name'];
            }
        }
        $plugins = $model->getPluginsOutput($usr);
        cmsPage::initTemplate('components', 'com_users_profile.tpl')->assign('usr', $usr)->assign('plugins', $plugins)->assign('cfg', $model->config)->assign('myprofile', $myprofile)->assign('cfg_forum', $inCore->loadComponentConfig('forum'))->assign('is_admin', $inUser->is_admin)->assign('is_auth', $inUser->id)->display('com_users_profile.tpl');
    }
    //============================================================================//
    //============================= Список сообщений  ============================//
    //============================================================================//
    if ($do == 'messages') {
        if (!$model->config['sw_msg']) {
            cmsCore::error404();
        }
        if (!$inUser->id || $inUser->id != $id && !$inUser->is_admin) {
            cmsUser::goToLogin();
        }
        $usr = cmsUser::getShortUserData($id);
        if (!$usr) {
            cmsCore::error404();
        }
        $inPage->setTitle($_LANG['MY_MESS']);
        $inPage->addPathway($usr['nickname'], cmsUser::getProfileURL($usr['login']));
        $inPage->addPathway($_LANG['MY_MESS'], '/users/' . $id . '/messages.html');
        include 'components/users/messages.php';
    }
开发者ID:deltas1,项目名称:icms1,代码行数:67,代码来源:frontend.php

示例2: board


//.........这里部分代码省略.........
        $info_text = $item['is_overdue'] ? $_LANG['ADV_IS_EXTEND'] : $_LANG['ADV_IS_MODER'];
        cmsCore::addSessionMessage($info_text, 'info');
    } else {
        // увеличиваем кол-во просмотров
        cmsCore::c('db')->setFlag('cms_board_items', cmsCore::m('board')->item_id, 'hits', $item['hits']+1);
    }

    // формируем заголовок и тело сообщения
    $item['title']   = $item['obtype'].' '.$item['title'];
    $item['content'] = nl2br($item['content']);
    $item['content'] = cmsCore::m('board')->config['auto_link'] ? $inCore->parseSmiles($item['content']) : $item['content'];

    $category_path = cmsCore::c('db')->getNsCategoryPath('cms_board_cats', $item['NSLeft'], $item['NSRight']);
    if ($category_path) {
        foreach ($category_path as $pcat) {
            cmsCore::c('page')->addPathway($pcat['title'], '/board/'.$pcat['id']);
        }
    }
    cmsCore::c('page')->addPathway($item['title']);

    $pagetitle = $item['pagetitle'] ? $item['pagetitle'] : $item['title'];
    $pagekeys  = $item['meta_keys'] ? $item['meta_keys'] : $item['title'];
    $pagedesc  = $item['meta_desc'] ? $item['meta_desc'] : $item['content'];

    cmsCore::c('page')->setTitle($pagetitle);
    cmsCore::c('page')->setDescription(crop($pagedesc));
    cmsCore::c('page')->setKeywords($pagekeys);

    cmsPage::initTemplate('components', 'com_board_item')->
        assign('item', $item)->
        assign('cfg', cmsCore::m('board')->config)->
        assign('user_id', cmsCore::c('user')->id)->
        assign('is_admin', cmsCore::c('user')->is_admin)->
        assign('formsdata', cmsForm::getFieldsValues($item['form_id'], $item['form_array']))->
        assign('is_moder', cmsCore::m('board')->is_moderator_by_group)->
        display();
}

/////////////////////////////// NEW BOARD ITEM /////////////////////////////////
if ($do == 'additem') {
    // Получаем категории, в которые может загружать пользователь
    $catslist = cmsCore::m('board')->getPublicCats(cmsCore::m('board')->category_id);
    if (!$catslist) {
        cmsCore::addSessionMessage($_LANG['YOU_CANT_ADD_ADV_ANY'], 'error');
        $inCore->redirect('/board');
    }

    $cat['is_photos'] = 1;
    $formsdata = array();
    if (cmsCore::m('board')->category_id && cmsCore::m('board')->category_id != cmsCore::m('board')->root_cat['id']) {
        $cat = cmsCore::m('board')->getCategory(cmsCore::m('board')->category_id);
        $formsdata = cmsForm::getFieldsHtml($cat['form_id']);
    }

    cmsCore::c('page')->addPathway($_LANG['ADD_ADV']);

    if ( !cmsCore::inRequest('submit') ) {
        if (IS_BILLING) { cmsBilling::checkBalance('board', 'add_item'); }
        cmsCore::c('page')->setTitle($_LANG['ADD_ADV']);

        $item = cmsUser::sessionGet('item');
        if ($item) { cmsUser::sessionDel('item'); }

        $item['city'] = !empty($item['city']) ? $item['city'] : cmsCore::c('user')->city;

        cmsPage::initTemplate('components', 'com_board_edit')->
开发者ID:Acsac,项目名称:CMS-RuDi,代码行数:67,代码来源:frontend.php


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