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


PHP cmsCore::generateCatSeoLink方法代码示例

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


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

示例1: updateNsCategorySeoLink

 /**
  * Обновляет ссылку на категорию и вложенные в нее
  * Подразумевается, что заголовок категории или поле url изменен заранее
  * @return bool
  */
 public function updateNsCategorySeoLink($table, $cat_id, $is_url_cyrillic = false)
 {
     // получаем изменяемую категорию
     $cat = $this->getNsCategory($table, $cat_id);
     if (!$cat) {
         return false;
     }
     // обновляем для нее сеолинк
     $cat_seolink = cmsCore::generateCatSeoLink($cat, $table, $is_url_cyrillic);
     $this->query("UPDATE {$table} SET seolink='{$cat_seolink}' WHERE id = '{$cat['id']}'");
     // Получаем вложенные категории для нее
     $path_list = $this->get_table($table, "NSLeft > {$cat['NSLeft']} AND NSRight < {$cat['NSRight']} AND parent_id > 0 ORDER BY NSLeft");
     if ($path_list) {
         foreach ($path_list as $pcat) {
             $subcat_seolink = cmsCore::generateCatSeoLink($pcat, $table, $is_url_cyrillic);
             $this->query("UPDATE {$table} SET seolink='{$subcat_seolink}' WHERE id = '{$pcat['id']}'");
         }
     }
     return true;
 }
开发者ID:r2git,项目名称:icms1,代码行数:25,代码来源:db.class.php

示例2: applet_cats


//.........这里部分代码省略.........
        $category['orderby']     = cmsCore::request('orderby', 'str', '');
        $category['orderto']     = cmsCore::request('orderto', 'str', '');
        $category['modgrp_id']   = cmsCore::request('modgrp_id', 'int', 0);
        $category['maxcols']     = cmsCore::request('maxcols', 'int', 0);
        $category['showtags']    = cmsCore::request('showtags', 'int', 0);
        $category['showrss']     = cmsCore::request('showrss', 'int', 0);
        $category['showdesc']    = cmsCore::request('showdesc', 'int', 0);
        $category['is_public']   = cmsCore::request('is_public', 'int', 0);
        $category['tpl']         = cmsCore::request('tpl', 'str', 'com_content_view');
        $category['pagetitle']   = cmsCore::request('pagetitle', 'str', '');
        $category['meta_desc']   = cmsCore::request('meta_desc', 'str', '');
        $category['meta_keys']   = cmsCore::request('meta_keys', 'str', '');

        $category['cost']        = cmsCore::request('cost', 'str', 0);
        if (!is_numeric($category['cost'])) { $category['cost'] = ''; }

        $album = array();
        $album['id']      = cmsCore::request('album_id', 'int', 0);
        $album['header']  = cmsCore::request('album_header', 'str', '');
        $album['orderby'] = cmsCore::request('album_orderby', 'str', '');
        $album['orderto'] = cmsCore::request('album_orderto', 'str', '');
        $album['maxcols'] = cmsCore::request('album_maxcols', 'int', 0);
        $album['max']     = cmsCore::request('album_max', 'int', 0);

        if ($album['id']) {
            $category['photoalbum'] = serialize($album);
        } else {
            $category['photoalbum'] = '';
        }

        $ns = $inCore->nestedSetsInit('cms_category');
        $category['id'] = $ns->AddNode($category['parent_id']);

        $category['seolink'] = cmsCore::generateCatSeoLink($category, 'cms_category', cmsCore::m('content')->config['is_url_cyrillic']);

        if ($category['id']) {
            cmsCore::c('db')->update('cms_category', $category, $category['id']);

            if (!cmsCore::request('is_access', 'int', 0)) {
                $showfor = cmsCore::request('showfor', 'array_int');
                cmsCore::setAccess($category['id'], $showfor, 'category');
            } else {
                cmsCore::clearAccess($category['id'], 'category');
            }
        }

        $inmenu = cmsCore::request('createmenu', 'str', '');

        if ($inmenu) {
            createMenuItem($inmenu, $category['id'], $category['title']);
        }

        cmsCore::addSessionMessage($_LANG['AD_CATEGORY_ADD'], 'success');

        cmsCore::redirect('?view=tree');
    }

    if ($do == 'add' || $do == 'edit') {
        $toolmenu = array(
            array( 'icon' => 'save.gif', 'title' => $_LANG['SAVE'], 'link' => 'javascript:document.addform.submit();' ),
            array( 'icon' => 'cancel.gif', 'title' => $_LANG['CANCEL'], 'link' => 'javascript:history.go(-1);' ),
        );
        
        cpToolMenu($toolmenu);
        
        $menu_list = cpGetList('menu');
开发者ID:Acsac,项目名称:CMS-RuDi,代码行数:67,代码来源:cats.php

示例3: applet_cats


//.........这里部分代码省略.........
        $category['maxcols'] = cmsCore::request('maxcols', 'int', 0);
        $category['showtags'] = cmsCore::request('showtags', 'int', 0);
        $category['showrss'] = cmsCore::request('showrss', 'int', 0);
        $category['showdesc'] = cmsCore::request('showdesc', 'int', 0);
        $category['is_public'] = cmsCore::request('is_public', 'int', 0);
        $category['tpl'] = cmsCore::request('tpl', 'str', 'com_content_view.tpl');
        $category['pagetitle'] = cmsCore::request('pagetitle', 'str', '');
        $category['meta_desc'] = cmsCore::request('meta_desc', 'str');
        $category['meta_keys'] = cmsCore::request('meta_keys', 'str');
        $category['redirect_url'] = cmsCore::request('redirect_url', 'str');
        //new
        $category['show_in_main'] = cmsCore::request('show_in_main', 'int', 0);
        //new
        $category['perpage_item'] = cmsCore::request('perpage_item', 'str');
        //new
        $category['cost'] = cmsCore::request('cost', 'str', 0);
        if (!is_numeric($category['cost'])) {
            $category['cost'] = '';
        }
        $album = array();
        $album['id'] = cmsCore::request('album_id', 'int', 0);
        $album['header'] = cmsCore::request('album_header', 'str', '');
        $album['orderby'] = cmsCore::request('album_orderby', 'str', '');
        $album['orderto'] = cmsCore::request('album_orderto', 'str', '');
        $album['maxcols'] = cmsCore::request('album_maxcols', 'int', 0);
        $album['max'] = cmsCore::request('album_max', 'int', 0);
        if ($album['id']) {
            $category['photoalbum'] = serialize($album);
        } else {
            $category['photoalbum'] = '';
        }
        $ns = $inCore->nestedSetsInit('cms_category');
        $category['id'] = $ns->AddNode($category['parent_id']);
        $category['seolink'] = cmsCore::generateCatSeoLink($category, 'cms_category', $model->config['is_url_cyrillic']);
        if ($category['id']) {
            $inDB->update('cms_category', $category, $category['id']);
            if (!cmsCore::request('is_access', 'int', 0)) {
                $showfor = $_REQUEST['showfor'];
                cmsCore::setAccess($category['id'], $showfor, 'category');
            } else {
                cmsCore::clearAccess($category['id'], 'category');
            }
        }
        $inmenu = cmsCore::request('createmenu', 'str', '');
        if ($inmenu) {
            createMenuItem($inmenu, $category['id'], $category['title']);
        }
        //подгружаем параметры фото
        $small_size_w = cmsCore::request('img_small_w', 'str', '');
        $medium_size_w = cmsCore::request('img_big_w', 'str', '');
        $thumbsqr = cmsCore::request('img_sqr', 'str', '');
        // Загружаем класс загрузки фото
        cmsCore::loadClass('upload_photo');
        $inUploadPhoto = cmsUploadPhoto::getInstance();
        // Выставляем конфигурационные параметры
        $inUploadPhoto->upload_dir = PATH . '/images/photos/';
        $inUploadPhoto->small_size_w = $small_size_w;
        $inUploadPhoto->medium_size_w = $medium_size_w;
        $inUploadPhoto->thumbsqr = $thumbsqr;
        $inUploadPhoto->is_watermark = $model->config['watermark'];
        $inUploadPhoto->input_name = 'picture';
        $inUploadPhoto->filename = $file;
        // Процесс загрузки фото
        $inUploadPhoto->uploadPhoto();
        //var_dump($inUploadPhoto);
        cmsCore::addSessionMessage($_LANG['AD_CATEGORY_ADD'], 'success');
开发者ID:vityapro,项目名称:cms,代码行数:67,代码来源:cats.php

示例4: applet_cats


//.........这里部分代码省略.........
        $category['published'] = cmsCore::request('published', 'int', 0);
        $category['showdate'] = cmsCore::request('showdate', 'int', 0);
        $category['showcomm'] = cmsCore::request('showcomm', 'int', 0);
        $category['orderby'] = cmsCore::request('orderby', 'str');
        $category['orderto'] = cmsCore::request('orderto', 'str');
        $category['modgrp_id'] = cmsCore::request('modgrp_id', 'int', 0);
        $category['maxcols'] = cmsCore::request('maxcols', 'int', 0);
        $category['showtags'] = cmsCore::request('showtags', 'int', 0);
        $category['showrss'] = cmsCore::request('showrss', 'int', 0);
        $category['showdesc'] = cmsCore::request('showdesc', 'int', 0);
        $category['is_public'] = cmsCore::request('is_public', 'int', 0);
        $category['tpl'] = cmsCore::request('tpl', 'str', 'com_content_view.tpl');
        $category['pagetitle'] = cmsCore::request('pagetitle', 'str', '');
        $category['meta_desc'] = cmsCore::request('meta_desc', 'str');
        $category['meta_keys'] = cmsCore::request('meta_keys', 'str');
        $category['cost'] = cmsCore::request('cost', 'str', 0);
        if (!is_numeric($category['cost'])) {
            $category['cost'] = '';
        }
        $album = array();
        $album['id'] = cmsCore::request('album_id', 'int', 0);
        $album['header'] = cmsCore::request('album_header', 'str', '');
        $album['orderby'] = cmsCore::request('album_orderby', 'str', '');
        $album['orderto'] = cmsCore::request('album_orderto', 'str', '');
        $album['maxcols'] = cmsCore::request('album_maxcols', 'int', 0);
        $album['max'] = cmsCore::request('album_max', 'int', 0);
        if ($album['id']) {
            $category['photoalbum'] = serialize($album);
        } else {
            $category['photoalbum'] = '';
        }
        $ns = $inCore->nestedSetsInit('cms_category');
        $category['id'] = $ns->AddNode($category['parent_id']);
        $category['seolink'] = cmsCore::generateCatSeoLink($category, 'cms_category', $model->config['is_url_cyrillic']);
        if ($category['id']) {
            $inDB->update('cms_category', $category, $category['id']);
            if (!cmsCore::request('is_access', 'int', 0)) {
                $showfor = $_REQUEST['showfor'];
                cmsCore::setAccess($category['id'], $showfor, 'category');
            } else {
                cmsCore::clearAccess($category['id'], 'category');
            }
        }
        $inmenu = cmsCore::request('createmenu', 'str', '');
        if ($inmenu) {
            createMenuItem($inmenu, $category['id'], $category['title']);
        }
        cmsCore::addSessionMessage($_LANG['AD_CATEGORY_ADD'], 'success');
        cmsCore::redirect('?view=tree');
    }
    if ($do == 'add' || $do == 'edit') {
        require '../includes/jwtabs.php';
        $GLOBALS['cp_page_head'][] = jwHeader();
        $toolmenu = array();
        $toolmenu[0]['icon'] = 'save.gif';
        $toolmenu[0]['title'] = $_LANG['SAVE'];
        $toolmenu[0]['link'] = 'javascript:document.addform.submit();';
        $toolmenu[1]['icon'] = 'cancel.gif';
        $toolmenu[1]['title'] = $_LANG['CANCEL'];
        $toolmenu[1]['link'] = 'javascript:history.go(-1);';
        cpToolMenu($toolmenu);
        $menu_list = cpGetList('menu');
        if ($do == 'add') {
            echo '<h3>' . $_LANG['AD_CREATE_SECTION'] . '</h3>';
            cpAddPathway($_LANG['AD_CREATE_SECTION'], 'index.php?view=cats&do=add');
            $mod['tpl'] = 'com_content_view.tpl';
开发者ID:r2git,项目名称:icms1,代码行数:67,代码来源:cats.php

示例5: applet_cats


//.........这里部分代码省略.........
        $category['published'] = cmsCore::request('published', 'int', 0);
        $category['showdate'] = cmsCore::request('showdate', 'int', 0);
        $category['showcomm'] = cmsCore::request('showcomm', 'int', 0);
        $category['orderby'] = cmsCore::request('orderby', 'str', '');
        $category['orderto'] = cmsCore::request('orderto', 'str', '');
        $category['modgrp_id'] = cmsCore::request('modgrp_id', 'int', 0);
        $category['maxcols'] = cmsCore::request('maxcols', 'int', 0);
        $category['showtags'] = cmsCore::request('showtags', 'int', 0);
        $category['showrss'] = cmsCore::request('showrss', 'int', 0);
        $category['showdesc'] = cmsCore::request('showdesc', 'int', 0);
        $category['is_public'] = cmsCore::request('is_public', 'int', 0);
        $category['tpl'] = cmsCore::request('tpl', 'str', 'com_content_view');
        $category['pagetitle'] = cmsCore::request('pagetitle', 'str', '');
        $category['meta_desc'] = cmsCore::request('meta_desc', 'str', '');
        $category['meta_keys'] = cmsCore::request('meta_keys', 'str', '');
        $category['cost'] = cmsCore::request('cost', 'str', 0);
        if (!is_numeric($category['cost'])) {
            $category['cost'] = '';
        }
        $album = array();
        $album['id'] = cmsCore::request('album_id', 'int', 0);
        $album['header'] = cmsCore::request('album_header', 'str', '');
        $album['orderby'] = cmsCore::request('album_orderby', 'str', '');
        $album['orderto'] = cmsCore::request('album_orderto', 'str', '');
        $album['maxcols'] = cmsCore::request('album_maxcols', 'int', 0);
        $album['max'] = cmsCore::request('album_max', 'int', 0);
        if ($album['id']) {
            $category['photoalbum'] = serialize($album);
        } else {
            $category['photoalbum'] = '';
        }
        $ns = $inCore->nestedSetsInit('cms_category');
        $category['id'] = $ns->AddNode($category['parent_id']);
        $category['seolink'] = cmsCore::generateCatSeoLink($category, 'cms_category', cmsCore::m('content')->config['is_url_cyrillic']);
        if ($category['id']) {
            cmsCore::c('db')->update('cms_category', $category, $category['id']);
            if (!cmsCore::request('is_access', 'int', 0)) {
                $showfor = cmsCore::request('showfor', 'array_int');
                cmsCore::setAccess($category['id'], $showfor, 'category');
            } else {
                cmsCore::clearAccess($category['id'], 'category');
            }
        }
        $inmenu = cmsCore::request('createmenu', 'str', '');
        if ($inmenu) {
            createMenuItem($inmenu, $category['id'], $category['title']);
        }
        cmsCore::addSessionMessage($_LANG['AD_CATEGORY_ADD'], 'success');
        cmsCore::redirect('?view=tree');
    }
    if ($do == 'add' || $do == 'edit') {
        $toolmenu = array(array('icon' => 'save.gif', 'title' => $_LANG['SAVE'], 'link' => 'javascript:document.addform.submit();'), array('icon' => 'cancel.gif', 'title' => $_LANG['CANCEL'], 'link' => 'javascript:history.go(-1);'));
        cpToolMenu($toolmenu);
        $menu_list = cpGetList('menu');
        if ($do == 'add') {
            echo '<h3>' . $_LANG['AD_CREATE_SECTION'] . '</h3>';
            cpAddPathway($_LANG['AD_CREATE_SECTION'], 'index.php?view=cats&do=add');
            $mod = array();
            $mod['tpl'] = 'com_content_view';
        } else {
            if (cmsCore::inRequest('multiple')) {
                if (cmsCore::inRequest('item')) {
                    $_SESSION['editlist'] = cmsCore::request('item', 'array_int');
                } else {
                    echo '<p class="error">' . $_LANG['AD_NO_SELECT_OBJECTS'] . '</p>';
                    return;
开发者ID:CMS-RuDi,项目名称:CMS-RuDi,代码行数:67,代码来源:cats.php


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