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

PHP getglobal函数代码示例

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

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



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

示例1: getmyappiconpath

 public static function getmyappiconpath($appid, $iconstatus = 0)
 {
     if ($iconstatus > 0) {
         return getglobal('setting/attachurl') . './' . 'myapp/icon/' . $appid . '.jpg';
     }
     return 'http://appicon.manyou.com/icons/' . $appid;
 }
开发者ID:tang86,项目名称:discuz-utf8,代码行数:7,代码来源:helper_manyou.php


示例2: wx_sendMsg

 public function wx_sendMsg($data)
 {
     if (!getglobal('setting/CorpID') || !getglobal('setting/CorpSecret')) {
         return false;
     }
     $user = C::t('user')->fetch($data['uid']);
     if (!$user['wechat_userid'] || $user['wechat_status'] != 1) {
         C::t('notification')->update($data['id'], array('wx_new' => $data['wx_new'] + 1));
         return false;
     }
     $agentid = 0;
     if ($data['from_idtype'] == 'app' && $data['from_id'] && ($wxapp = C::t('wx_app')->fetch($data['from_id']))) {
         if ($wxapp['agentid'] && $wxapp['status'] < 1) {
             $agentid = $wxapp['agentid'];
         }
     }
     $wx = new qyWechat(array('appid' => getglobal('setting/CorpID'), 'appsecret' => getglobal('setting/CorpSecret')));
     $msg = array("touser" => "dzz-" . $data['uid'], "safe" => 0, "agentid" => $agentid, "msgtype" => "news", "news" => array("articles" => array(array("title" => $data['title'], "description" => getstr($data['wx_note'], 0, 0, 0, 0, -1), "url" => $wx->getOauthRedirect(getglobal('siteurl') . 'index.php?mod=system&op=wxredirect&url=' . dzzencode($data['redirecturl']))))));
     if ($ret = $wx->sendMessage($msg)) {
         C::t('notification')->update($data['id'], array('wx_new' => 0));
         return true;
     } else {
         C::t('notification')->update($data['id'], array('wx_new' => $data['wx_new'] + 1));
         $message = 'wx_notification:errCode:' . $wx->errCode . ';errMsg:' . $wx->errMsg;
         runlog('wxlog', $message);
         return false;
     }
 }
开发者ID:druphliu,项目名称:dzzoffice,代码行数:28,代码来源:dzz_notification.php


示例3: outputvariables

 function outputvariables()
 {
     global $_G;
     $variables = array();
     foreach ($this->params as $param) {
         if (substr($param, 0, 1) == '$') {
             if ($param == '$_G') {
                 continue;
             }
             $var = substr($param, 1);
             if (preg_match("/^[a-zA-Z_][a-zA-Z0-9_]*\$/", $var)) {
                 $variables[$param] = $GLOBALS[$var];
             }
         } else {
             if (preg_replace($this->safevariables, '', $param) !== $param) {
                 continue;
             }
             $variables[$param] = getglobal($param);
         }
     }
     $xml = array('Version' => $this->version, 'Charset' => strtoupper($_G['charset']), 'Variables' => $variables);
     if (!empty($_G['messageparam'])) {
         $xml['Message'] = $_G['messageparam'];
     }
     require_once libfile('class/xml');
     echo array2xml($xml);
     exit;
 }
开发者ID:dalinhuang,项目名称:hlwbbsvincent,代码行数:28,代码来源:class_mobiledata.php


示例4: getdata

 function getdata($style, $parameter)
 {
     $advid = 0;
     if (!empty($parameter['title'])) {
         $parameter['title'] = addslashes($parameter['title']);
         $adv = DB::fetch_first('SELECT * FROM ' . DB::table('common_advertisement_custom') . " WHERE name='{$parameter['title']}'");
         if (empty($adv)) {
             $advid = DB::insert('common_advertisement_custom', array('name' => $parameter['title']), 1);
         } else {
             $advid = $adv['id'];
         }
     } elseif (!empty($parameter['adv'])) {
         $parameter['adv'] = addslashes($parameter['adv']);
         $adv = DB::fetch_first('SELECT * FROM ' . DB::table('common_advertisement_custom') . " WHERE name='{$parameter['adv']}'");
         $advid = intval($adv['id']);
     } else {
         $return = 'Empty Ads';
     }
     if ($advid) {
         $flag = false;
         if (getglobal('inajax')) {
             $flag = true;
             setglobal('inajax', 0);
         }
         $return = adshow('custom_' . $advid);
         if ($flag) {
             setglobal('inajax', 1);
         }
     }
     return array('html' => $return, 'data' => null);
 }
开发者ID:dalinhuang,项目名称:hlwbbsvincent,代码行数:31,代码来源:block_adv.php


示例5: setUnrun_by_aid

 public function setUnrun_by_aid($aid, $r)
 {
     //设置允许运行,如果文件在本地同时修改实际文件名,增加无法运行的后缀;
     $data = parent::fetch($aid);
     if ($data['remote'] == 0 || $data['remote'] == 1) {
         //文件在本地,修改文件名
         if ($r > 0) {
             $earr = explode('.', $data['attachment']);
             foreach ($earr as $key => $ext) {
                 if (in_array(strtolower($ext), array($data['filetype'], 'dzz'))) {
                     unset($earr[$key]);
                 }
             }
             $tattachment = implode('.', $earr) . '.dzz';
             if ($is_file(getglobal('setting/attachdir') . './' . $data['attachment']) && @rename(getglobal('setting/attachdir') . './' . $data['attachment'], getglobal('setting/attachdir') . './' . $tattachment)) {
                 return parent::update($aid, array('unrun' => $r, 'attachment' => $tattachment));
             }
         } else {
             $earr = explode('.', $data['attachment']);
             foreach ($earr as $key => $ext) {
                 if (in_array(strtolower($ext), array($data['filetype'], 'dzz'))) {
                     unset($earr[$key]);
                 }
             }
             $tattachment = implode('.', $earr) . '.' . $data['filetype'];
             if ($is_file(getglobal('setting/attachdir') . './' . $data['attachment']) && @rename(getglobal('setting/attachdir') . './' . $data['attachment'], getglobal('setting/attachdir') . './' . $tattachment)) {
                 return parent::update($aid, array('unrun' => $r, 'attachment' => $tattachment));
             }
         }
     }
     return false;
 }
开发者ID:druphliu,项目名称:dzzoffice,代码行数:32,代码来源:table_attachment.php


示例6: fetch_all_by_bid

 public function fetch_all_by_bid($bid, $isverified = 1, $start = 0, $limit = 0, $bannedids = array(), $format = true)
 {
     $data = array();
     if ($bid = dintval($bid, true)) {
         $addsql = $bannedids = dintval($bannedids, true) ? ' AND id NOT IN (' . dimplode($bannedids) . ')' : '';
         $query = DB::query('SELECT * FROM %t WHERE ' . DB::field('bid', $bid) . ' AND isverified=%d' . $addsql . ' ORDER BY stickgrade DESC, displayorder DESC, verifiedtime DESC, dataid DESC ' . DB::limit($start, $limit), array($this->_table, $isverified));
         while ($value = DB::fetch($query)) {
             if ($format) {
                 $value['fields'] = unserialize($value['fields']);
                 $value['fields']['timestamp'] = $value['fields']['dateline'];
                 $value['fields']['dateline'] = dgmdate($value['fields']['dateline']);
                 $value['pic'] = $value['pic'] !== STATICURL . 'image/common/nophoto.gif' ? $value['pic'] : '';
                 if ($value['pic'] && $value['picflag'] == '1') {
                     $value['pic'] = getglobal('setting/attachurl') . $value['pic'];
                 } elseif ($value['picflag'] == '2') {
                     $value['pic'] = getglobal('setting/ftp/attachurl') . $value['pic'];
                 }
                 $value['dateline'] = dgmdate($value['dateline'], 'u');
                 $value['verifiedtime'] = dgmdate($value['verifiedtime'], 'u');
             }
             $data[$value['id']] = $value;
         }
     }
     return $data;
 }
开发者ID:tang86,项目名称:discuz-utf8,代码行数:25,代码来源:table_common_block_item_data.php


示例7: update_by_cid

 public function update_by_cid($cid, $message, $rcid, $attach)
 {
     $ret = 0;
     $ret += parent::update($cid, array('message' => $message, 'rcid' => $rcid, 'edituid' => getglobal('uid'), 'edittime' => TIMESTAMP));
     $ret += C::t('comment_attach')->update_by_cid($cid, $attach);
     return $ret;
 }
开发者ID:druphliu,项目名称:dzzoffice,代码行数:7,代码来源:table_comment.php


示例8: getdata

 function getdata($style, $parameter)
 {
     $advid = 0;
     if (!empty($parameter['title'])) {
         $adv = C::t('common_advertisement_custom')->fetch_by_name($parameter['title']);
         if (empty($adv)) {
             $advid = C::t('common_advertisement_custom')->insert(array('name' => $parameter['title']), true);
         } else {
             $advid = $adv['id'];
         }
     } elseif (!empty($parameter['adv'])) {
         $adv = C::t('common_advertisement_custom')->fetch_by_name($parameter['adv']);
         $advid = intval($adv['id']);
     } else {
         $return = 'Empty Ads';
     }
     if ($advid) {
         $flag = false;
         if (getglobal('inajax')) {
             $flag = true;
             setglobal('inajax', 0);
         }
         $return = adshow('custom_' . $advid);
         if ($flag) {
             setglobal('inajax', 1);
         }
     }
     return array('html' => $return, 'data' => null);
 }
开发者ID:MCHacker,项目名称:discuz-docker,代码行数:29,代码来源:block_adv.php


示例9: upload

 function upload($source, $target)
 {
     if ($this->error()) {
         return 0;
     }
     $old_dir = $this->ftp_pwd();
     $dirname = dirname($target);
     $filename = basename($target);
     if (!$this->ftp_chdir($dirname)) {
         if ($this->ftp_mkdir($dirname)) {
             $this->ftp_chmod($dirname);
             if (!$this->ftp_chdir($dirname)) {
                 $this->set_error(FTP_ERR_CHDIR);
             }
             $this->ftp_put('index.htm', getglobal('setting/attachdir') . '/index.htm', FTP_BINARY);
         } else {
             $this->set_error(FTP_ERR_MKDIR);
         }
     }
     $res = 0;
     if (!$this->error()) {
         if ($fp = @fopen($source, 'rb')) {
             $res = $this->ftp_fput($filename, $fp, FTP_BINARY);
             @fclose($fp);
             !$res && $this->set_error(FTP_ERR_TARGET_WRITE);
         } else {
             $this->set_error(FTP_ERR_SOURCE_READ);
         }
     }
     $this->ftp_chdir($old_dir);
     return $res ? 1 : 0;
 }
开发者ID:softhui,项目名称:discuz,代码行数:32,代码来源:discuz_ftp.php


示例10: insert_by_uid

 public function insert_by_uid($uid, $jobid)
 {
     if (!$jobid) {
         return self::delete_by_uid($uid);
     }
     $setarr = array('uid' => $uid, 'jobid' => $jobid, 'dateline' => TIMESTAMP, 'opuid' => getglobal('uid'));
     return parent::insert($setarr, 1, 1);
 }
开发者ID:druphliu,项目名称:dzzoffice,代码行数:8,代码来源:table_organization_upjob.php


示例11: updatestat

function updatestat($type, $primary = 0, $num = 1)
{
    $uid = getglobal('uid');
    $updatestat = getglobal('setting/updatestat');
    if (empty($uid) || empty($updatestat)) {
        return false;
    }
    C::t('common_stat')->updatestat($uid, $type, $primary, $num);
}
开发者ID:softhui,项目名称:discuz,代码行数:9,代码来源:function_stat.php


示例12: dbsize

 public static function dbsize()
 {
     $dbsize = 0;
     $query = DB::query("SHOW TABLE STATUS LIKE '" . getglobal('config/db/1/tablepre') . "%'", 'SILENT');
     while ($table = DB::fetch($query)) {
         $dbsize += $table['Data_length'] + $table['Index_length'];
     }
     return $dbsize;
 }
开发者ID:MCHacker,项目名称:discuz-docker,代码行数:9,代码来源:helper_dbtool.php


示例13: __construct

 public function __construct()
 {
     $this->_table = 'common_block';
     $this->_pk = 'bid';
     parent::__construct();
     $this->_allowmem = null;
     $this->cache_ttl = $this->_cache_ttl = getglobal('setting/memory/diyblock');
     $this->allowmem = $this->_cache_ttl !== null && memory('check');
 }
开发者ID:softhui,项目名称:discuz,代码行数:9,代码来源:table_common_block.php


示例14: memory_driver_redis

 function &instance()
 {
     static $object;
     if (empty($object)) {
         $object = new memory_driver_redis();
         $object->init(getglobal('config/memory/redis'));
     }
     return $object;
 }
开发者ID:MCHacker,项目名称:discuz-docker,代码行数:9,代码来源:memory_driver_redis.php


示例15: insert

 public function insert($uid, $orgid)
 {
     if (!$uid || !$orgid) {
         return 0;
     }
     $id = parent::insert(array("orgid" => $orgid, 'uid' => $uid, 'opuid' => getglobal('uid'), 'dateline' => TIMESTAMP), 1, 1);
     self::update_groupid_by_uid($uid);
     return DB::result_first('select id from %t where uid=%d and orgid=%d', array($this->_table, $uid, $orgid));
 }
开发者ID:druphliu,项目名称:dzzoffice,代码行数:9,代码来源:table_organization_admin.php


示例16: add

 public function add($siteUid, $pkId, $type, $authorId, $author, $fromId, $fromIdType, $note, $fromNum, $dateline, $extra = array())
 {
     $_params = array('openid' => $this->getUserOpenId($siteUid), 'sSiteUid' => $siteUid, 'pkId' => $pkId, 'type' => $type, 'authorId' => $authorId, 'author' => $author, 'fromId' => $fromId, 'fromIdType' => $fromIdType, 'fromNum' => $fromNum, 'content' => $note, 'dateline' => $dateline, 'deviceToken' => $this->getUserDeviceToken($siteUid), 'extra' => array('isAdminGroup' => getglobal('adminid'), 'groupId' => getglobal('groupid'), 'groupName' => getglobal('group/grouptitle')));
     if ($extra) {
         foreach ($extra as $key => $value) {
             $_params['extra'][$key] = $value;
         }
     }
     return $this->_callMethod('connect.discuz.notification.add', $_params);
 }
开发者ID:tang86,项目名称:discuz-utf8,代码行数:10,代码来源:Notification.php


示例17: geturl

 function geturl()
 {
     $url = getglobal('basefilename') . '?';
     if (!empty($_GET)) {
         foreach ($_GET as $key => $value) {
             $url .= urlencode($key) . '=' . urlencode(stripslashes($value)) . '&';
         }
     }
     return $url;
 }
开发者ID:dalinhuang,项目名称:hlwbbsvincent,代码行数:10,代码来源:class_panel.php


示例18: check_module

 public static function check_module($module)
 {
     $status = 0;
     $allowfuntype = array('portal', 'group', 'follow', 'collection', 'guide', 'feed', 'blog', 'doing', 'album', 'share', 'wall', 'homepage', 'ranklist');
     $module = in_array($module, $allowfuntype) ? trim($module) : '';
     if (!empty($module)) {
         $status = getglobal('setting/' . $module . 'status');
     }
     return $status;
 }
开发者ID:huming17,项目名称:dzmvc,代码行数:10,代码来源:helper_access.php


示例19: delete

 public function delete($val, $unbuffered = false)
 {
     if ($val = dintval($val, true)) {
         $this->_pre_cache_key = 'blockstylecache_';
         $this->_cache_ttl = getglobal('setting/memory/diyblock/ttl');
         $this->_allowmem = getglobal('setting/memory/diyblock/enable') && memory('check');
         return parent::delete($val, $unbuffered);
     }
     return false;
 }
开发者ID:softhui,项目名称:discuz,代码行数:10,代码来源:table_common_block_style.php


示例20: cache

 public function cache($name)
 {
     if (!isset($this->app->var['cache'][$name])) {
         loadcache($name);
     }
     if ($this->app->var['cache'][$name] === null) {
         return null;
     } else {
         return getglobal('cache/' . $name);
     }
 }
开发者ID:dalinhuang,项目名称:healthshop,代码行数:11,代码来源:discuz_model.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP getgpc函数代码示例发布时间:2022-05-15
下一篇:
PHP getfriendgroup函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap