/** * GetInstance method used to access the object * @access public * @return */ public static function GetInstance() { if (!isset(self::$_instance)) { self::$_instance = new self(); $rootdir = dirname(dirname(dirname(dirname(__FILE__)))); $cmsms_cnf_file = cms_join_path($rootdir, 'config.php'); include $cmsms_cnf_file; $file = cms_join_path(dirname(dirname(__FILE__)), 'includes', 'fb_cnf.inc'); include $file; self::$_data = array_merge($config, $fbcfg); } return self::$_instance; }
function getAvatarFireboard($userID) { $fireConfig = JPATH_SITE . '/administrator/components/com_fireboard/fireboard_config.php'; //Version is 1.0.5 if (!file_exists($fireConfig)) { $fireConfig = JPATH_SITE . '/components/com_fireboard/sources/fb_config.class.php'; if (file_exists($fireConfig)) { require_once $fireConfig; global $fbConfig; $fireConfig = new fb_config(); $fireConfig->load(); } } //check if (!is_object($fireConfig) && !file_exists($fireConfig)) { return false; } //Version < 1.0.5 if (!is_object($fireConfig)) { require $fireConfig; $fireArray = new stdclass(); global $fbConfig; $fireArray->avatar_src = $fbConfig['avatar_src']; $fireArray->version = $fbConfig['version']; $fireConfig = $fireArray; } if ($fireConfig->avatar_src == 'fb') { //get avatar image from database $db = JFactory::getDBO(); $sql = "SELECT `avatar` FROM #__fb_users WHERE `userid`='{$userID}'"; $db->setQuery($sql); $imgPath = $db->loadResult(); if ($imgPath) { $fireboardAvatar = ''; if (@(!is_null($fireConfig->version)) && @isset($fireConfig->version) && @$fireConfig->version == '1.0.1') { $fireboardAvatar = '/components/com_fireboard/avatars/' . $imgPath; } else { $fireboardAvatar = '/images/fbfiles/avatars/' . $imgPath; } //check exist image of user if (file_exists(JPATH_SITE . $fireboardAvatar)) { return JURI::root() . $fireboardAvatar; } else { // Return false if Image file doesn't exist. return false; } } else { // user don't use avatar. return false; } } return false; }
# This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # Or read it online: http://www.gnu.org/licenses/licenses.html#GPL #------------------------------------------------------------------------- if (!is_object(@cmsms())) { exit; } if (!$this->CheckAccess()) { exit; } $fb_config = fb_config::GetInstance(); $this->SetPreference('hide_errors', isset($params['fbrp_hide_errors']) ? $params['fbrp_hide_errors'] : 0); //$this->SetPreference('show_version',isset($params['fbrp_show_version'])?$params['fbrp_show_version']:0); $this->SetPreference('show_version', isset($fb_config['show_version']) ? $fb_config['show_version'] : FALSE); $this->SetPreference('relaxed_email_regex', isset($params['fbrp_relaxed_email_regex']) ? $params['fbrp_relaxed_email_regex'] : 0); $this->SetPreference('require_fieldnames', isset($params['fbrp_require_fieldnames']) ? $params['fbrp_require_fieldnames'] : 0); $this->SetPreference('unique_fieldnames', isset($params['fbrp_unique_fieldnames']) ? $params['fbrp_unique_fieldnames'] : 0); //$this->SetPreference('enable_fastadd',isset($params['fbrp_enable_fastadd'])?$params['fbrp_enable_fastadd']:0); $this->SetPreference('enable_fastadd', isset($fb_config['enable_fastadd']) ? $fb_config['enable_fastadd'] : TRUE); $this->SetPreference('enable_antispam', isset($params['fbrp_enable_antispam']) ? $params['fbrp_enable_antispam'] : 0); //$this->SetPreference('show_fieldids',isset($params['fbrp_show_fieldids'])?$params['fbrp_show_fieldids']:0); $this->SetPreference('show_fieldids', isset($fb_config['show_fieldids']) ? $fb_config['show_fieldids'] : TRUE); //$this->SetPreference('show_fieldaliases',isset($params['fbrp_show_fieldaliases'])?$params['fbrp_show_fieldaliases']:0); $this->SetPreference('show_fieldaliases', isset($fb_config['show_fieldaliases']) ? $fb_config['show_fieldaliases'] : TRUE); $this->SetPreference('blank_invalid', isset($params['fbrp_blank_invalid']) ? $params['fbrp_blank_invalid'] : 0); $params['fbrp_message'] = $this->Lang('configuration_updated');