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


PHP Sobi::Initialise方法代码示例

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


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

示例1: initialise

 private function initialise()
 {
     static $loaded = false;
     if (!$loaded || true) {
         defined('DS') || define('DS', DIRECTORY_SEPARATOR);
         require_once JPATH_SITE . '/components/com_sobipro/lib/sobi.php';
         Sobi::Initialise();
         if (SOBI_CMS == 'joomla3') {
             SPFactory::header()->initBase(true)->addJsFile(array('sobipro', 'jqnc', 'adm.sobipro', 'adm.jnmenu', 'jquery-base64'));
         } else {
             SPFactory::header()->initBase(true)->addJsFile(array('sobipro', 'jquery', 'adm.sobipro', 'adm.jnmenu', 'jquery-migrate', 'jquery-base64'))->addCSSCode('#toolbar-box { display: block }');
         }
         $loaded = true;
         SPLoader::loadClass('mlo.input');
         SPLoader::loadClass('models.datamodel');
         SPLoader::loadClass('models.dbobject');
         SPLoader::loadModel('section');
         $model = JModelLegacy::getInstance('MenusModelItem')->getItem();
         self::$mid = $model->id;
         if (isset($model->params['SobiProSettings']) && strlen($model->params['SobiProSettings'])) {
             $this->params = json_decode(base64_decode($model->params['SobiProSettings']));
         }
         $jsString = json_encode(array('component' => Sobi::Txt('SOBI_NATIVE_TASKS'), 'buttonLabel' => Sobi::Txt('SOBI_SELECT_FUNCTIONALITY')));
         SPFactory::header()->addJsCode("SpStrings = {$jsString}; ");
     }
 }
开发者ID:kishoreweblabs,项目名称:SobiPro,代码行数:26,代码来源:native.php

示例2: execute

 public function execute($argv)
 {
     Sobi::Initialise();
     $continue = $this->parseParameters($argv);
     if ($continue) {
         if (!$this->section) {
             $this->sections = SPFactory::db()->select('id', 'spdb_object', array('oType' => 'section', 'state' => '1', '@VALID' => SPFactory::db()->valid('validUntil', 'validSince')))->loadResultArray();
         } else {
             $this->sections = SPFactory::db()->select('id', 'spdb_object', array('id' => $this->section, 'oType' => 'section', 'state' => '1', '@VALID' => SPFactory::db()->valid('validUntil', 'validSince')))->loadResultArray();
         }
         if (!$this->liveURL || !preg_match('/http[s]?:\\/\\/.*/i', $this->liveURL)) {
             $this->out('[ERROR] A valid live URL address is required');
         }
         if (count($this->sections)) {
             $this->start = time();
             foreach ($this->sections as $sid) {
                 $this->crawlSobiSection($sid);
             }
         } else {
             $this->out('[ERROR] No valid sections found');
         }
     }
 }
开发者ID:ranrolls,项目名称:ras-full-portal,代码行数:23,代码来源:cron.php

示例3: onAKUserRefresh

 /**
  * Called whenever the administrator asks to refresh integration status.
  *
  * @param $user_id int The Joomla! user ID to refresh information for.
  */
 public function onAKUserRefresh($user_id)
 {
     static $hasZoo = null;
     static $hasK2 = null;
     static $hasSobipro = null;
     if (is_null($hasZoo) || is_null($hasK2) || is_null($hasSobipro)) {
         JLoader::import('joomla.filesystem.folder');
         $hasZoo = JFolder::exists(JPATH_ADMINISTRATOR . '/components/com_zoo');
         $hasK2 = JFolder::exists(JPATH_ADMINISTRATOR . '/components/com_k2');
         $hasSobipro = JFolder::exists(JPATH_ADMINISTRATOR . '/components/com_sobipro');
         if (@(include_once JPATH_ROOT . '/components/com_sobipro/lib/sobi.php')) {
             if (!method_exists('Sobi', 'Initialise')) {
                 // We require SOBIPro 1.1 or later
                 $hasSobipro = false;
             }
         } else {
             $hasSobipro = false;
         }
     }
     // Get all of the user's subscriptions
     $subscriptions = F0FModel::getTmpInstance('Subscriptions', 'AkeebasubsModel')->user_id($user_id)->getList();
     // Make sure there are subscriptions set for the user
     if (!count($subscriptions)) {
         return;
     }
     // Get active/inactive subscription level IDs
     $active = array();
     foreach ($subscriptions as $subscription) {
         if (!$subscription->enabled) {
             continue;
         }
         if (!in_array($subscription->akeebasubs_level_id, $active)) {
             $active[] = $subscription->akeebasubs_level_id;
         }
     }
     $inactive = array();
     foreach ($subscriptions as $subscription) {
         if ($subscription->enabled) {
             continue;
         }
         if (!in_array($subscription->akeebasubs_level_id, $active)) {
             $inactive[] = $subscription->akeebasubs_level_id;
         }
     }
     $db = JFactory::getDbo();
     // Unpublish articles for inactive subscriptions
     if (!empty($inactive)) {
         foreach ($inactive as $level_id) {
             if (array_key_exists($level_id, $this->unpublishCore)) {
                 if ($this->unpublishCore[$level_id]) {
                     // Unpublish core articles
                     $query = $db->getQuery(true)->update($db->qn('#__content'))->set($db->qn('state') . ' = ' . $db->q('0'))->where($db->qn('created_by') . ' = ' . $db->q($user_id))->where($db->qn('state') . ' <= ' . $db->q('1'));
                     $db->setQuery($query);
                     $db->execute();
                 }
             }
             if (array_key_exists($level_id, $this->unpublishK2) && $hasK2) {
                 if ($this->unpublishK2[$level_id]) {
                     // Unpublish K2 items
                     $query = $db->getQuery(true)->update($db->qn('#__k2_items'))->set($db->qn('published') . ' = ' . $db->q('0'))->where($db->qn('created_by') . ' = ' . $db->q($user_id));
                     $db->setQuery($query);
                     $db->execute();
                 }
             }
             if (array_key_exists($level_id, $this->unpublishSobipro) && $hasSobipro) {
                 if ($this->unpublishSobipro[$level_id]) {
                     if (!class_exists('Sobi')) {
                         @(include_once JPATH_ROOT . '/components/com_sobipro/lib/sobi.php');
                     }
                     if (class_exists('Sobi')) {
                         Sobi::Initialise();
                         // Unpublish SOBI Pro items
                         $query = $db->getQuery(true)->select($db->qn('id'))->from($db->qn('#__sobipro_object'))->where($db->qn('oType') . ' = ' . $db->q('entry'))->where($db->qn('owner') . ' = ' . $db->q($user_id))->where($db->qn('state') . ' = ' . $db->q(1));
                         $db->setQuery($query);
                         $ids = $db->loadColumn();
                         if (count($ids)) {
                             foreach ($ids as $id) {
                                 SPFactory::Entry($id)->unpublish();
                             }
                         }
                     }
                 }
             }
             if (array_key_exists($level_id, $this->unpublishZOO) && array_key_exists($level_id, $this->removeGroups) && $hasZoo) {
                 if ($this->unpublishZOO[$level_id]) {
                     $apps = $this->removeGroups[$level_id];
                     if (!empty($apps)) {
                         $temp = array();
                         foreach ($apps as $app) {
                             $temp[] = $db->q($app);
                         }
                         // Unpublish ZOO items
                         $query = $db->getQuery(true)->update($db->qn('#__zoo_item'))->set($db->qn('state') . ' = ' . $db->q('0'))->where($db->qn('created_by') . ' = ' . $db->q($user_id))->where($db->qn('state') . ' <= ' . $db->q('1'))->where($db->qn('application_id') . ' IN (' . implode(',', $temp) . ')');
                         $db->setQuery($query);
                         $db->execute();
//.........这里部分代码省略.........
开发者ID:ZoiaoDePeixe,项目名称:akeebasubs,代码行数:101,代码来源:contentpublish.php

示例4: onAlbumPrepare

 /**
  * Plugin that returns the object list for DJ-Mediatools album
  * 
  * Each object must contain following properties (mandatory): title, description, image
  * Optional properties: link, target (_blank or _self), alt (alt attribute for image)
  * 
  * @param	object	The album params
  */
 public function onAlbumPrepare(&$source, &$params)
 {
     // Lets check the requirements
     $check = $this->onCheckRequirements($source);
     if (is_null($check) || is_string($check)) {
         return null;
     }
     $app = JFactory::getApplication();
     require_once JPATH_ROOT . '/components/com_sobipro/lib/sobi.php';
     Sobi::Initialise($params->get('section'));
     require_once dirname(__FILE__) . '/lib/emod.php';
     $emod = new SPEntriesDJMTCtrl();
     $default_image = $params->get('plg_sobipro_image');
     // create parameters for K2 content module helper
     $mparams = new JRegistry();
     $mparams->def('entriesLimit', $params->get('max_images'));
     $mparams->def('section', $params->get('section'));
     $mparams->def('cid', $params->get('cid'));
     $mparams->def('sid', $params->get('sid'));
     $mparams->def('autoListing', $params->get('plg_sobipro_autoListing'));
     $mparams->def('spOrder', $params->get('spOrder'));
     $mparams->def('spOrderDir', $params->get('spOrderDir'));
     $mparams->def('spLimit', $params->get('spLimit'));
     $mparams->def('engine', 'static');
     $items = $emod->getSourceEntries($mparams);
     $slides = array();
     //$this->debug($items);
     foreach ($items as $item) {
         $slide = (object) array();
         $slide->title = $item['name']['_data'];
         $slide->description = $item['fields']['field_short_description']['_data']['data']['_data'];
         $slide->image = $item['fields']['field_company_logo']['_data']['data']['_attributes']['image'];
         if (!$slide->image) {
             $slide->image = DJMediatoolsLayoutHelper::getImageFromText($slide->description);
         }
         if (!$slide->image) {
             $slide->image = $default_image;
         }
         // if no default image set then don't display this entry
         if (!$slide->image) {
             continue;
         }
         $slide->id = $item->id;
         $slide->canonical = $slide->link = $item['url'];
         if ($comments = $params->get('commnets', 0)) {
             $host = str_replace(JURI::root(true), '', JURI::root());
             $host = preg_replace('/\\/$/', '', $host);
             switch ($comments) {
                 case 1:
                     // jcomments
                     $slide->comments = array('id' => $item->id, 'group' => 'com_sobipro');
                     break;
                 case 2:
                     // disqus
                     $disqus_shortname = $params->get('disqus_shortname', '');
                     if (!empty($disqus_shortname)) {
                         $slide->comments = array();
                         $slide->comments['url'] = $host . $slide->link;
                         $slide->comments['identifier'] = substr(md5($disqus_shortname), 0, 10) . "_id" . $item->id;
                     }
                     break;
                 case 3:
                     // facebook
                     $slide->comments = $host . $slide->link;
                     break;
                 case 4:
                     //komento
                     // not implemented
                     break;
             }
         }
         $slides[] = $slide;
     }
     return $slides;
 }
开发者ID:chaudhary4k4,项目名称:modernstore,代码行数:83,代码来源:sobipro.php


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