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


PHP shMustCreatePageId函数代码示例

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


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

示例1: shInitializePlugin

function shInitializePlugin($lang, &$shLangName, &$shLangIso, $option)
{
    global $shMosConfig_lang, $shMosConfig_locale;
    $conf =& JFactory::getConfig();
    $configDefaultLanguage = $conf->getValue('config.language');
    $shLangName = empty($lang) ? $shMosConfig_locale : shGetNameFromIsoCode($lang);
    $shLangIso = shTranslateUrl($option, $shLangName) ? isset($lang) ? $lang : shGetIsoCodeFromName($shMosConfig_locale) : (isset($configDefaultLanguage) ? shGetIsoCodeFromName($configDefaultLanguage) : shGetIsoCodeFromName($shMosConfig_locale));
    if (strpos($shLangIso, '_') !== false) {
        //11/08/2007 14:30:16 mambo compat
        $shTemp = explode('_', $shLangIso);
        $shLangIso = $shTemp[0];
    }
    // reset pageid creation : the plugin must turn it on by itself
    shMustCreatePageId('set', false);
    // added protection : do not SEF if component is not installed. Do not attempt to build SEF URL
    // if component is not installed, or else plugin may try to read from comp DB tables. This will cause DB table names
    // to be displayed
    return !sh404SEF_CHECK_COMP_IS_INSTALLED || sh404SEF_CHECK_COMP_IS_INSTALLED && shFileExists(sh404SEF_ABS_PATH . 'components/' . $option . '/' . str_replace('com_', '', $option) . '.php');
}
开发者ID:sangkasi,项目名称:joomla,代码行数:19,代码来源:sh404sef.class.php

示例2: array

        // according to language
        // only if you have defined the
        if (!empty($sampleId)) {
            // fetch some data about the content
            try {
                // using shLib database helper is J2.x/J3.x safe
                $sampleTitle = ShlDbHelper::selectObject('#__sample_names', array('id', 'title'), array('id' => $sampleId));
            } catch (Exception $e) {
                ShlSystem_Log::error('sh404sef', '%s::%s::%d: %s', __CLASS__, __METHOD__, __LINE__, $e->getMessage());
            }
            if ($sampleTitle) {
                // if we found a title for this element
                $title[] = $sampleTitle->title;
                // insert it in URL array
                shRemoveFromGETVarsList('sampleId');
                // remove sampleId var from GET vars list
                // as we have found a text equivalent
                shMustCreatePageId('set', true);
                // NEW: ask sh404sef to create a short URL for this SEF URL (pageId)
            }
        }
        shRemoveFromGETVarsList('task');
        // also remove task, as it is not needed
        // because we can revert the SEF URL without
        // it
}
// ------------------  standard plugin finalize function - don't change ---------------------------
if ($dosef) {
    $string = shFinalizePlugin($string, $title, $shAppendString, $shItemidString, isset($limit) ? @$limit : null, isset($limitstart) ? @$limitstart : null, isset($shLangName) ? @$shLangName : null);
}
// ------------------  standard plugin finalize function - don't change ---------------------------
开发者ID:alesconti,项目名称:FF_2015,代码行数:31,代码来源:sample_com_plugin.php

示例3: _createShurl

 protected static function _createShurl($nonSefUrl)
 {
     if (empty($nonSefUrl)) {
         return '';
     }
     // only create a shURL if current page returns a 200
     $headers = JResponse::getHeaders();
     // check if we have a status
     foreach ($headers as $header) {
         if (strtolower($header['name']) == 'status' && $header['value'] != 200) {
             // error or redirection, don't shurl that
             return '';
         }
     }
     // check various conditions, to avoid overloading ourselves with shURL
     // not on homepage
     if (shIsHomepage($nonSefUrl)) {
         return '';
     }
     // not for format = raw, format = pdf or printing
     $format = shGetURLVar($nonSefUrl, 'format');
     if (in_array(strtolower($format), array('raw', 'pdf'))) {
         return '';
     }
     $print = shGetURLVar($nonSefUrl, 'print');
     if ($print == 1) {
         return '';
     }
     // not if tmpl not empty or not index
     $tmpl = shGetURLVar($nonSefUrl, 'tmpl');
     if (!empty($tmpl) && $tmpl != 'index') {
         return '';
     }
     // force global setting
     shMustCreatePageId('set', true);
     // get a model and create shURL
     $model =& JModel::getInstance('Pageids', 'Sh404sefModel');
     $shURL = $model->createPageId('', $nonSefUrl);
     return $shURL;
 }
开发者ID:sangkasi,项目名称:joomla,代码行数:40,代码来源:shurl.php


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