Exemple #1
0
 function getParams($refresh = false)
 {
     //for testing purpose clean cache
     $refresh = XiptLibJomsocial::cleanStaticCache();
     if (isset($this->_params) && $refresh === false) {
         return $this->_params;
     }
     return $this->_params = $this->loadParams('settings', 'params');
 }
Exemple #2
0
 function getFieldId($fieldcode)
 {
     static $results = array();
     $reset = XiptLibJomsocial::cleanStaticCache();
     if (isset($results[$fieldcode]) && $reset == false) {
         return $results[$fieldcode]['id'];
     }
     $query = new XiptQuery();
     $results = $query->select('*')->from('#__community_fields')->dbLoadQuery()->loadAssocList('fieldcode');
     if (array_key_exists($fieldcode, $results)) {
         return $results[$fieldcode]['id'];
     }
 }
Exemple #3
0
 function loadParams($id, $what = 'params')
 {
     $reset = XiptLibJomsocial::cleanStaticCache();
     if ($what != 'params') {
         return parent::loadParams($id, $what);
     }
     if (isset($this->_params[$id]) && $reset == false) {
         return $this->_params[$id];
     }
     $record = $this->loadRecords(0);
     // if config not found from tabale then load default config of jom social
     if (!isset($record[$id]->params) || empty($record[$id]->params)) {
         $this->_params[$id] = CFactory::getConfig();
     } else {
         $this->_params[$id] = new XiptParameter($record[$id]->params);
     }
     return $this->_params[$id];
 }
Exemple #4
0
 function getPluginId($element, $folder = 'community')
 {
     $reset = XiptLibJomsocial::cleanStaticCache();
     static $plugin = null;
     if ($plugin == null || !isset($plugin[$folder]) || $reset) {
         $query = new XiptQuery();
         if (XIPT_JOOMLA_15) {
             $plugin[$folder] = $query->select('*')->from('#__plugins')->where(" `folder` = '{$folder}' ")->dbLoadQuery("", "")->loadObjectList('element');
         } else {
             $plugin[$folder] = $query->select('*')->from('#__extensions')->where(" `folder` = '{$folder}' ")->dbLoadQuery("", "")->loadObjectList('element');
         }
     }
     if (isset($plugin[$folder][$element])) {
         if (XIPT_JOOMLA_15) {
             return $plugin[$folder][$element]->id;
         } else {
             return $plugin[$folder][$element]->extension_id;
         }
     } else {
         return false;
     }
 }
Exemple #5
0
 public function loadRecords($limit = null, $limitstart = null)
 {
     if ($limit === null) {
         $limit = $this->getState('limit', null);
     }
     if ($limitstart === null) {
         $limitstart = $this->getState('limitstart', 0);
     }
     $query = $this->getQuery();
     //there might be no table and no query at all
     if ($query === null) {
         return null;
     }
     //we want returned record indexed by columns
     $pKey = $this->getTable()->getKeyName();
     $query->limit($limit, $limitstart);
     //for unique indexing using md5
     $index = md5($query->__toString());
     $reset = XiptLibJomsocial::cleanStaticCache();
     if (isset($this->_recordlist[$index]) && $reset == false) {
         return $this->_recordlist[$index];
     }
     $this->_recordlist[$index] = $query->dbLoadQuery("", "")->loadObjectList($pKey);
     return $this->_recordlist[$index];
 }
Exemple #6
0
 function getDefaultProfiletype()
 {
     $refresh = XiptLibJomsocial::cleanStaticCache();
     static $defaultProfiletypeID = null;
     if ($defaultProfiletypeID && $refresh === false) {
         return $defaultProfiletypeID;
     }
     $defaultProfiletypeID = XiptFactory::getSettings('defaultProfiletypeID');
     if ($defaultProfiletypeID) {
         return $defaultProfiletypeID;
     }
     echo XiptFactory::getSettings()->render();
     XiptError::raiseWarning('DEF_PTYPE_REQ', 'DEFAULT PROFILE TYPE REQUIRED');
 }