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


PHP Sobi::GetUserData方法代码示例

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


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

示例1: __construct

 /**
  * @return SPMessage
  */
 private function __construct()
 {
     $this->messages = Sobi::GetUserData('messages-queue', $this->messages);
     $registry = SPFactory::registry()->loadDBSection('messages')->get('messages.queue.params');
     if ($registry) {
         $this->store = SPConfig::unserialize($registry);
     }
     $reports = SPFactory::registry()->loadDBSection('reports')->get('reports.queue.params');
     if ($reports) {
         $this->reports = SPConfig::unserialize($reports);
     }
 }
开发者ID:kishoreweblabs,项目名称:SobiPro,代码行数:15,代码来源:message.php

示例2: prepareStoredData

 private function prepareStoredData(&$settings)
 {
     $store = Sobi::GetUserData('requirements', array());
     if (Sobi::Lang() != 'en-GB' && file_exists(JPATH_ADMINISTRATOR . self::langFile)) {
         $file = parse_ini_file(JPATH_ADMINISTRATOR . self::langFile);
     }
     if (count($store)) {
         foreach ($store as $key => $data) {
             if (Sobi::Lang() != 'en-GB') {
                 $translate = $file['SP.' . $data['message']['org']['label']];
                 if (count($data['message']['org']['params'])) {
                     foreach ($data['message']['org']['params'] as $param => $value) {
                         $translate = str_replace("var:[{$param}]", $value, $translate);
                     }
                 }
                 $settings[$key] = array('key' => $key, 'response' => array('en-GB' => $translate, Sobi::Lang() => $data['message']['current']), 'status' => $data['value']);
             } else {
                 $settings[$key] = array('key' => $key, 'response' => array('en-GB' => $data['message']['current']), 'status' => $data['value']);
             }
         }
     }
 }
开发者ID:ranrolls,项目名称:ras-full-portal,代码行数:22,代码来源:requirements.php

示例3: entries

 /**
  * @param $params
  * @param bool $count
  * @return array
  */
 protected function entries($params, $count = false)
 {
     if ($params->get('fieldOrder')) {
         $eOrder = $params->get('fieldOrder');
     } else {
         $eOrder = $params->get('spOrder');
     }
     $entriesRecursive = true;
     $conditions = array();
     $db = SPFactory::db();
     $limits = $params->get('spLimit');
     if ($limits) {
         $limits = explode('::', $limits);
         $fid = $limits[0];
         $value = $limits[1] == 'group' ? $limits[2] : $limits[1];
         $condition = array('fid' => $fid, 'optValue' => $value);
         if ($limits[1] == 'group') {
             $condition['optValue'] = $db->select('optValue', 'spdb_field_option', array('optParent' => $value, 'fid' => $fid))->loadResultArray();
         }
         $conditions['spo.id'] = $db->select('sid', 'spdb_field_option_selected', $condition)->loadResultArray();
         if (!count($conditions['spo.id'])) {
             return array();
         }
     }
     $eDir = $params->get('spOrderDir');
     $oPrefix = null;
     /* get the site to display */
     if ($params->get('engine') != 'static') {
         $site = SPRequest::int('site', 1);
     } else {
         $site = 1;
     }
     $eLimit = $params->get('entriesLimit');
     $eLimStart = ($site - 1) * $eLimit;
     /* get the ordering and the direction */
     if (strstr($eOrder, '.')) {
         $eOrder = explode('.', $eOrder);
         $eDir = $eOrder[1];
         $eOrder = $eOrder[0];
     }
     $sid = $params->get('sid');
     $section = $params->get('section');
     $this->setModel($sid == $section ? 'section' : 'category');
     $this->_model->init($sid);
     $catId = SPRequest::int('pid');
     $catId = $catId ? $catId : SPRequest::sid();
     if ($params->get('autoListing', false) && $catId && $catId != Sobi::Section()) {
         $entries = Sobi::GetUserData('currently-displayed-entries', array());
         if (!count($entries) && $catId) {
             $entries = SPFactory::Category($catId)->getChilds('entry', true, 1);
             $entries = array_unique($entries);
         }
         if (count($entries)) {
             $conditions['spo.id'] = $entries;
         }
     } else {
         if ($entriesRecursive) {
             $pids = $this->_model->getChilds('category', true);
             // getChilds doesn't includes the category id itself
             $pids[$this->_model->get('id')] = $this->_model->get('id');
             if (is_array($pids)) {
                 $pids = array_keys($pids);
             }
             $conditions['sprl.pid'] = $pids;
         } else {
             $conditions['sprl.pid'] = $sid;
         }
         if ($sid == -1) {
             unset($conditions['sprl.pid']);
         }
     }
     if (count($conditions)) {
         /* sort by field */
         if (is_numeric($eOrder)) {
             static $fields = array();
             $specificMethod = false;
             $field = isset($fields[$sid]) ? $fields[$sid] : null;
             if (!$field) {
                 try {
                     $fType = $db->select('fieldType', 'spdb_field', array('fid' => $eOrder))->loadResult();
                 } catch (SPException $x) {
                     Sobi::Error($this->name(), SPLang::e('CANNOT_DETERMINE_FIELD_TYPE', $x->getMessage()), SPC::WARNING, 0, __LINE__, __FILE__);
                 }
                 if ($fType) {
                     $field = SPLoader::loadClass('opt.fields.' . $fType);
                 }
                 $fields[$sid] = $field;
             }
             if ($field && method_exists($field, 'sortBy')) {
                 $table = null;
                 $oPrefix = null;
                 $specificMethod = call_user_func_array(array($field, 'sortBy'), array(&$table, &$conditions, &$oPrefix, &$eOrder, &$eDir));
             }
             if (!$specificMethod) {
                 $table = $db->join(array(array('table' => 'spdb_field', 'as' => 'fdef', 'key' => 'fid'), array('table' => 'spdb_field_data', 'as' => 'fdata', 'key' => 'fid'), array('table' => 'spdb_object', 'as' => 'spo', 'key' => array('fdata.sid', 'spo.id')), array('table' => 'spdb_relations', 'as' => 'sprl', 'key' => array('fdata.sid', 'sprl.id'))));
//.........这里部分代码省略.........
开发者ID:kidaa30,项目名称:lojinha,代码行数:101,代码来源:emod.php


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