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

PHP Addons类代码示例

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

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



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

示例1: checkNewTarget

 public function checkNewTarget()
 {
     $url = "https://www.sidatz.com/";
     require 'addons/library/phpQuery/QueryList.class.php';
     $reg = array("content" => array("ul.news:eq(0)", "text"));
     $hj = new QueryList($url, $reg);
     $arr_content = $hj->jsonArr;
     //dump($arr_content);
     if (stripos($arr_content[0]["content"], "暂无新标") > 0) {
         $this->ajaxReturn(null, "无新标", 0);
     }
     $arr['content'] = $arr_content[0]['content'];
     //echo $hj->getJSON();
     //$arr['content']=iconv("gb2312","utf-8",$arr_content[0]['content']);
     //dump($arr_content);
     //exit(urldecode(json_encode(array('status'=>1,'info'=>'教务通知详情','data'=>$arr))));
     $push_user_alias = "*";
     $_POST['n_title'] = "有新标了,来看看吧0.0";
     $_POST['n_content'] = "四达投资有新标了,快去用抢标助手抢标吧!";
     $_POST['n_extras'] = "";
     $_POST['push_user_alias'] = $push_user_alias;
     //推送所有人
     $_POST['getPushResult'] = 0;
     Addons::addonsHook("JPush", "doAddPush", array(), true);
     $this->ajaxReturn($arr, "新标情况", 1);
 }
开发者ID:lyhiving,项目名称:icampus,代码行数:26,代码来源:IndexAction.class.php


示例2: getCallback

 private function getCallback($type = '', $callbackurl = '')
 {
     if (!$callbackurl) {
         $callbackurl = Addons::createAddonShow('Login', 'no_register_display', array('type' => $type));
     }
     return urlencode($callbackurl);
 }
开发者ID:omusico,项目名称:ThinkSNS-4,代码行数:7,代码来源:qzone.class.php


示例3: checkUser

 function checkUser()
 {
     if ($_REQUEST['code']) {
         $redirect_uri = Addons::createAddonShow('Login', 'no_register_display', array('type' => 'taobao', 'do' => "bind"));
         $url = 'https://oauth.taobao.com/token';
         $field = 'grant_type=authorization_code&client_id=' . TAOBAO_KEY . '&code=' . $_REQUEST['code'] . '&client_secret=' . TAOBAO_SECRET . '&redirect_uri=' . urlencode($redirect_uri);
         $ch = curl_init();
         curl_setopt($ch, CURLOPT_URL, $url);
         curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
         curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
         curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
         curl_setopt($ch, CURLOPT_POST, true);
         curl_setopt($ch, CURLOPT_POSTFIELDS, $field);
         $result = curl_exec($ch);
         $res = json_decode($result, TRUE);
         if ($res['taobao_user_id']) {
             $_SESSION['taobao']['access_token']['oauth_token'] = $res['access_token'];
             $_SESSION['taobao']['access_token']['oauth_token_secret'] = $res['refresh_token'];
             $_SESSION['taobao']['isSync'] = 1;
             $_SESSION['taobao']['uid'] = $res['taobao_user_id'];
             $_SESSION['taobao']['uname'] = $res['taobao_user_nick'];
             $_SESSION['taobao']['userface'] = '';
             $_SESSION['open_platform_type'] = 'taobao';
             return $res;
         } else {
             return false;
         }
     } else {
         return false;
     }
 }
开发者ID:naliduo,项目名称:ThinkSNS,代码行数:31,代码来源:taobao.class.php


示例4: __construct

 /**
  * 架构函数,处理核心变量
  * 使用字符串返回 不能有任何输出
  */
 public function __construct()
 {
     //当前登录者uid
     $GLOBALS['ts']['mid'] = $this->mid = intval($_SESSION['mid']);
     //当前访问对象的uid
     $GLOBALS['ts']['uid'] = $this->uid = intval($_REQUEST['uid'] == 0 ? $this->mid : $_REQUEST['uid']);
     // 赋值当前访问者用户
     $GLOBALS['ts']['user'] = $this->user = model('User')->getUserInfo($this->mid);
     if ($this->mid != $this->uid) {
         $GLOBALS['ts']['_user'] = model('User')->getUserInfo($this->uid);
     } else {
         $GLOBALS['ts']['_user'] = $GLOBALS['ts']['user'];
     }
     //当前用户的所有已添加的应用
     $GLOBALS['ts']['_userApp'] = $userApp = model('UserApp')->getUserApp($this->uid);
     //当前用户的统计数据
     $GLOBALS['ts']['_userData'] = $userData = model('UserData')->getUserData($this->uid);
     $this->site = D('Xdata')->get('admin_Config:site');
     $this->site['logo'] = getSiteLogo($this->site['site_logo']);
     $GLOBALS['ts']['site'] = $this->site;
     //语言包判断
     if (TRUE_APPNAME != 'public' && APP_NAME != TRUE_APPNAME) {
         addLang(TRUE_APPNAME);
     }
     Addons::hook('core_filter_init_widget');
 }
开发者ID:medz,项目名称:thinksns-4,代码行数:30,代码来源:Widget.class.php


示例5: __construct

 /**
  * 架构函数
  * @param boolean $location 是否本机调用,本机调用不需要认证
  * @return void
  */
 public function __construct($location = false)
 {
     //$this->mid = $_SESSION['mid'];
     //外部接口调用
     if ($location == false && !defined('DEBUG')) {
         $this->verifyUser();
         //本机调用
     } else {
         $this->mid = @intval($_SESSION['mid']);
     }
     $GLOBALS['ts']['mid'] = $this->mid;
     //默认参数处理
     $this->since_id = isset($_REQUEST['since_id']) ? intval($_REQUEST['since_id']) : '';
     $this->max_id = isset($_REQUEST['max_id']) ? intval($_REQUEST['max_id']) : '';
     $this->page = isset($_REQUEST['page']) ? intval($_REQUEST['page']) : 1;
     $this->count = isset($_REQUEST['count']) ? intval($_REQUEST['count']) : 20;
     $this->user_id = isset($_REQUEST['user_id']) ? intval($_REQUEST['user_id']) : 0;
     $this->user_name = isset($_REQUEST['user_name']) ? h($_REQUEST['user_name']) : '';
     $this->uid = isset($_REQUEST['uid']) ? intval($_REQUEST['uid']) : 0;
     $this->uname = isset($_REQUEST['uname']) ? h($_REQUEST['uname']) : '';
     $this->id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0;
     $this->data = $_REQUEST;
     // findPage
     $_REQUEST[C('VAR_PAGE')] = $this->page;
     //接口初始化钩子
     Addons::hook('core_filter_init_api');
     //控制器初始化
     if (method_exists($this, '_initialize')) {
         $this->_initialize();
     }
 }
开发者ID:songhongyu,项目名称:THINKSNS,代码行数:36,代码来源:Api.class.php


示例6: execApp

 /**
  * 执行App控制器
  * @access public
  * @return void
  */
 public static function execApp()
 {
     // 加载所有插件
     if (C('APP_PLUGIN_ON')) {
         tsload(CORE_LIB_PATH . '/addons.class.php');
         tsload(CORE_LIB_PATH . '/addons/Hooks.class.php');
         tsload(CORE_LIB_PATH . '/addons/AbstractAddons.class.php');
         tsload(CORE_LIB_PATH . '/addons/NormalAddons.class.php');
         tsload(CORE_LIB_PATH . '/addons/SimpleAddons.class.php');
         tsload(CORE_LIB_PATH . '/addons/TagsAbstract.class.php');
         Addons::loadAllValidAddons();
     }
     //创建Action控制器实例
     $className = MODULE_NAME . 'Action';
     tsload(APP_ACTION_PATH . '/' . $className . '.class.php');
     if (!class_exists($className)) {
         $className = 'EmptyAction';
         tsload(APP_ACTION_PATH . '/EmptyAction.class.php');
         if (!class_exists($className)) {
             throw_exception(L('_MODULE_NOT_EXIST_') . MODULE_NAME);
         }
     }
     $module = new $className();
     //异常处理
     if (!$module) {
         // 模块不存在 抛出异常
         throw_exception(L('_MODULE_NOT_EXIST_') . MODULE_NAME);
     }
     //获取当前操作名
     $action = ACTION_NAME;
     //执行当前操作
     call_user_func(array(&$module, $action));
     return;
 }
开发者ID:naliduo,项目名称:ThinkSNS,代码行数:39,代码来源:App.class.php


示例7: getCallback

 private function getCallback($site = '', $type = 'bind', $callbackurl = '')
 {
     if (!$callbackurl) {
         if ($type == 'bind') {
             $callbackurl = Addons::createAddonShow('Login', 'no_register_display', array('type' => $site, 'do' => "bind"));
         } else {
             $callbackurl = Addons::createAddonShow('Login', 'no_register_display', array('type' => $site));
         }
     }
     return urlencode($callbackurl);
 }
开发者ID:omusico,项目名称:ThinkSNS-4,代码行数:11,代码来源:renren.class.php


示例8: getUrl

 public function getUrl($call_back = null)
 {
     if (empty($this->_sina_akey) || empty($this->_sina_skey)) {
         return false;
     }
     if (is_null($call_back)) {
         $call_back = Addons::createAddonShow('Login', 'no_register_display', array('type' => 'sina', 'do' => 'bind'));
     }
     $this->loginUrl = $this->_oauth->getAuthorizeURL($call_back);
     return $this->loginUrl;
 }
开发者ID:medz,项目名称:thinksns-4,代码行数:11,代码来源:sina.class.php


示例9: saveBeautifyLoginConfig

 public function saveBeautifyLoginConfig()
 {
     $data = array();
     $data['template'] = $_POST['template'] ? intval($_POST['template']) : 1;
     $data['color'] = $_POST['color'] ? $_POST['color'] : "FFFFFF";
     $res = model('AddonData')->lput('beautifyLogin', $data);
     if ($res) {
         $this->assign('jumpUrl', Addons::adminPage('beautifyLoginConfig'));
     } else {
         $this->error();
     }
 }
开发者ID:CaliProject,项目名称:thinksns,代码行数:12,代码来源:BeautifyLoginHooks.class.php


示例10: doAdmin

 public function doAdmin()
 {
     $addonInfo = model('Addons')->getAddon($_GET['pluginid']);
     $result = array('status' => true, 'info' => "");
     Addons::addonsHook($addonInfo['name'], $_GET['page'], array('result' => &$result));
     //dump($result);
     if ($result['status']) {
         $this->success($result['info']);
     } else {
         $this->error($result['info']);
     }
 }
开发者ID:armebayelm,项目名称:thinksns-vietnam,代码行数:12,代码来源:AddonsAction.class.php


示例11: install

 function install($addonid)
 {
     if ($addonid > 2) {
         $addon = Addons::find($addonid);
         Event::fire('backend.addons.install', array($addon));
         $addon->installed = 1;
         $addon->save();
         return Redirect::to('addons/manage')->withMessage($this->notifyView(Lang::get('messages.addon_installed')));
     } else {
         return Redirect::to('addons/manage')->withMessage($this->notifyView(Lang::get('messages.no_access'), 'error'));
     }
 }
开发者ID:basdog22,项目名称:laracms,代码行数:12,代码来源:AddonsController.php


示例12: profile

 public function profile()
 {
     $pUserProfile = D('UserProfile');
     $pUserProfile->uid = $this->uid;
     $data['userInfo'] = $pUserProfile->getUserInfo(true);
     // 个人情况-钩子
     Addons::hook('home_space_profile_intro', array('uid' => $this->uid, 'intro' => &$data['userInfo']['intro']['list']));
     // 联系方式-钩子
     Addons::hook('home_space_profile_contact', array('uid' => $this->uid, 'contact' => &$data['userInfo']['contact']['list']));
     $this->assign($data);
     $this->setTitle('Thông tin chi tiết của ' . getUserName($this->uid));
     $this->display();
 }
开发者ID:armebayelm,项目名称:thinksns-vietnam,代码行数:13,代码来源:SpaceAction.class.php


示例13: saveBeautifyCardConfig

 public function saveBeautifyCardConfig()
 {
     $data = array();
     $data['showMedals'] = $_REQUEST['showMedals'] ? 1 : 0;
     $data['isSync'] = $_REQUEST['isSync'] ? 1 : 0;
     $data['color'] = $_REQUEST['color'] ? $_REQUEST['color'] : 2;
     $_POST && ($res = model('AddonData')->lput('beautifyCard', $data));
     if ($res) {
         $this->assign('jumpUrl', Addons::adminPage('beautifyCardConfig'));
     } else {
         $this->error();
     }
 }
开发者ID:CaliProject,项目名称:thinksns,代码行数:13,代码来源:BeautifyCardHooks.class.php


示例14: init

 /**
  * App初始化
  */
 public static function init()
 {
     // 设定错误和异常处理
     set_error_handler(array('App', 'appError'));
     set_exception_handler(array('App', 'appException'));
     // Session初始化
     if (!session_id()) {
         session_start();
     }
     // 加载所有插件
     if (C('APP_PLUGIN_ON')) {
         Addons::loadAllValidAddons();
     }
 }
开发者ID:medz,项目名称:thinksns-4,代码行数:17,代码来源:App.class.php


示例15: saveBeautifyCenterConfig

 public function saveBeautifyCenterConfig()
 {
     $data = array();
     $data['position'] = $_POST['position'] ? $_POST['position'] : 2;
     $data['template'] = $_POST['template'] ? $_POST['template'] : 1;
     $data['sync_bg'] = $_POST['sync_bg'] ? 1 : 0;
     $data['consume_credit'] = $_POST['consume_credit'] == "on" ? 1 : 0;
     $data['consume_quantity'] = $_POST['consume_quantity'] ? $_POST['consume_quantity'] : 50;
     $_POST && ($res = model('AddonData')->lput('beautifyCenter', $data));
     if ($res) {
         $this->assign('jumpUrl', Addons::adminPage('beautifyCenterConfig'));
     } else {
         $this->error();
     }
 }
开发者ID:CaliProject,项目名称:thinksns,代码行数:15,代码来源:BeautifyCenterHooks.class.php


示例16: bind

 function bind()
 {
     $user = M('user')->where('uid=' . $this->mid)->field('email')->find();
     $replace = substr($user['email'], 2, -3);
     for ($i = 1; $i <= strlen($replace); $i++) {
         $replacestring .= '*';
     }
     $data['email'] = str_replace($replace, $replacestring, $user['email']);
     $bindData = array();
     Addons::hook('account_bind_after', array('bindInfo' => &$bindData));
     $data['bind'] = $bindData;
     $this->assign($data);
     $this->setTitle(L('setting') . ' - ' . L('outer_bind'));
     $this->display();
 }
开发者ID:armebayelm,项目名称:thinksns-vietnam,代码行数:15,代码来源:AccountAction.class.php


示例17: displayAddons

 public function displayAddons()
 {
     $result = array();
     $param['res'] =& $result;
     $param['type'] = $_REQUEST['type'];
     Addons::addonsHook(t($_GET['addon']), t($_GET['hook']), $param);
     isset($result['url']) && $this->assign("jumpUrl", $result['url']);
     isset($result['title']) && $this->setTitle($result['title']);
     isset($result['jumpUrl']) && $this->assign('jumpUrl', $result['jumpUrl']);
     if (isset($result['status']) && !$result['status']) {
         $this->error($result['info']);
     }
     if (isset($result['status']) && $result['status']) {
         $this->success($result['info']);
     }
 }
开发者ID:yang7hua,项目名称:hunshe,代码行数:16,代码来源:WidgetAction.class.php


示例18: getUrl

 public function getUrl($call_back = null)
 {
     if (empty($this->_douban_key) || empty($this->_douban_secret)) {
         return false;
     }
     if (is_null($call_back)) {
         $call_back = Addons::createAddonShow('Login', 'no_register_display', array('type' => 'douban', 'do' => "bind"));
     }
     if (empty($this->_authorize_url)) {
         $client = new DoubanOAuth($this->_douban_key, $this->_douban_secret);
         $request_token = $client->getRequestToken();
         $this->_authorize_url = $client->getAuthorizeURL($request_token) . '&oauth_callback=' . urlencode($call_back);
     }
     $_SESSION['douban']['request_token'] = $request_token;
     return $this->_authorize_url;
 }
开发者ID:nanhuacrab,项目名称:ThinkSNS4,代码行数:16,代码来源:douban.class.php


示例19: checkUser

 function checkUser()
 {
     $redirect_uri = Addons::createAddonShow('Login', 'no_register_display', array('type' => 'facebook', 'do' => "bind"));
     $facebook = new FacebookAPI(array('appId' => FACEBOOK_KEY, 'secret' => FACEBOOK_SECRET));
     $token = $facebook->getAccessTokenFromCode($_GET['code'], $redirect_uri);
     //dump($token);
     //exit;
     // if($user){
     // 	$_SESSION['baidu']['access_token']['oauth_token'] = $access_token;
     // 	$_SESSION['baidu']['access_token']['oauth_token_secret'] = $refresh_token;
     // 	$_SESSION['baidu']['isSync'] = 0;
     // 	$_SESSION['baidu']['uid'] = $user['uid'];
     // 	$_SESSION['open_platform_type'] = 'baidu';
     // 	return $user;
     // }else{
     // 	return false;
     // }
 }
开发者ID:songhongyu,项目名称:THINKSNS,代码行数:18,代码来源:facebook.class.php


示例20: displayAddons

 public function displayAddons()
 {
     $result = array();
     $param['res'] =& $result;
     $param['type'] = $_REQUEST['type'];
     $config = model('AddonData')->lget('login');
     if (!in_array($param['type'], $config['open'])) {
         $this->error("该同步操作管理员已关闭");
     }
     Addons::addonsHook($_GET['addon'], $_GET['hook'], $param);
     isset($result['url']) && $this->assign("jumpUrl", $result['url']);
     isset($result['title']) && $this->setTitle($result['title']);
     isset($result['jumpUrl']) && $this->assign('jumpUrl', $result['jumpUrl']);
     if (isset($result['status']) && !$result['status']) {
         $this->error($result['info']);
     }
     if (isset($result['status']) && $result['status']) {
         $this->success($result['info']);
     }
 }
开发者ID:naliduo,项目名称:ThinkSNS,代码行数:20,代码来源:WidgetAction.class.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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