搞好了,ucenter提供两种方式,一种mysql直接连接,一种通过fsockopen调用ucenter的接口,现在采用第二种方法,在fsockopen之前,改变client.php的uc_api_post函数:
PHP code
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(mb_convert_encoding($v2,'UTF-8','gb2312')));
$sep2 = '&';
}
$s .= $sep.$s2;
} else {
$s .= "$sep$k=".urlencode(uc_stripslashes(mb_convert_encoding($v,'UTF-8','gb2312')));
}
$sep = '&';
}
$postdata = uc_api_requestdata($module, $action, $s);
return uc_fopen2(UC_API.'/index.php', 500000, $postdata, '', TRUE, UC_IP, 20);
}
也就是加了mb转码
打完收工