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


PHP cmsCore::includeFile方法代码示例

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


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

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

示例2: mod_uc_random

function mod_uc_random($mod, $cfg) {
    if ($cfg['cat_id']>0) {
        if (!$cfg['subs']) {
            //select from category
            $catsql = ' AND i.category_id = '. $cfg['cat_id'];
        } else {
            //select from category and subcategories
            $rootcat = cmsCore::c('db')->get_fields('cms_uc_cats', "id='". $cfg['cat_id'] ."'", 'NSLeft, NSRight');
            
            if (!$rootcat) { return false; }
            
            $catsql = "AND (c.NSLeft >= ". $rootcat['NSLeft'] ." AND c.NSRight <= ". $rootcat['NSRight'] .")";
        }
    } else {
        $catsql = '';
    }

    $sql = "SELECT i.*, c.title as category, c.view_type as viewtype
            FROM cms_uc_items i
            LEFT JOIN cms_uc_cats c ON c.id = i.category_id
            WHERE i.published = 1 ". $catsql ."
            ORDER BY RAND()
            LIMIT ". $cfg['count'];

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

    $items = array();
    $is_uc = false;

    if (cmsCore::c('db')->num_rows($result)) {
        $is_uc = true;
        while ($item=cmsCore::c('db')->fetch_assoc($result)) {
            if (mb_strlen($item['imageurl']) < 4) {
                $item['imageurl'] = 'nopic.jpg';
            } else if (!file_exists(PATH .'/images/catalog/small/'. $item['imageurl'])) {
                $item['imageurl'] = 'nopic.jpg';
            }

            if ($item['viewtype'] == 'shop') {
                cmsCore::includeFile('components/catalog/includes/shopcore.php');
                $item['price'] = number_format(shopDiscountPrice($item['id'], $item['category_id'], $item['price']), 2, '.', ' ');
            }

            $items[] = $item;
        }
    }

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

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

示例3: getInstance

 public static function getInstance()
 {
     if (self::$instance === null) {
         self::$instance = new self();
         // подключаем хелпер основного шаблона
         if (!cmsCore::includeFile('templates/' . self::$instance->getName() . '/assets/helper.php')) {
             cmsCore::loadLib('template.helper');
         }
     }
     return self::$instance;
 }
开发者ID:Val-Git,项目名称:icms2,代码行数:11,代码来源:template.php

示例4: loadSmarty

 private function loadSmarty()
 {
     if (isset(self::$i_smarty)) {
         return self::$i_smarty;
     }
     cmsCore::includeFile('/includes/smarty/libs/Smarty.class.php');
     $smarty = new Smarty();
     $smarty->setCompileDir(PATH . '/cache/');
     $smarty->setCacheDir(PATH . '/cache/');
     $smarty->assign('is_ajax', cmsCore::isAjax());
     $smarty->assign('is_auth', cmsUser::getInstance()->id);
     self::$i_smarty = $smarty;
     return $smarty;
 }
开发者ID:r2git,项目名称:icms1,代码行数:14,代码来源:smartyTpl.php

示例5: mod_rss

function mod_rss($module_id, $cfg)
{
    cmsCore::includeFile('includes/rss/lastRSS.php');
    $rss = new lastRSS();
    $rss->cache_dir = PATH . '/cache';
    $rss->cache_time = (int) @$cfg['cachetime'] * 3600;
    $rss->cp = 'UTF-8';
    $rss->items_limit = $cfg['itemslimit'];
    $rs = $rss->Get($cfg['rssurl']);
    if (!$rs) {
        return false;
    }
    cmsPage::initTemplate('modules', 'mod_rss')->assign('rs', $rs)->assign('cfg', $cfg)->display('mod_rss.tpl');
    return true;
}
开发者ID:4uva4ek,项目名称:svato,代码行数:15,代码来源:module.php

示例6: __construct

 function __construct($name = '')
 {
     $config = cmsConfig::getInstance();
     $this->name = $name ? $name : $config->template;
     $this->setLayout('main');
     $this->title = $config->sitename;
     $is_no_def_meta = isset($config->is_no_meta) ? $config->is_no_meta : false;
     if (!$is_no_def_meta) {
         $this->metakeys = $config->metakeys;
         $this->metadesc = $config->metadesc;
     }
     $this->path = $config->root_path . 'templates/' . $this->name;
     $this->options = $this->getOptions();
     if (!cmsCore::includeFile('templates/' . $this->name . '/assets/helper.php')) {
         cmsCore::loadLib('template.helper');
     }
 }
开发者ID:asphix,项目名称:icms2,代码行数:17,代码来源:template.php

示例7: loadSmarty

 private function loadSmarty()
 {
     if (isset(self::$i_smarty)) {
         return self::$i_smarty;
     }
     cmsCore::includeFile('/includes/smarty/libs/Smarty.class.php');
     $smarty = new Smarty();
     $smarty->compile_dir = PATH . '/cache';
     $smarty->register_function('wysiwyg', 'cmsSmartyWysiwyg');
     $smarty->register_function('profile_url', 'cmsSmartyProfileURL');
     $smarty->register_function('component', 'cmsSmartyCurrentComponent');
     $smarty->register_function('template', 'cmsSmartyCurrentTemplate');
     $smarty->register_function('add_js', 'cmsSmartyAddJS');
     $smarty->register_function('add_css', 'cmsSmartyAddCSS');
     $smarty->register_function('comments', 'cmsSmartyComments');
     $smarty->assign('is_ajax', cmsCore::isAjax());
     self::$i_smarty = $smarty;
     return $smarty;
 }
开发者ID:vicktorwork,项目名称:cms1,代码行数:19,代码来源:smartyTpl.php

示例8: getControllersMapping

 public static function getControllersMapping()
 {
     if (self::$mapping !== null) {
         return self::$mapping;
     }
     self::$mapping = array();
     $map_file = 'system/config/remap.php';
     $map_function = 'remap_controllers';
     if (!cmsCore::includeFile($map_file)) {
         return false;
     }
     if (!function_exists($map_function)) {
         return false;
     }
     self::$mapping = call_user_func($map_function);
     if (!is_array(self::$mapping)) {
         return false;
     }
     return self::$mapping;
 }
开发者ID:uzunhair,项目名称:icms2,代码行数:20,代码来源:config.php

示例9: execute

 public function execute($event = '', $item = array())
 {
     parent::execute();
     $inUser = cmsUser::getInstance();
     cmsCore::includeFile('plugins/p_fckeditor/fckeditor/fckeditor.php');
     $oFCKeditor = new FCKeditor($item['name']);
     $oFCKeditor->BasePath = '/plugins/p_fckeditor/fckeditor/';
     $oFCKeditor->Height = $item['height'];
     $oFCKeditor->Width = $item['width'];
     $oFCKeditor->ToolbarSet = $inUser->is_admin ? 'Admin' : 'Basic';
     $oFCKeditor->Value = $item['text'];
     $oFCKeditor->Config['DefaultLanguage'] = cmsConfig::getConfig('lang');
     $oFCKeditor->Config['AutoDetectLanguage'] = false;
     if (!$inUser->is_admin) {
         $oFCKeditor->Config['ImageBrowser'] = false;
         $oFCKeditor->Config['LinkUpload'] = false;
         $oFCKeditor->Config['LinkBrowser'] = false;
     }
     ob_start();
     $oFCKeditor->Create();
     return ob_get_clean();
 }
开发者ID:4uva4ek,项目名称:svato,代码行数:22,代码来源:plugin.php

示例10: mod_cart

function mod_cart($mod, $cfg) {
    cmsCore::includeFile('components/catalog/includes/shopcore.php');

    $sid   = session_id();
    $items = array();
    $total_summ = 0;

    $user_sql = cmsCore::c('user')->id ? "c.user_id='". cmsCore::c('user')->id ."'" : "c.session_id='". $sid ."'";

    $sql = "SELECT i.title, i.price, i.category_id, i.id, c.itemscount
            FROM cms_uc_cart c
            INNER JOIN cms_uc_items i ON i.id = c.item_id
            WHERE ". $user_sql;
    $result = cmsCore::c('db')->query($sql);
    $items_count = cmsCore::c('db')->num_rows($result);

    if ($items_count) {
        while($con = cmsCore::c('db')->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', $cfg['tpl'])->
        assign('cfg', $cfg)->
        assign('items_count', $items_count)->
        assign('total_summ', number_format($total_summ, 2, '.', ' '))->
        assign('items', $items)->
        display();

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

示例11: html_wysiwyg

function html_wysiwyg($field_id, $content = '', $wysiwyg = false)
{
    $config = cmsConfig::getInstance();
    if (!$wysiwyg) {
        $config = cmsConfig::getInstance();
        $wysiwyg = $config->wysiwyg;
    }
    $connector = 'wysiwyg/' . $wysiwyg . '/wysiwyg.class.php';
    if (!file_exists($config->root_path . $connector)) {
        return '<textarea id="' . $field_id . '" name="' . $field_id . '">' . $content . '</textarea>';
    }
    cmsCore::includeFile($connector);
    $class_name = 'cmsWysiwyg' . ucfirst($wysiwyg);
    $editor = new $class_name();
    ob_start();
    $editor->displayEditor($field_id, $content);
    return ob_get_clean();
}
开发者ID:selimoves,项目名称:icms2,代码行数:18,代码来源:html.helper.php

示例12: session_start

//                           InstantCMS v1.10.6                               //
//                        http://www.instantcms.ru/                           //
//                                                                            //
//                   written by InstantCMS Team, 2007-2015                    //
//                produced by InstantSoft, (www.instantsoft.ru)               //
//                                                                            //
//                        LICENSED BY GNU/GPL v2                              //
//                                                                            //
/******************************************************************************/
session_start();
setlocale(LC_ALL, "ru_RU.UTF-8");
header('Content-Type: text/html; charset=utf-8');
define('VALID_CMS', 1);
define('PATH', $_SERVER['DOCUMENT_ROOT']);
include PATH . '/core/cms.php';
cmsCore::includeFile('install/function.php');
cmsCore::loadClass('config');
cmsCore::loadClass('db');
cmsCore::loadClass('user');
cmsCore::loadClass('page');
cmsCore::loadClass('actions');
$inConf = cmsConfig::getInstance();
// Мультиязычная установка
$inConf->lang = isset($_SESSION['inst_lang']) ? $_SESSION['inst_lang'] : $inConf->lang;
$langs = cmsCore::getDirsList('/languages');
// запрос на смену языка
if (cmsCore::inRequest('lang')) {
    $inst_lang = cmsCore::request('lang', 'html', 'ru');
    if (in_array($inst_lang, $langs)) {
        $_SESSION['inst_lang'] = $inst_lang;
        $inConf->lang = $inst_lang;
开发者ID:r2git,项目名称:icms1,代码行数:31,代码来源:index.php

示例13: getAgainst

    /**
     * Подготавливает строку поиска для sql запроса
     * формирует $this->against и $this->words
     * @return bool
     */
    protected function getAgainst() {
        // если уже получали, возвращаемся
        if (!empty($this->against) && !empty($this->words)) { return true; }
        
        $this->against = array();
        $this->words = array();

        // Подключаем стеммер Портера
        cmsCore::includeFile('includes/stemmer/stemmer.php');
        $stemmer = new Lingua_Stem_Ru();
        
        // формируем массив слов
        $words = preg_split('/[\s,-]+/', $this->query, null, PREG_SPLIT_NO_EMPTY);
        
        if ($this->look == 'anyword' || $this->look == 'allwords') {
            foreach($words as $w) {
                $w = trim($w);
                if (mb_strlen($w) > 3) {
                    if (mb_strlen($w) == 4) {
                        $this->against[] = '('. $w .' | *'. $w .'*)';
                        $this->words[] = $w;
                    } else {
                        $w = $stemmer->stem_word($w);
                        $this->against[] = '('. $w .' | *'. $w .'*)';
                        $this->words[] = $w;
                    }
                }
            }
        }
        
        // любое слово
        if ($this->look == 'anyword') {
            $this->against = implode(' | ', $this->against);
        }
        
        // все слова
        if ($this->look == 'allwords') {
            $this->against = implode(' & ', $this->against);
        }
        
        // фраза целиком
        if ($this->look == 'phrase') {
            $this->against = '*'. $this->query .'*';
            $this->words = $words;
        } else {
            $this->words = implode(' ', $this->words);
        }

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

示例14: loadModuleInstaller

 public function loadModuleInstaller($module)
 {
     return cmsCore::includeFile('modules/' . $module . '/install.php');
 }
开发者ID:r2git,项目名称:icms1,代码行数:4,代码来源:cms_admin.php

示例15: define

<?php

/******************************************************************************/
//                                                                            //
//                           InstantCMS v1.10.4                               //
//                        http://www.instantcms.ru/                           //
//                                                                            //
//                   written by InstantCMS Team, 2007-2014                    //
//                produced by InstantSoft, (www.instantsoft.ru)               //
//                                                                            //
//                        LICENSED BY GNU/GPL v2                              //
//                                                                            //
/******************************************************************************/
define('PATH', $_SERVER['DOCUMENT_ROOT']);
include PATH . '/core/ajax/ajax_core.php';
cmsCore::loadLanguage('modules/mod_latest');
$module_id = cmsCore::request('module_id', 'int', '');
if (!$module_id) {
    cmsCore::halt();
}
$cfg = $inCore->loadModuleConfig($module_id);
// номер страницы передаем через конфиг
$cfg['page'] = cmsCore::request('page', 'int', 1);
cmsCore::includeFile('modules/mod_latest/module.php');
mod_latest($module_id, $cfg);
开发者ID:4uva4ek,项目名称:svato,代码行数:25,代码来源:latest.php


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