• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP XoopsLocale类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: render

 /**
  * render
  *
  * @return string rendered form element
  */
 public function render()
 {
     static $included = false;
     $xoops = \Xoops::getInstance();
     $ele_value = (string) $this->getValue(false);
     $display_value = $ele_value;
     if (0 < (int) $ele_value) {
         $display_value = date(\XoopsLocale::getFormatShortDate(), $ele_value);
     }
     if ($this->getSize() > $this->getMaxcols()) {
         $maxcols = $this->getMaxcols();
     } else {
         $maxcols = $this->getSize();
     }
     $this->addAttribute('class', 'span' . $maxcols);
     $dlist = $this->isDatalist();
     if (!empty($dlist)) {
         $this->addAttribute('list', 'list_' . $this->getName());
     }
     $attributes = $this->renderAttributeString();
     $xoops->theme()->addBaseStylesheetAssets('@jqueryuicss');
     $xoops->theme()->addBaseScriptAssets('@jqueryui');
     // TODO - select and apply script by locale, example:
     // $i18nScript = 'media/jquery/ui/i18n/datepicker-es.js';
     // $xoops->theme()->addBaseScriptAssets($i18nScript);
     $xoops->theme()->addScript('', '', ' $(function() { $( "#' . $this->getAttribute('id') . '" ).datepicker({' . 'showOn: "button", buttonImageOnly: false, ' . 'buttonImage: "' . $xoops->url('media/xoops/images/icons/calendar.png') . '", ' . 'buttonImageOnly: false, buttonText: "' . \XoopsLocale::A_SELECT . '" }); }); ');
     return '<input ' . $attributes . 'value="' . $display_value . '" ' . $this->getExtra() . ' >';
 }
开发者ID:redmexico,项目名称:XoopsCore,代码行数:33,代码来源:DateSelect.php


示例2: getList

 /**
  * Get a list of localized timezone names
  *
  * @return array
  */
 public static function getList()
 {
     $xoops = \Xoops::getInstance();
     $locale = \Xoops\Locale::getCurrent();
     $key = ['system', 'lists', 'timezone', $locale];
     //$xoops->cache()->delete($key);
     $timeZones = $xoops->cache()->cacheRead($key, function () {
         $timeZones = array();
         $territories = Territory::getContinentsAndCountries();
         $maxLen = 0;
         $utcDtz = new \DateTimeZone('UTC');
         foreach ($territories as $byContinent) {
             $continent = $byContinent['name'];
             foreach ($byContinent['children'] as $cCode => $cName) {
                 $allZones = $utcDtz->listIdentifiers(\DateTimeZone::PER_COUNTRY, $cCode);
                 foreach ($allZones as $zone) {
                     $maxLen = max(strlen($zone), $maxLen);
                     $name = Calendar::getTimezoneExemplarCity($zone);
                     if (!isset($timeZones[$zone]) && !empty($name)) {
                         $timeZones[$zone] = $continent . '/' . $name;
                     }
                 }
             }
         }
         \XoopsLocale::asort($timeZones);
         $default = array('UTC' => Calendar::getTimezoneNameNoLocationSpecific(new \DateTimeZone('GMT')));
         $timeZones = array_merge($default, $timeZones);
         return $timeZones;
     });
     return $timeZones;
 }
开发者ID:ming-hai,项目名称:XoopsCore,代码行数:36,代码来源:TimeZone.php


示例3: __construct

 /**
  * Constructor
  *
  * @return XoopsMailerLocal
  */
 public function __construct()
 {
     parent::__construct();
     // It is supposed no need to change the charset
     $this->charSet = strtolower(XoopsLocale::getCharset());
     // You MUST specify the language code value so that the file exists: XOOPS_ROOT_PAT/class/mail/phpmailer/language/lang-["your-language-code"].php
     $this->multimailer->SetLanguage("en");
 }
开发者ID:ming-hai,项目名称:XoopsCore,代码行数:13,代码来源:_xoopsmailerlocal.php


示例4: publisher_search

/**
 * @copyright       The XUUPS Project http://sourceforge.net/projects/xuups/
 * @license         GNU GPL V2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
 * @package         Publisher
 * @since           1.0
 * @author          trabis <[email protected]>
 * @version         $Id$
 */
function publisher_search($queryarray, $andor, $limit, $offset, $userid, $categories = array(), $sortby = 0, $searchin = "", $extra = "")
{
    $publisher = Publisher::getInstance();
    $ret = array();
    if ($queryarray == '' || count($queryarray) == 0) {
        $hightlight_key = '';
    } else {
        $keywords = implode('+', $queryarray);
        $hightlight_key = "&amp;keywords=" . $keywords;
    }
    $itemsObjs = $publisher->getItemHandler()->getItemsFromSearch($queryarray, $andor, $limit, $offset, $userid, $categories, $sortby, $searchin, $extra);
    $withCategoryPath = $publisher->getConfig('search_cat_path');
    $usersIds = array();
    /* @var $obj PublisherItem */
    foreach ($itemsObjs as $obj) {
        $item['image'] = "images/item_icon.gif";
        $item['link'] = $obj->getItemUrl();
        $item['link'] .= !empty($hightlight_key) && strpos($item['link'], '.php?') === false ? "?" . ltrim($hightlight_key, '&amp;') : $hightlight_key;
        if ($withCategoryPath) {
            $item['title'] = $obj->getCategoryPath(false) . " > " . $obj->title();
        } else {
            $item['title'] = $obj->title();
        }
        $item['time'] = $obj->getVar('datesub');
        //must go has unix timestamp
        $item['uid'] = $obj->getVar('uid');
        //"Fulltext search/highlight
        $text = $obj->body();
        $sanitized_text = "";
        $text_i = strtolower($text);
        $queryarray = is_array($queryarray) ? $queryarray : array($queryarray);
        //@todo look into xoopslocal
        foreach ($queryarray as $query) {
            $pos = strpos($text_i, strtolower($query));
            //xoops_local("strpos", $text_i, strtolower($query));
            $start = max($pos - 100, 0);
            $length = strlen($query) + 200;
            //xoops_local("strlen", $query) + 200;
            $context = $obj->highlight(XoopsLocale::substr($text, $start, $length, " [...]"), $query);
            $sanitized_text .= "<p>[...] " . $context . "</p>";
        }
        //End of highlight
        $item['text'] = $sanitized_text;
        $item['author'] = $obj->getVar('author_alias');
        $item['datesub'] = $obj->datesub($publisher->getConfig('format_date'));
        $usersIds[$obj->getVar('uid')] = $obj->getVar('uid');
        $ret[] = $item;
        unset($item, $sanitized_text);
    }
    $usersNames = XoopsUserUtility::getUnameFromIds($usersIds, $publisher->getConfig('format_realname'), true);
    foreach ($ret as $key => $item) {
        if ($item["author"] == '') {
            $ret[$key]["author"] = @$usersNames[$item["uid"]];
        }
    }
    unset($usersNames, $usersIds);
    return $ret;
}
开发者ID:ming-hai,项目名称:XoopsCore,代码行数:66,代码来源:search.inc.php


示例5: getExtensionList

 /**
  * Return all extensions
  *
  * @return array
  */
 public function getExtensionList()
 {
     // Get main instance
     $xoops = Xoops::getInstance();
     $module_handler = $xoops->getHandlerModule();
     $moduleperm_handler = $xoops->getHandlerGroupperm();
     $ret = array();
     $i = 0;
     foreach ($this->modulesList as $file) {
         $file = trim($file);
         if (XoopsLoad::fileExists(\XoopsBaseConfig::get('root-path') . '/modules/' . $file . '/xoops_version.php')) {
             clearstatcache();
             /* @var $module XoopsModule */
             $module = $module_handler->create();
             $module->loadInfoAsVar($file);
             if ($module->getInfo('extension')) {
                 if (in_array($file, $this->modulesDirnames)) {
                     $module->setInfo('install', true);
                     $extension = $module_handler->getByDirname($module->getInfo('dirname'));
                     $module->setInfo('mid', $extension->getVar('mid'));
                     $module->setInfo('update', XoopsLocale::formatTimestamp($extension->getVar('last_update'), 's'));
                     $module->setInfo('hasconfig', $module->getVar('hasconfig'));
                     if (round($module->getInfo('version'), 2) != $extension->getVar('version')) {
                         $module->setInfo('warning_update', true);
                     }
                     $groups = array();
                     if (is_object($xoops->user)) {
                         $groups = $xoops->user->getGroups();
                     }
                     $sadmin = $moduleperm_handler->checkRight('module_admin', $module->getInfo('mid'), $groups);
                     if ($sadmin && ($module->getVar('hasnotification') || is_array($module->getInfo('config')) || is_array($module->getInfo('comments')))) {
                         $module->setInfo('link_pref', \XoopsBaseConfig::get('url') . '/modules/system/admin.php?fct=preferences&amp;op=showmod&amp;mod=' . $module->getInfo('mid'));
                     }
                 } else {
                     $module->setInfo('install', false);
                 }
                 $module->setInfo('version', round($module->getInfo('version'), 2));
                 if (XoopsLoad::fileExists(\XoopsBaseConfig::get('root-path') . '/modules/' . $module->getInfo('dirname') . '/icons/logo_small.png')) {
                     $module->setInfo('logo_small', \XoopsBaseConfig::get('url') . '/modules/' . $module->getInfo('dirname') . '/icons/logo_small.png');
                 } else {
                     $module->setInfo('logo_small', \XoopsBaseConfig::get('url') . '/media/xoops/images/icons/16/default.png');
                 }
                 if (XoopsLoad::fileExists(\XoopsBaseConfig::get('root-path') . '/modules/' . $module->getInfo('dirname') . '/icons/logo_large.png')) {
                     $module->setInfo('logo_large', \XoopsBaseConfig::get('url') . '/modules/' . $module->getInfo('dirname') . '/icons/logo_large.png');
                 } else {
                     $module->setInfo('logo_large', \XoopsBaseConfig::get('url') . '/media/xoops/images/icons/32/default.png');
                 }
                 $module->setInfo('link_admin', \XoopsBaseConfig::get('url') . '/modules/' . $module->getInfo('dirname') . '/' . $module->getInfo('adminindex'));
                 $module->setInfo('options', $module->getAdminMenu());
                 $ret[] = $module;
                 unset($module);
                 ++$i;
             }
         }
     }
     return $ret;
 }
开发者ID:RanLee,项目名称:XoopsCore,代码行数:62,代码来源:extension.php


示例6: decode

 /**
  * @return string
  */
 public static function decode($url, $width, $height)
 {
     $config = parent::loadConfig(__DIR__);
     if (empty($url) || empty($config['link'])) {
         return $url;
     }
     $charset = !empty($config['charset']) ? $config['charset'] : "UTF-8";
     $ret = "<a href='" . sprintf($config['link'], urlencode(XoopsLocale::convert_encoding($url, $charset))) . "' rel='external' title=''>{$text}</a>";
     return $ret;
 }
开发者ID:redmexico,项目名称:XoopsCore,代码行数:13,代码来源:wiki.php


示例7: loadLanguage

 /**
  * @param string $name
  */
 public function loadLanguage($name)
 {
     $helper = Menus::getInstance();
     $language = XoopsLocale::getLegacyLanguage();
     $path = $helper->path("decorators/{$name}/language");
     if (!($ret = XoopsLoad::loadFile("{$path}/{$language}/decorator.php"))) {
         $ret = XoopsLoad::loadFile("{$path}/english/decorator.php");
     }
     return $ret;
 }
开发者ID:ming-hai,项目名称:XoopsCore,代码行数:13,代码来源:decorator.php


示例8: getList

 /**
  * gets list of locales
  *
  * @param boolean $showInCodeLanguage true to show a code's name in the language the code represents
  *
  * @return array
  */
 public static function getList($showInCodeLanguage = false)
 {
     $locales = Data::getAvailableLocales();
     $languages = array();
     foreach ($locales as $locale) {
         $key = \Xoops\Locale::normalizeLocale($locale);
         $languages[$key] = Language::getName($locale, $showInCodeLanguage ? $locale : null);
     }
     \XoopsLocale::asort($languages);
     return $languages;
 }
开发者ID:elitet,项目名称:XoopsCore,代码行数:18,代码来源:Locale.php


示例9: getValues

 public function getValues($keys = null, $format = null, $maxDepth = null)
 {
     $page = Page::getInstance();
     $ret = parent::getValues($keys, $format, $maxDepth);
     $ret['rating'] = number_format($this->getVar('content_rating'), 1);
     // these next two lines are rather silly
     $ret['content_authorid'] = $this->getVar('content_author');
     $ret['content_author'] = XoopsUser::getUnameFromId($this->getVar('content_author'), true);
     $ret['content_date'] = XoopsLocale::formatTimestamp($this->getVar('content_create'), $page->getConfig('page_dateformat'));
     $ret['content_time'] = XoopsLocale::formatTimestamp($this->getVar('content_create'), $page->getConfig('page_timeformat'));
     $ret['content_rating'] = number_format($this->getVar('content_rating'), 2);
     return $ret;
 }
开发者ID:RanLee,项目名称:XoopsCore,代码行数:13,代码来源:page_content.php


示例10: execute

 function execute()
 {
     $xoops = Xoops::getInstance();
     // use HTMLPurifier inside Protector
     //require_once $xoops->path('lib/HTMLPurifier/HTMLPurifier.auto.php');
     $config = HTMLPurifier_Config::createDefault();
     $config->set('Cache', 'SerializerPath', \XoopsBaseConfig::get('lib-path'));
     $config->set('Core', 'Encoding', XoopsLocale::getCharset());
     //$config->set('HTML', 'Doctype', 'HTML 4.01 Transitional');
     $this->purifier = new HTMLPurifier($config);
     $this->method = 'purify';
     $_POST = $this->purify_recursive($_POST);
 }
开发者ID:ming-hai,项目名称:XoopsCore,代码行数:13,代码来源:postcommon_post_htmlpurify4everyone.php


示例11: getList

 /**
  * gets list of image file names in a directory
  *
  * @param string $path   filesystem path
  * @param string $prefix prefix added to file names
  *
  * @return array
  */
 public static function getList($path = null, $prefix = '')
 {
     $fileList = array();
     if (is_dir($path) && ($handle = opendir($path))) {
         while (false !== ($file = readdir($handle))) {
             if (preg_match('/\\.(gif|jpg|jpeg|png|swf)$/i', $file)) {
                 $file = $prefix . $file;
                 $fileList[$file] = $file;
             }
         }
         closedir($handle);
         \XoopsLocale::asort($fileList);
         reset($fileList);
     }
     return $fileList;
 }
开发者ID:ming-hai,项目名称:XoopsCore,代码行数:24,代码来源:ImageFile.php


示例12: __construct

 public function __construct()
 {
     parent::__construct();
     // SMARTY_PLUGINS_DIR is initialized into parent
     $xoops = Xoops::getInstance();
     $xoops->preload()->triggerEvent('core.template.construct.start', array($this));
     $this->left_delimiter = '<{';
     $this->right_delimiter = '}>';
     $this->setTemplateDir(\XoopsBaseConfig::get('themes-path'));
     $this->setCacheDir(\XoopsBaseConfig::get('smarty-cache'));
     $this->setCompileDir(\XoopsBaseConfig::get('smarty-compile'));
     $this->compile_check = $xoops->getConfig('theme_fromfile') == 1;
     $this->setPluginsDir(\XoopsBaseConfig::get('smarty-xoops-plugins'));
     $this->addPluginsDir(SMARTY_PLUGINS_DIR);
     $this->setCompileId();
     $this->assign(array('xoops_url' => \XoopsBaseConfig::get('url'), 'xoops_rootpath' => \XoopsBaseConfig::get('root-path'), 'xoops_langcode' => XoopsLocale::getLangCode(), 'xoops_charset' => XoopsLocale::getCharset(), 'xoops_version' => \Xoops::VERSION, 'xoops_upload_url' => \XoopsBaseConfig::get('uploads-url')));
 }
开发者ID:redmexico,项目名称:XoopsCore,代码行数:17,代码来源:template.php


示例13: test__construct

 public function test__construct()
 {
     $xoops = \Xoops::getInstance();
     $this->assertSame('{', $this->object->left_delimiter);
     $this->assertSame('}', $this->object->right_delimiter);
     $this->assertTrue(in_array(\XoopsBaseConfig::get('themes-path') . DIRECTORY_SEPARATOR, $this->object->getTemplateDir()));
     $this->assertSame(\XoopsBaseConfig::get('var-path') . '/caches/smarty_cache' . DIRECTORY_SEPARATOR, $this->object->getCacheDir());
     $this->assertSame(\XoopsBaseConfig::get('var-path') . '/caches/smarty_compile' . DIRECTORY_SEPARATOR, $this->object->getCompileDir());
     $this->assertSame($xoops->getConfig('theme_fromfile') == 1, $this->object->compile_check);
     $this->assertSame(array(\XoopsBaseConfig::get('lib-path') . '/smarty/xoops_plugins' . DIRECTORY_SEPARATOR, SMARTY_DIR . 'plugins' . DS), $this->object->plugins_dir);
     $this->assertSame(\XoopsBaseConfig::get('url'), $this->object->getTemplateVars('xoops_url'));
     $this->assertSame(\XoopsBaseConfig::get('root-path'), $this->object->getTemplateVars('xoops_rootpath'));
     $this->assertSame(\XoopsLocale::getLangCode(), $this->object->getTemplateVars('xoops_langcode'));
     $this->assertSame(\XoopsLocale::getCharset(), $this->object->getTemplateVars('xoops_charset'));
     $this->assertSame(\Xoops::VERSION, $this->object->getTemplateVars('xoops_version'));
     $this->assertSame(\XoopsBaseConfig::get('uploads-url'), $this->object->getTemplateVars('xoops_upload_url'));
 }
开发者ID:ming-hai,项目名称:XoopsCore,代码行数:17,代码来源:XoopsTplTest.php


示例14: xlanguage_convert_item

/**
 * @param string $value
 * @param string $out_charset
 * @param string $in_charset
 *
 * @return string
 */
function xlanguage_convert_item($value, $out_charset, $in_charset)
{
    $xoops = Xoops::getInstance();
    if (strtolower($in_charset) == strtolower($out_charset)) {
        return $value;
    }
    $xconv_handler = $xoops->getModuleHandler('xconv', 'xconv', true);
    if (is_object($xconv_handler) && ($converted_value = @$xconv_handler->convert_encoding($value, $out_charset, $in_charset))) {
        return $converted_value;
    }
    if (XoopsLocale::isMultiByte() && function_exists('mb_convert_encoding')) {
        $converted_value = @mb_convert_encoding($value, $out_charset, $in_charset);
    } elseif (function_exists('iconv')) {
        $converted_value = @iconv($in_charset, $out_charset, $value);
    }
    $value = empty($converted_value) ? $value : $converted_value;
    return $value;
}
开发者ID:ming-hai,项目名称:XoopsCore,代码行数:25,代码来源:functions.php


示例15: loadLanguage

 /**
  * @param   string   $name       Name of language file to be loaded, without extension
  * @param   mixed    $domain     string: Module dirname; global language file will be loaded if $domain is set to 'global' or not specified
  *                               array:  example; array('Frameworks/moduleclasses/moduleadmin')
  * @param   string   $language   Language to be loaded, current language content will be loaded if not specified
  *
  * @return  boolean
  */
 public static function loadLanguage($name, $domain = '', $language = null)
 {
     if (empty($name)) {
         return false;
     }
     $language = empty($language) ? XoopsLocale::getLegacyLanguage() : $language;
     // expanded domain to multiple categories, e.g. module:system, framework:filter, etc.
     if (empty($domain) || 'global' == $domain) {
         $path = '';
     } else {
         $path = is_array($domain) ? array_shift($domain) : "modules/{$domain}";
     }
     $xoops = Xoops::getInstance();
     $fullPath = $xoops->path("{$path}/language/{$language}/{$name}.php");
     if (!($ret = XoopsLoad::loadFile($fullPath))) {
         $fullPath2 = $xoops->path("{$path}/language/english/{$name}.php");
         $ret = XoopsLoad::loadFile($fullPath2);
     }
     return $ret;
 }
开发者ID:redmexico,项目名称:XoopsCore,代码行数:28,代码来源:Locale.php


示例16: b_system_newmembers_show

/**
 * @return array|bool|string
 */
function b_system_newmembers_show($options)
{
    $xoops = Xoops::getInstance();
    $block = array();
    $criteria = new CriteriaCompo(new Criteria('level', 0, '>'));
    $limit = !empty($options[0]) ? $options[0] : 10;
    $criteria->setOrder('DESC');
    $criteria->setSort('user_regdate');
    $criteria->setLimit($limit);
    $member_handler = $xoops->getHandlerMember();
    $newmembers = $member_handler->getUsers($criteria);
    $count = count($newmembers);
    for ($i = 0; $i < $count; ++$i) {
        if ($options[1] == 1) {
            $block['users'][$i]['avatar'] = $newmembers[$i]->getVar('user_avatar') !== 'blank.gif' ? \XoopsBaseConfig::get('uploads-url') . '/' . $newmembers[$i]->getVar('user_avatar') : '';
        } else {
            $block['users'][$i]['avatar'] = '';
        }
        $block['users'][$i]['id'] = $newmembers[$i]->getVar('uid');
        $block['users'][$i]['name'] = $newmembers[$i]->getVar('uname');
        $block['users'][$i]['joindate'] = XoopsLocale::formatTimestamp($newmembers[$i]->getVar('user_regdate'), 's');
    }
    return $block;
}
开发者ID:ming-hai,项目名称:XoopsCore,代码行数:27,代码来源:newmembers.php


示例17: array

$content_arr = $content_Handler->getPagePublished($start, $nb_limit);
// Assign Template variables
$xoops->tpl()->assign('content_count', $content_count);
$keywords = array();
if ($content_count > 0) {
    //Cleaning the content of $content, they are assign by blocks and mess the output
    $xoops->tpl()->assign('content', array());
    foreach (array_keys($content_arr) as $i) {
        $content_id = $content_arr[$i]->getVar('content_id');
        $content['id'] = $content_id;
        $content['title'] = $content_arr[$i]->getVar('content_title');
        $content['shorttext'] = $content_arr[$i]->getVar('content_shorttext');
        $content['authorid'] = $content_arr[$i]->getVar('content_author');
        $content['author'] = XoopsUser::getUnameFromId($content_arr[$i]->getVar('content_author'));
        $content['date'] = XoopsLocale::formatTimestamp($content_arr[$i]->getVar('content_create'), $helper->getConfig('page_dateformat'));
        $content['time'] = XoopsLocale::formatTimestamp($content_arr[$i]->getVar('content_create'), $helper->getConfig('page_timeformat'));
        $xoops->tpl()->appendByRef('content', $content);
        $keywords[] = $content_arr[$i]->getVar('content_title');
        unset($content);
    }
    // Display Page Navigation
    if ($content_count > $nb_limit) {
        $nav = new XoopsPageNav($content_count, $nb_limit, $start, 'start');
        $xoops->tpl()->assign('nav_menu', $nav->renderNav(4));
    }
} else {
    $xoops->tpl()->assign('error_message', PageLocale::E_NO_CONTENT);
}
// Metas
//description
$xoTheme->addMeta('meta', 'description', strip_tags($helper->getModule()->name()) . ', ' . implode(',', $keywords));
开发者ID:RanLee,项目名称:XoopsCore,代码行数:31,代码来源:index.php


示例18: datesub

 /**
  * @param string $dateFormat
  * @param string $format
  *
  * @return string
  */
 public function datesub($dateFormat = 's', $format = "S")
 {
     return XoopsLocale::formatTimestamp($this->getVar('datesub', $format), $dateFormat);
 }
开发者ID:ming-hai,项目名称:XoopsCore,代码行数:10,代码来源:file.php


示例19: htmlspecialchars

    $tpl->assign('channel_lastbuild', XoopsLocale::formatTimestamp(time(), 'rss'));
    $tpl->assign('channel_webmaster', $xoops->getConfig('adminmail'));
    $tpl->assign('channel_editor', $xoops->getConfig('adminmail'));
    if ($categoryid != -1) {
        $channel_category .= " > " . $categoryObj->getVar('name');
    }
    $tpl->assign('channel_category', htmlspecialchars($channel_category));
    $tpl->assign('channel_generator', $publisher->getModule()->getVar('name'));
    $tpl->assign('channel_language', XoopsLocale::getLangCode());
    $tpl->assign('image_url', \XoopsBaseConfig::get('url') . '/images/logo.gif');
    $dimention = getimagesize(\XoopsBaseConfig::get('root-path') . '/images/logo.gif');
    if (empty($dimention[0])) {
        $width = 140;
        $height = 140;
    } else {
        $width = $dimention[0] > 140 ? 140 : $dimention[0];
        $dimention[1] = $dimention[1] * $width / $dimention[0];
        $height = $dimention[1] > 140 ? $dimention[1] * $dimention[0] / 140 : $dimention[1];
    }
    $tpl->assign('image_width', $width);
    $tpl->assign('image_height', $height);
    $sarray = $publisher->getItemHandler()->getAllPublished(10, 0, $categoryid);
    if (is_array($sarray)) {
        $count = $sarray;
        /* @var $item PublisherItem */
        foreach ($sarray as $item) {
            $tpl->append('items', array('title' => htmlspecialchars($item->title(), ENT_QUOTES), 'link' => $item->getItemUrl(), 'guid' => $item->getItemUrl(), 'pubdate' => XoopsLocale::formatTimestamp($item->getVar('datesub'), 'rss'), 'description' => htmlspecialchars($item->getBlockSummary(300, true), ENT_QUOTES)));
        }
    }
}
$tpl->display('module:publisher/publisher_rss.tpl');
开发者ID:mambax7,项目名称:publisher-26,代码行数:31,代码来源:backend.php


示例20: Criteria

$criteria->add(new Criteria('status', 2), 'AND');
$criteria->add(new Criteria('datesub', time(), '<='), 'AND');
$criteria->setSort('datesub');
$criteria->setOrder('DESC');
//Get all articles dates as an array to save memory
$items = $publisher->getItemHandler()->getAll($criteria, array('datesub'), false);
$itemsCount = count($items);
if (!($itemsCount > 0)) {
    $xoops->redirect(\XoopsBaseConfig::get('url'), 2, _MD_PUBLISHER_NO_TOP_PERMISSIONS);
} else {
    $this_year = 0;
    $years = array();
    $months = array();
    $i = 0;
    foreach ($items as $item) {
        $time = XoopsLocale::formatTimestamp($item['datesub'], 'mysql', $useroffset);
        if (preg_match("/([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})/", $time, $datetime)) {
            $this_year = (int) $datetime[1];
            $this_month = (int) $datetime[2];
            if (empty($lastyear)) {
                $lastyear = $this_year;
            }
            if ($lastmonth == 0) {
                $lastmonth = $this_month;
                $months[$lastmonth]['string'] = $months_arr[$lastmonth];
                $months[$lastmonth]['number'] = $lastmonth;
            }
            if ($lastyear != $this_year) {
                $years[$i]['number'] = $lastyear;
                $years[$i]['months'] = $months;
                $months = array();
开发者ID:redmexico,项目名称:XoopsCore,代码行数:31,代码来源:archive.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP XoopsLogger类代码示例发布时间:2022-05-23
下一篇:
PHP XoopsLoad类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap