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

PHP JFBCFactory类代码示例

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

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



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

示例1: display

 function display($tpl = null)
 {
     $user = JFactory::getUser();
     $providers = JFBCFactory::getAllProviders();
     $providerData = array();
     foreach ($providers as $provider) {
         if ($provider->appId && $provider->secretKey) {
             $userModel = JFBConnectModelUserMap::getUser($user->get('id'), $provider->systemName);
             $userData = $userModel->getData();
             $providerInfo = new stdClass();
             $providerInfo->profileUrl = $userData->params->get('data.profile_url');
             if (empty($providerInfo->profileUrl)) {
                 //JOOMLA 2.5
                 $providerInfo->profileUrl = $userData->params->get('profile_url');
             }
             $providerInfo->isMapped = $userData->provider != null;
             $providerInfo->name = $provider->name;
             $providerInfo->provider = $provider;
             $providerInfo->systemName = $provider->systemName;
             $providerData[$provider->name] = $providerInfo;
         }
     }
     $this->providerData = $providerData;
     JFBCFactory::addStylesheet('jfbconnect.css');
     parent::display($tpl);
 }
开发者ID:q0821,项目名称:esportshop,代码行数:26,代码来源:view.html.php


示例2: setupAuthentication

 function setupAuthentication()
 {
     $options = new JRegistry();
     $options->set('authurl', 'https://api.instagram.com/oauth/authorize');
     $options->set('tokenurl', 'https://api.instagram.com/oauth/access_token');
     $options->set('authmethod', 'get');
     $headers = array();
     $headers['Content-Type'] = 'application/json';
     $options->set('headers', $headers);
     $options->set('scope', '');
     $this->client = new JFBConnectAuthenticationOauth2($options);
     $token = JFactory::getApplication()->getUserState('com_jfbconnect.' . strtolower($this->name) . '.token', null);
     if ($token) {
         $token = (array) json_decode($token);
         $this->client->setToken($token);
     }
     $this->client->initialize($this);
     // Need to override the callback URL to force http or https
     $origRedirect = $this->client->getOption('redirecturi');
     if (JFBCFactory::config()->get('instagram_callback_ssl')) {
         $redirect = str_replace('http://', 'https://', $origRedirect);
     } else {
         $redirect = str_replace('https://', 'http://', $origRedirect);
     }
     $this->client->setOption('redirecturi', $redirect);
 }
开发者ID:q0821,项目名称:esportshop,代码行数:26,代码来源:instagram.php


示例3: getFeed

 function getFeed()
 {
     $feedHtml = JFBCFactory::cache()->get('sourcecoast.rss');
     if ($feedHtml === false) {
         $curl = curl_init();
         curl_setopt_array($curl, array(CURLOPT_URL => 'http://feeds.sourcecoast.com/sourcecoast-blog', CURLOPT_USERAGENT => 'spider', CURLOPT_TIMEOUT => 120, CURLOPT_CONNECTTIMEOUT => 30, CURLOPT_RETURNTRANSFER => TRUE, CURLOPT_ENCODING => 'UTF-8'));
         $data = curl_exec($curl);
         $errorCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
         curl_close($curl);
         if ($data && !empty($data) && $errorCode == 200) {
             $xml = simplexml_load_string($data, 'SimpleXMLElement', LIBXML_NOCDATA);
             if ($xml) {
                 $feedHtml = '<h4>Recent News from SourceCoast</h4>';
                 for ($i = 0; $i < 4; $i++) {
                     if (isset($xml->channel->item[$i])) {
                         $item = $xml->channel->item[$i];
                         $date = JFactory::getDate($item->pubDate);
                         $dateStr = $date->format(JText::_('DATE_FORMAT_LC4'));
                         $feedHtml .= '<p><a href="' . $item->link . '">' . $item->title . '</a> <span><em>' . $dateStr . '</em></span></p>';
                     }
                 }
             }
         }
         JFBCFactory::cache()->store($feedHtml, 'sourcecoast.rss');
     }
     return $feedHtml;
 }
开发者ID:q0821,项目名称:esportshop,代码行数:27,代码来源:view.html.php


示例4: save

 function save($data)
 {
     $oldData = array();
     if ($data['id'] > 0) {
         $table = $this->getTable();
         $table->load($data['id']);
         $oldData['id'] = $table->id;
         $oldData['provider'] = $table->provider;
         $oldData['type'] = $table->type;
         $oldData['attribs'] = (array) $table->attribs;
     }
     // Set the dates
     $date = JFactory::getDate();
     if ($data['id'] == 0) {
         $data['created'] = $date->toSql();
     }
     $data['modified'] = $date->toSql();
     if ($data['provider'] != '--' && $data['type'] != '--') {
         $channel = JFBCFactory::provider($data['provider'])->channel($data['type']);
         $data = $channel->onBeforeSave($data);
         // Manipulate the data however may be necessary
     }
     $return = parent::save($data);
     // Used to removed permissions from users that aren't associated with this channel (or anything else needed for cleanup)
     if ($return && $data['provider'] != '--' && $data['type'] != '--') {
         $data['id'] = $this->getState('channel.id');
         $channel->onAfterSave($data, $oldData);
     }
     return $return;
 }
开发者ID:q0821,项目名称:esportshop,代码行数:30,代码来源:channel.php


示例5: onAfterDispatch

 public function onAfterDispatch()
 {
     if ($this->enabled) {
         $path = JPATH_SITE . '/components/com_jfbconnect/libraries/toolbar/button/';
         $files = JFolder::files($path, '\\.php$');
         // Probably need to add some way to order these things..
         foreach ($files as $f) {
             $class = 'JFBConnectToolbarButton' . ucfirst(str_replace('.php', '', $f));
             if (class_exists($class)) {
                 $obj = new $class();
                 $this->buttons[$obj->order] = $obj;
             }
         }
         ksort($this->buttons);
         $doc = JFactory::getDocument();
         JFBCFactory::addStylesheet('jfbconnect.css');
         if (JFBCFactory::config()->get('facebook_display_errors')) {
             //                $doc->addScript('media/sourcecoast/js/jquery-ui.js');
             $doc->addStyleSheet('media/sourcecoast/css/jquery-ui/jquery-ui.css');
         } else {
             //                $doc->addScript('media/sourcecoast/js/jquery-ui.min.js');
             $doc->addStyleSheet('media/sourcecoast/css/jquery-ui/jquery-ui.min.css');
         }
     }
 }
开发者ID:q0821,项目名称:esportshop,代码行数:25,代码来源:toolbar.php


示例6: apply

 function apply()
 {
     $app = JFactory::getApplication();
     $configs = JRequest::get('POST');
     $model = JFBCFactory::config();
     JPluginHelper::importPlugin('socialprofiles');
     $profilePlugins = $app->triggerEvent('socialProfilesGetPlugins');
     foreach ($profilePlugins as $plugin) {
         $pluginName = $plugin->getName();
         $settings = new JRegistry();
         $search = "profiles_" . $pluginName . "_";
         $stdFields = JRequest::getVar('profiles_' . $pluginName);
         $settings->loadArray($stdFields);
         foreach ($configs as $key => $value) {
             $pos = strpos($key, $search);
             if ($pos === 0) {
                 $key = str_replace($search, "", $key);
                 if (strpos($key, "field_map") != false) {
                     $key = str_replace("_field_map", ".", $key);
                     $settings->set('field_map.' . $key, $value);
                 }
             }
         }
         $model->update("profile_" . $pluginName, $settings->toString());
     }
     JFBCFactory::log(JText::_('COM_JFBCONNECT_MSG_SETTINGS_UPDATED'));
     $this->display();
 }
开发者ID:q0821,项目名称:esportshop,代码行数:28,代码来源:profiles.php


示例7: display

 function display($tpl = null)
 {
     $configModel = JFBCFactory::config();
     if ($this->getLayout() == 'fbapp') {
         $appConfig = $this->get('mergedRecommendations');
         $this->assignRef('appConfig', $appConfig);
         $appConfigUpdated = $configModel->getUpdatedDate('autotune_app_config');
         $fieldsUpdated = $configModel->getUpdatedDate('autotune_field_descriptors');
         $this->assignRef('appConfigUpdated', $appConfigUpdated);
         $this->assignRef('fieldsUpdated', $fieldsUpdated);
         $subscriberId = $configModel->getSetting('sc_download_id', 'No ID Set!');
         $this->assignRef('subscriberId', $subscriberId);
     }
     $this->assignRef('config', $configModel);
     $this->addToolbar();
     parent::display($tpl);
     $atModel = $this->getModel('autotune');
     $subStatus = $atModel->getSubscriptionStatus();
     if ($subStatus) {
         $subStatus = $subStatus->messages;
         $this->assignRef('subStatus', $subStatus);
         $subStatusUpdated = $configModel->getUpdatedDate('autotune_authorization');
         $subStatusUpdated = strftime("%Y/%m/%d", strtotime($subStatusUpdated));
         $this->assignRef('subStatusUpdated', $subStatusUpdated);
         include 'tmpl/subscription_status.php';
     }
 }
开发者ID:q0821,项目名称:esportshop,代码行数:27,代码来源:view.html.php


示例8: getInput

 protected function getInput()
 {
     $html = array();
     $provider = $this->element['provider'] ? (string) $this->element['provider'] : null;
     $style = $this->element['style'] ? (string) $this->element['style'] . '"' : '';
     // Initialize some field attributes.
     $class = !empty($this->class) ? ' class="radio ' . $this->class . '"' : ' class="radio"';
     $required = $this->required ? ' required aria-required="true"' : '';
     $autofocus = $this->autofocus ? ' autofocus' : '';
     $disabled = $this->disabled ? ' disabled' : '';
     $readonly = $this->readonly;
     $style = 'style="float:left;' . $style . '"';
     $html[] = '<div style="clear: both"> </div>';
     // Start the radio field output.
     $html[] = '<fieldset id="' . $this->id . '"' . $class . $required . $autofocus . $disabled . $style . ' >';
     // Get the field options.
     $options = $this->getOptions();
     $p = JFBCFactory::provider($provider);
     // Build the radio field output.
     $html[] = '<label class="providername">' . $p->name . '</label>';
     foreach ($options as $i => $option) {
         // Initialize some option attributes.
         $checked = (string) $option->value == (string) $this->value ? ' checked="checked"' : '';
         $class = !empty($option->class) ? ' class="' . $option->class . '"' : '';
         $disabled = !empty($option->disable) || $readonly && !$checked;
         $disabled = $disabled ? ' disabled' : '';
         $html[] = '<input type="radio" id="' . $this->id . $i . '" name="' . $this->name . '" value="' . htmlspecialchars($option->value, ENT_COMPAT, 'UTF-8') . '"' . $checked . $class . $required . $disabled . ' />';
         $html[] = '<label for="' . $this->id . $i . '"' . $class . ' >' . '<img src="' . JUri::root() . 'media/sourcecoast/images/provider/' . $provider . '/' . $option->value . '" />' . '</label>' . ($required = '');
     }
     // End the radio field output.
     $html[] = '</fieldset>';
     $html[] = '<div style="clear: both"> </div>';
     return implode($html);
 }
开发者ID:q0821,项目名称:esportshop,代码行数:34,代码来源:providerloginbutton.php


示例9: requestSent

 function requestSent()
 {
     $jfbcRequestId = JRequest::getInt('jfbcId');
     $fbRequestId = JRequest::getString('requestId');
     $inToList = JRequest::getVar('to');
     // Get the from user id from the request
     $to = $inToList[0];
     $requestInfo = JFBCFactory::provider('facebook')->api('/' . $fbRequestId . "_" . $to);
     $fbFrom = $requestInfo['from']['id'];
     // Not using the model, as we're doing a simple store.
     JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_jfbconnect/tables');
     $data = array();
     $data['fb_request_id'] = $fbRequestId;
     $data['fb_user_from'] = $fbFrom;
     $data['jfbc_request_id'] = $jfbcRequestId;
     $data['created'] = JFactory::getDate()->toSql();
     $data['modified'] = null;
     //        $data['destination_url'] = JRequest::getString('destinationUrl');
     foreach ($inToList as $fbTo) {
         $row =& JTable::getInstance('JFBConnectNotification', 'Table');
         $to = JFilterInput::clean($fbTo, 'ALNUM');
         $data['fb_user_to'] = $to;
         $row->save($data);
         $point = new JFBConnectPoint();
         $point->set('name', 'facebook.request.create');
         $point->set('key', $to);
         $point->award();
     }
     $app = JFactory::getApplication();
     $app->close();
 }
开发者ID:q0821,项目名称:esportshop,代码行数:31,代码来源:request.php


示例10: getInput

 function getInput()
 {
     $jid = $this->form->getValue('attribs.user_id');
     if ($jid) {
         $uid = JFBCFactory::usermap()->getProviderUserId($jid, 'linkedin');
         if ($uid) {
             $access_token = JFBCFactory::usermap()->getUserAccessToken($jid, 'linkedin');
             $params['access_token'] = $access_token;
             $liLibrary = JFBCFactory::provider('linkedin');
             $liLibrary->client->setToken((array) $access_token);
             $url = 'https://api.linkedin.com/v1/companies/?is-company-admin=true&start=0&count=20';
             try {
                 $companies = $liLibrary->client->query($url);
                 if ($companies->code == '200') {
                     $this->companies = json_decode($companies->body);
                 }
                 return parent::getInput();
             } catch (Exception $e) {
                 return '<div class="jfbc-error">' . JText::_('COM_JFBCONNECT_CHANNEL_LINKEDIN_PERM_TOKEN_EXPIRED_LABEL') . '</div>';
             }
         } else {
             return '<div class="jfbc-error">' . JText::_('COM_JFBCONNECT_CHANNEL_LINKEDIN_PERM_USER_AUTH_ERROR_LABEL') . '</div>';
         }
     } else {
         return '<div class="jfbc-error">' . JText::_('COM_JFBCONNECT_CHANNEL_SELECT_USER_ERROR_LABEL') . '</div>';
     }
 }
开发者ID:q0821,项目名称:esportshop,代码行数:27,代码来源:linkedincompanylist.php


示例11: register

 public function register($data = null)
 {
     //require_once (JPATH_COMPONENT.'/libraries/profile.php');
     $mainframe = JFactory::getApplication();
     $my = CFactory::getUser();
     $config = CFactory::getConfig();
     /**
      * Opengraph
      */
     CHeadHelper::setType('website', JText::_('COM_COMMUNITY_REGISTER_NEW'));
     // Hide this form for logged in user
     if ($my->id) {
         $mainframe->enqueueMessage(JText::_('COM_COMMUNITY_REGISTER_ALREADY_USER'), 'warning');
         return;
     }
     // If user registration is not allowed, show 403 not authorized.
     $usersConfig = JComponentHelper::getParams('com_users');
     if ($usersConfig->get('allowUserRegistration') == '0') {
         //show warning message
         $this->addWarning(JText::_('COM_COMMUNITY_REGISTRATION_DISABLED'));
         return;
     }
     $fields = array();
     $post = JRequest::get('post');
     $isUseFirstLastName = CUserHelper::isUseFirstLastName();
     $data = array();
     $data['fields'] = $fields;
     $data['html_field']['jsname'] = empty($post['jsname']) ? '' : $post['jsname'];
     $data['html_field']['jsusername'] = empty($post['jsusername']) ? '' : $post['jsusername'];
     $data['html_field']['jsemail'] = empty($post['jsemail']) ? '' : $post['jsemail'];
     $data['html_field']['jsfirstname'] = empty($post['jsfirstname']) ? '' : $post['jsfirstname'];
     $data['html_field']['jslastname'] = empty($post['jslastname']) ? '' : $post['jslastname'];
     // $js = 'assets/validate-1.5.min.js';
     // CFactory::attach($js, 'js');
     $recaptcha = new CRecaptchaHelper();
     $recaptchaHTML = $recaptcha->html();
     $fbHtml = '';
     if ($config->get('fbconnectkey') && $config->get('fbconnectsecret') && !$config->get('usejfbc')) {
         //CFactory::load( 'libraries' , 'facebook' );
         $facebook = new CFacebook();
         $fbHtml = $facebook->getLoginHTML();
     }
     if ($config->get('usejfbc')) {
         if (class_exists('JFBCFactory')) {
             $providers = JFBCFactory::getAllProviders();
             foreach ($providers as $p) {
                 $fbHtml .= $p->loginButton();
             }
         }
     }
     $tmpl = new CTemplate();
     $content = $tmpl->set('data', $data)->set('recaptchaHTML', $recaptchaHTML)->set('config', $config)->set('isUseFirstLastName', $isUseFirstLastName)->set('fbHtml', $fbHtml)->fetch('register/base');
     $appsLib = CAppPlugins::getInstance();
     $appsLib->loadApplications();
     $args = array(&$content);
     $appsLib->triggerEvent('onUserRegisterFormDisplay', $args);
     echo $this->_getProgressBar(1);
     echo $content;
 }
开发者ID:joshjim27,项目名称:jobsglobal,代码行数:59,代码来源:view.html.php


示例12: __construct

 public function __construct($options = array())
 {
     $this->debug = intval(JFBCFactory::config()->get('facebook_display_errors'));
     $this->text_file = isset($options['text_file']) ? $options['text_file'] : $this->text_file;
     if ($this->debug) {
         JLog::addLogger(array('text_file' => $this->text_file), JLog::ALL, 'jfbconnect');
     }
 }
开发者ID:q0821,项目名称:esportshop,代码行数:8,代码来源:debug.php


示例13: apply

 function apply()
 {
     $configs = JRequest::get('POST', 4);
     $model = $this->getModel('config');
     $model->saveSettings($configs);
     JFBCFactory::log(JText::_('COM_JFBCONNECT_MSG_SETTINGS_UPDATED'));
     $this->setRedirect('index.php?option=com_jfbconnect&view=social');
 }
开发者ID:q0821,项目名称:esportshop,代码行数:8,代码来源:social.php


示例14: __construct

 public function __construct()
 {
     $this->cache = JFactory::getCache('com_jfbconnect', '');
     // Only enable caching if Debug Mode is off
     $debug = JFBCFactory::config()->get('facebook_display_errors');
     $cacheTimeout = JFBCFactory::config()->get('cache_duration');
     $this->cache->setCaching(!$debug && $cacheTimeout != 0);
     $this->cache->setLifeTime($cacheTimeout);
 }
开发者ID:q0821,项目名称:esportshop,代码行数:9,代码来源:cache.php


示例15: importConnections

 function importConnections()
 {
     $app = JFactory::getApplication();
     JPluginHelper::importPlugin('socialprofiles');
     $profilePlugins = $app->triggerEvent('jfbcImportConnections');
     $msg = JText::_('COM_JFBCONNECT_MSG_IMPORT_SUCCESS');
     JFBCFactory::log($msg);
     $this->display();
 }
开发者ID:q0821,项目名称:esportshop,代码行数:9,代码来源:usermap.php


示例16: formBind

 public function formBind($name, $data = null)
 {
     if (!isset($this->forms[$name])) {
         return false;
     }
     if (!$data) {
         $data = JFBCFactory::config()->getSettings();
     }
     $this->forms[$name]->bind($data);
 }
开发者ID:q0821,项目名称:esportshop,代码行数:10,代码来源:views.php


示例17: getAvatarUrl

 function getAvatarUrl($providerId, $nullForDefault = true, $params = null)
 {
     $nullString = $nullForDefault ? 'null' : 'notnull';
     $avatarUrl = JFBCFactory::cache()->get('windowslive.avatar.' . $nullString . '.' . $providerId);
     if ($avatarUrl === false) {
         $avatarUrl = "https://apis.live.net/v5.0/{$providerId}/picture";
         JFBCFactory::cache()->store($avatarUrl, 'windowslive.avatar.' . $nullString . '.' . $providerId);
     }
     return $avatarUrl;
 }
开发者ID:q0821,项目名称:esportshop,代码行数:10,代码来源:windowslive.php


示例18: getProvider

 private function getProvider()
 {
     $input = JFactory::getApplication()->input;
     $provider = $input->getCmd('provider', null);
     if ($provider) {
         return JFBCFactory::provider($provider);
     }
     // No provider given, not a real call. Redirect to home
     $this->setRedirect('index.php');
 }
开发者ID:q0821,项目名称:esportshop,代码行数:10,代码来源:authenticate.php


示例19: getKeys

 public function getKeys()
 {
     $app = JFactory::getApplication();
     $jfb_params = JFBCFactory::config()->getSettings();
     $result = array();
     $result['fb_app_id'] = $jfb_params->get('facebook_app_id');
     $result['fb_app_key'] = $jfb_params->get('facebook_secret_key');
     $result['g_app_id'] = $jfb_params->get('google_app_id');
     $result['g_app_key'] = $jfb_params->get('google_secret_key');
     return $result;
 }
开发者ID:yalive,项目名称:com_api-plugins,代码行数:11,代码来源:sociallogin.php


示例20: unlink

 public function unlink()
 {
     JSession::checkToken('get') or die('Invalid Token');
     $provider = JRequest::getString('provider', '');
     $user = JFactory::getUser();
     $userModel = JFBConnectModelUserMap::getUser($user->get('id'), $provider);
     $provider_user_id = $userModel->getProviderUserId($user->get('id'), $provider);
     $userModel->deleteMapping($provider_user_id, $provider);
     JFBCFactory::log(JText::sprintf('COM_JFBCONNECT_ACCOUNT_LINKED_ACCOUNTS_UNLINK_MESSAGE', $provider));
     $this->setRedirect(JRoute::_('index.php?option=com_jfbconnect&view=account'));
 }
开发者ID:q0821,项目名称:esportshop,代码行数:11,代码来源:account.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP JFTP类代码示例发布时间:2022-05-23
下一篇:
PHP JEventsHTML类代码示例发布时间: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