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

PHP uc_fopen2函数代码示例

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

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



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

示例1: sendone

 function sendone($appid, $noteid = 0, $note = '')
 {
     $return = FALSE;
     $app = $this->apps[$appid];
     if ($noteid) {
         $note = $this->_get_note_by_id($noteid);
     }
     $this->base->load('misc');
     $url = $this->get_url_code($note['operation'], $note['getdata'], $appid);
     $getcontent = trim(uc_fopen2($url, 500000, $note['postdata'], '', 1, $app['ip'], UC_NOTE_TIMEOUT));
     $returnsucceed = $getcontent != '' && $getcontent != '-1';
     $closedsqladd = $this->_close_note($note, $this->apps, $returnsucceed) ? ",closed='1'" : '';
     //
     if ($returnsucceed) {
         if ($this->operations[$note['operation']][2]) {
             $this->base->load($this->operations[$note['operation']][2]);
             $func = $this->operations[$note['operation']][3];
             $_ENV[$this->operations[$note['operation']][2]]->{$func}($appid, $getcontent);
         }
         $this->db->query("UPDATE " . UC_DBTABLEPRE . "notelist SET app{$appid}='1', totalnum=totalnum+1, succeednum=succeednum+1, dateline='{$this->base->time}' {$closedsqladd} WHERE noteid='{$note['noteid']}'", 'SILENT');
         $return = TRUE;
     } else {
         $this->db->query("UPDATE " . UC_DBTABLEPRE . "notelist SET app{$appid} = app{$appid}-'1', totalnum=totalnum+1, dateline='{$this->base->time}' {$closedsqladd} WHERE noteid='{$note['noteid']}'", 'SILENT');
         $return = FALSE;
     }
     return $return;
 }
开发者ID:ablozhou,项目名称:hairnet,代码行数:27,代码来源:note.php


示例2: connect

 function connect($url, $password, $ip = '')
 {
     $ucapi = preg_replace("/\\/\$/", '', trim($url));
     $ucip = trim($ip);
     if (!$ucip) {
         $temp = @parse_url($ucapi);
         $ucip = gethostbyname($temp['host']);
         if (ip2long($ucip) == -1 || ip2long($ucip) === FALSE) {
             $ucip = '';
         }
     }
     $ucinfo = uc_fopen2($ucapi . '/index.php?m=app&a=ucinfo&a=ucinfo', 500, '', '', 1, $ucip);
     list($status, $ucversion, $ucrelease, $uccharset, $ucdbcharset, $apptypes) = explode('|', $ucinfo);
     if ($status != 'UC_STATUS_OK') {
         exit('连接失败,请检查URL和密码是否正确!');
     }
     $postdata = "m=app&a=add&ucfounder=&ucfounderpw=" . urlencode($password) . "&apptype=" . urlencode('OTHER') . "&appname=" . urlencode($this->base->setting['site_name']) . "&appurl=" . urlencode(SITE_URL) . "&appip=&appcharset=" . TIPASK_CHARSET . '&appdbcharset=' . DB_CHARSET;
     $s = uc_fopen2($ucapi . '/index.php', 500, $postdata, '', 1, $ucip);
     if (empty($s)) {
         exit('不能连接到UCenter服务端!');
     } elseif ($s == '-1') {
         exit('UCenter密码错误!');
     } else {
         $ucs = explode('|', $s);
         if (empty($ucs[0]) || empty($ucs[1])) {
             exit('网络连接超时,不能返回数据,请稍后重试!');
         }
     }
     $ucdata = "<?php\ndefine('UC_OPEN','1');\ndefine('UC_CONNECT', 'uc_api_post');\ndefine('UC_DBHOST', '{$ucs['2']}');\ndefine('UC_DBUSER', '{$ucs['4']}');\ndefine('UC_DBPW', '{$ucs['5']}');\ndefine('UC_DBNAME', '{$ucs['3']}');\ndefine('UC_DBCHARSET', '{$ucs['6']}');\ndefine('UC_DBTABLEPRE', '{$ucs['7']}');\ndefine('UC_KEY', '{$ucs['0']}');\ndefine('UC_API', '{$ucapi}');\ndefine('UC_CHARSET', '{$ucs['8']}');\ndefine('UC_IP', '{$ucip}');\ndefine('UC_APPID', '{$ucs['1']}');\n?>";
     $bytes = writetofile(TIPASK_ROOT . '/data/ucconfig.inc.php', $ucdata);
     return 0 != $bytes;
 }
开发者ID:eappl,项目名称:prototype,代码行数:32,代码来源:ucenter.class.php


示例3: my_userapp_update

function my_userapp_update($uId, $appId, $privacy = null, $allowProfileLink = null)
{
    global $my_register_url, $_G;
    $mySiteId = $_G['setting']['my_siteid'];
    $mySiteKey = $_G['setting']['my_sitekey'];
    if (!$_G['setting']['my_app_status']) {
        $res = array('errCode' => 121, 'errMessage' => 'Manyou Service Disabled', 'result' => '');
        return $res;
    }
    $data = array();
    if ($privacy !== null) {
        switch ($privacy) {
            case 1:
                $data['privacy'] = 'friends';
                break;
            case 3:
                $data['privacy'] = 'me';
                break;
            case 5:
                $data['privacy'] = 'none';
                break;
            case 0:
            default:
                $data['privacy'] = 'public';
        }
    }
    if ($allowProfileLink !== null) {
        $data['allowProfileLink'] = $allowProfileLink ? true : false;
    }
    if (!$data) {
        return array('errCode' => 5, 'errMessage' => 'Post Data Cann\'t Be Empty!');
    }
    $data = serialize($data);
    $key = "{$mySiteId}|{$mySiteKey}|{$uId}|{$appId}|{$data}";
    $key = md5($key);
    $data = urlencode($data);
    $postString = sprintf('action=%s&key=%s&mySiteId=%d&uId=%d&appId=%d&data=%s', 'userappUpdate', $key, $mySiteId, $uId, $appId, $data);
    loaducenter();
    $url = 'http://api.manyou.com/uchome.php';
    $response = uc_fopen2($url, 0, $postString, '', false, $_G['setting']['my_ip']);
    $res = unserialize($response);
    if (!$response) {
        $res['errCode'] = 111;
        $res['errMessage'] = 'Empty Response';
        $res['result'] = $response;
    } elseif (!$res) {
        $res['errCode'] = 110;
        $res['errMessage'] = 'Error Response';
        $res['result'] = $response;
    }
    return $res;
}
开发者ID:lemonstory,项目名称:bbs,代码行数:52,代码来源:spacecp_space.php


示例4: my_site_close

function my_site_close($mySiteId, $mySiteKey)
{
    $key = $mySiteId . $mySiteKey;
    $key = md5($key);
    $postString = sprintf('action=%s&key=%s&mySiteId=%d', 'siteClose', $key, $mySiteId);
    $response = uc_fopen2($_MY_GLOBAL['my_register_url'], 0, $postString, '', false, '');
    $res = unserialize($response);
    if (!$response) {
        $res['errCode'] = 111;
        $res['errMessage'] = 'Empty Response';
        $res['result'] = $response;
    } elseif (!$res) {
        $res['errCode'] = 110;
        $res['errMessage'] = 'Error Response';
        $res['result'] = $response;
    }
    return $res['result'];
}
开发者ID:armebayelm,项目名称:thinksns-vietnam,代码行数:18,代码来源:function.php


示例5: uc_api_post

function uc_api_post($module, $action, $arg = array())
{
    $s = $sep = '';
    foreach ($arg as $k => $v) {
        if (is_array($v)) {
            $s2 = $sep2 = '';
            foreach ($v as $k2 => $v2) {
                $s2 .= "{$sep2}{$k}[{$k2}]=" . urlencode(uc_stripslashes($v2));
                $sep2 = '&';
            }
            $s .= $sep . $s2;
        } else {
            $s .= "{$sep}{$k}=" . urlencode(uc_stripslashes($v));
        }
        $sep = '&';
    }
    $postdata = uc_api_requestdata($module, $action, $s);
    return uc_fopen2(UC_API . '/index.php', 500000, $postdata, '', TRUE, UC_IP, 20);
}
开发者ID:noikiy,项目名称:MyShop,代码行数:19,代码来源:client.php


示例6: uc_check_avatar

function uc_check_avatar($uid, $size = 'middle', $type = 'virtual')
{
    $url = UC_API . "/avatar.php?uid={$uid}&size={$size}&type={$type}&check_file_exists=1";
    $res = uc_fopen2($url, 500000, '', '', TRUE, UC_IP, 20);
    if ($res == 1) {
        return 1;
    } else {
        return 0;
    }
}
开发者ID:armebayelm,项目名称:thinksns-vietnam,代码行数:10,代码来源:client.php


示例7: elseif

	} elseif(strexists($apptypes, 'uchome')) {
		show_msg('已经安装过一个UCenter Home产品,如果想继续安装,请先到 UCenter 应用管理中删除已有的UCenter Home!');
	}
	$tagtemplates = 'apptagtemplates[template]='.urlencode('<a href="{url}" target="_blank">{subject}</a>').'&'.
		'apptagtemplates[fields][subject]='.urlencode('日志标题').'&'.
		'apptagtemplates[fields][uid]='.urlencode('用户 ID').'&'.
		'apptagtemplates[fields][username]='.urlencode('用户名').'&'.
		'apptagtemplates[fields][dateline]='.urlencode('日期').'&'.
		'apptagtemplates[fields][spaceurl]='.urlencode('空间地址').'&'.
		'apptagtemplates[fields][url]='.urlencode('日志地址');

	$uri = $_SERVER['REQUEST_URI']?$_SERVER['REQUEST_URI']:($_SERVER['PHP_SELF']?$_SERVER['PHP_SELF']:$_SERVER['SCRIPT_NAME']);
	$app_url = strtolower(substr($_SERVER['SERVER_PROTOCOL'], 0, strpos($_SERVER['SERVER_PROTOCOL'], '/'))).'://'.$_SERVER['HTTP_HOST'].preg_replace("/\/*install$/i", '', substr($uri, 0, strrpos($uri, '/install')));

	$postdata = "m=app&a=add&ucfounder=&ucfounderpw=".urlencode($_POST['ucfounderpw'])."&apptype=".urlencode('UCHOME')."&appname=".urlencode('个人家园')."&appurl=".urlencode($app_url)."&appip=&appcharset=".$_SC['charset'].'&appdbcharset='.$_SC['dbcharset'].'&release='.UC_CLIENT_RELEASE.'&'.$tagtemplates;
	$s = uc_fopen2($ucapi.'/index.php', 500, $postdata, '', 1, $ucip);
	if(empty($s)) {
		show_msg('UCenter用户中心无法连接');
	} elseif($s == '-1') {
		show_msg('UCenter管理员帐号密码不正确');
	} else {
		$ucs = explode('|', $s);
		if(empty($ucs[0]) || empty($ucs[1])) {
			show_msg('UCenter返回的数据出现问题,请参考:<br />'.shtmlspecialchars($s));
		} else {

			//处理成功
			$apphidden = '';
			//验证是否可以直接联接MySQL
			$link = mysql_connect($ucs[2], $ucs[4], $ucs[5], 1);
			$connect = $link && mysql_select_db($ucs[3], $link) ? 'mysql' : '';
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:31,代码来源:index.php


示例8: my_site_restore

function my_site_restore($op)
{
    $url = 'http://api.manyou.com/uchome.php';
    global $_SITE_CONFIG;
    $siteUrl = getmyopurl() . '/';
    $postString = sprintf('action=%s&siteUrl=%s&op=%s', 'webmaster', $siteUrl, $op);
    $response = uc_fopen2($url, 0, $postString, '', false, $_SITE_CONFIG['my_ip']);
    $res = unserialize($response);
    if (!$response) {
        $res['errCode'] = 111;
        $res['errMessage'] = 'Empty Response';
        $res['result'] = $response;
    } elseif (!$res) {
        $res['errCode'] = 110;
        $res['errMessage'] = 'Error Response';
        $res['result'] = $response;
    }
    if ($res['errCode']) {
        return $res;
    }
    // lock file
    $fp = fopen(SITE_ROOT . '/data/thinksns_myop_utility.lock', 'w');
    if ($fp === false) {
        my_show_message(sprintf('请确保 <strong>%s/data/thinksns_myop_utility.lock</strong> 文件可写!', SITE_ROOT));
    }
    fclose($fp);
    return $res['result'];
}
开发者ID:laiello,项目名称:thinksns-2,代码行数:28,代码来源:thinksns_myop_utility.php


示例9: my_site_close

function my_site_close($mySiteId, $mySiteKey)
{
    global $my_register_url, $_SCONFIG;
    $key = $mySiteId . $mySiteKey;
    $key = md5($key);
    $postString = sprintf('action=%s&key=%s&mySiteId=%d', 'siteClose', $key, $mySiteId);
    include_once S_ROOT . './uc_client/client.php';
    $response = uc_fopen2($my_register_url, 0, $postString, '', false, $_SCONFIG['my_ip']);
    $res = unserialize($response);
    if (!$response) {
        $res['errCode'] = 111;
        $res['errMessage'] = 'Empty Response';
        $res['result'] = $response;
    } elseif (!$res) {
        $res['errCode'] = 110;
        $res['errMessage'] = 'Error Response';
        $res['result'] = $response;
    }
    return $res['result'];
}
开发者ID:jonycookie,项目名称:projectm2,代码行数:20,代码来源:admincp_userapp.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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