本文整理汇总了PHP中loaducenter函数的典型用法代码示例。如果您正苦于以下问题:PHP loaducenter函数的具体用法?PHP loaducenter怎么用?PHP loaducenter使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了loaducenter函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: csc
function csc($task = array())
{
global $_G;
$taskvars = array('num' => 0);
$num = 0;
$query = DB::query("SELECT variable, value FROM " . DB::table('common_taskvar') . " WHERE taskid='{$task['taskid']}'");
while ($taskvar = DB::fetch($query)) {
if ($taskvar['value']) {
$taskvars[$taskvar['variable']] = $taskvar['value'];
}
}
$taskvars['time'] = floatval($taskvars['time']);
if ($taskvars['act'] == 'buddy') {
loaducenter();
$num = uc_friend_totalnum($_G['uid'], 1) + uc_friend_totalnum($_G['uid'], 3) - DB::result_first("SELECT value FROM " . DB::table('forum_spacecache') . " WHERE uid='{$_G['uid']}' AND variable='buddy{$task['taskid']}'");
} elseif ($taskvars['act'] == 'magic') {
$num = DB::result_first("SELECT COUNT(*) FROM " . DB::table('forum_magiclog') . " WHERE action='2' AND uid='{$_G['uid']}'" . ($taskvars['time'] ? " AND dateline BETWEEN {$task['applytime']} AND {$task['applytime']}+3600*{$taskvars['time']}" : " AND dateline>{$task['applytime']}"));
}
if ($num && $num >= $taskvars['num']) {
if (in_array($taskvars['act'], array('buddy', 'favorite'))) {
DB::query("DELETE FROM " . DB::table('forum_spacecache') . " WHERE uid='{$_G['uid']}' AND variable='{$taskvars['act']}{$task['taskid']}'");
}
return TRUE;
} elseif ($taskvars['time'] && TIMESTAMP >= $task['applytime'] + 3600 * $taskvars['time'] && (!$num || $num < $taskvars['num'])) {
return FALSE;
} else {
return array('csc' => $num > 0 && $taskvars['num'] ? sprintf("%01.2f", $num / $taskvars['num'] * 100) : 0, 'remaintime' => $taskvars['time'] ? $task['applytime'] + $taskvars['time'] * 3600 - TIMESTAMP : 0);
}
}
示例2: onNotificationsGet
public function onNotificationsGet($uId)
{
$notify = $result = array();
$result = array('message' => array('unread' => 0, 'mostRecent' => 0), 'notification' => array('unread' => 0, 'mostRecent' => 0), 'friendRequest' => array('uIds' => array()));
$i = 0;
foreach (C::t('home_notification')->fetch_all_by_uid($uId, 1) as $value) {
$i++;
if (!$result['notification']['mostRecent']) {
$result['notification']['mostRecent'] = $value['dateline'];
}
}
$result['notification']['unread'] = $i;
loaducenter();
$pmarr = uc_pm_list($uId, 1, 1, 'newbox', 'newpm');
if ($pmarr['count']) {
$result['message']['unread'] = $pmarr['count'];
$result['message']['mostRecent'] = $pmarr['data'][0]['dateline'];
}
$fIds = array();
foreach (C::t('home_friend_request')->fetch_all_by_uid($uId) as $value) {
if (!$result['friendRequest']['mostRecent']) {
$result['friendRequest']['mostRecent'] = $value['dateline'];
}
$fIds[] = $value['uid'];
}
$result['friendRequest']['uIds'] = $fIds;
return $result;
}
示例3: xwbSiteUserRegister
/**
* 资源初始化
* @access public
* @return xwbSiteUserRegister
*/
function xwbSiteUserRegister()
{
global $_G;
loaducenter();
$this->ip = (string) $_G['clientip'];
$this->timestamp = TIMESTAMP;
}
示例4: _updatePass
private function _updatePass($res, $oldpassword, $newpassword)
{
global $_G;
$oldpassword = $oldpassword ? urldecode($oldpassword) : '';
$newpassword = $newpassword ? urldecode($newpassword) : '';
if (!empty($newpassword) && $newpassword != addslashes($newpassword)) {
// 抱歉,密码空或包含非法字符:新密码
return $this->makeErrorInfo($res, lang('message', 'profile_passwd_illegal'));
}
loaducenter();
$ucresult = uc_user_edit(addslashes($_G['username']), $oldpassword, $newpassword);
if ($ucresult == -1) {
// 原密码不正确,您不能修改密码或 Email 或安全提问
return $this->makeErrorInfo($res, lang('message', 'profile_passwd_wrong'));
}
$setarr['password'] = md5(random(10));
C::t('common_member')->update($_G['uid'], $setarr);
$secretStr = AppbymeUserAccess::getSecretStr($_G['uid'], $newpassword);
$newAccessSecret = $secretStr['accessSecret'];
$data = array('user_access_secret' => $newAccessSecret);
$result = AppbymeUserAccess::updateUserAccess($data, $_G['uid']);
// if (!$result) {
// return $this->makeErrorInfo($res, 'user_info_edit_error');
// }
$res['token'] = $secretStr['accessToken'];
$res['secret'] = $newAccessSecret;
return $res;
}
示例5: register_header
function register_header()
{
global $_G;
$inputemail = 'gp_' . $this->regemail['email'];
$_G['gp_email'] = $_G[$inputemail];
if ($_POST) {
$_G['gp_activationauth'] = strip_tags(str_replace(" ", "+", $_G['gp_activationauth']));
$activationinfo = authcode($_G['gp_activationauth'], $operation = 'DECODE');
$activationinfoname = preg_replace("/\\s.+/i", "", $activationinfo);
if ($activationinfoname) {
loaducenter();
if ($data = uc_get_user($activationinfoname)) {
list($uid, $username, $email) = $data;
}
$_G['gp_email'] = getEmail(strip_tags($email));
} else {
$_G['gp_email'] = getEmail(strip_tags($_G['gp_email']));
}
$_G['gp_rid'] = strip_tags($_G['gp_rid']);
if (!$_G['gp_rid']) {
showmessage('dsu_amufzc:1', '');
}
if (!$_G['gp_email']) {
showmessage('dsu_amufzc:5', '');
}
$amutb = DB::table("plugin_dsuamfzc");
$query = DB::fetch_first("SELECT * FROM {$amutb} WHERE rid = '" . $_G['gp_rid'] . "'");
if (!$query || $query['yes'] == '1') {
showmessage('dsu_amufzc:2', '');
}
if ($_G['gp_email'] != $query['email']) {
showmessage('dsu_amufzc:11', '');
}
}
}
示例6: _getPMMsgList
private function _getPMMsgList($uid, $fromUid, $startTime = 0, $stopTime = 0, $cacheCount = 0, $pmLimit = 10, $isFilter = false)
{
$msgList = array();
$hasPrev = false;
$plid = 0;
loaducenter();
$tempMsgList = array();
if ($stopTime == 0) {
// 获取新的消息
if ($startTime == 0) {
// 获取新的消息
$count = (int) uc_pm_view_num($uid, $fromUid, 0);
$tempMsgList = (array) uc_pm_view($uid, 0, $fromUid, 5, 1, $pmLimit, 0, 0);
$count > count($tempMsgList) && ($hasPrev = true);
} else {
$tempMsgList = (array) uc_pm_view($uid, 0, $fromUid, 5, 1, 50, 0, 0);
$lastIndex = count($tempMsgList) - 1;
if ($lastIndex >= 0) {
$offset = 0;
for ($i = $lastIndex; $i >= 0; $i--) {
if ($tempMsgList[$i]['dateline'] <= $startTime) {
$offset = $i;
$offset++;
break;
}
}
$tempMsgList = array_slice($tempMsgList, $offset);
}
}
} else {
if ($stopTime) {
// 获取历史的消息
$count = (int) uc_pm_view_num($uid, $fromUid, 0);
$lastPage = (int) (($count - 1) / $pmLimit) + 1;
$page = (int) floor($cacheCount / $pmLimit) + 1;
$tempList = (array) uc_pm_view($uid, 0, $fromUid, 5, $page, $pmLimit);
foreach ($tempList as $pm) {
if ($pm['dateline'] < $stopTime) {
$tempMsgList[] = $pm;
}
}
$page < $lastPage && ($hasPrev = true);
}
}
foreach ($tempMsgList as $msg) {
$msgInfo = array();
$plid = $msg['plid'];
if (!$isFilter || $msg['authorid'] != $uid) {
$tempMsg = $this->_transMessage($msg['message']);
$msgInfo['sender'] = (int) $msg['authorid'];
$msgInfo['mid'] = (int) $msg['pmid'];
$msgInfo['content'] = (string) $tempMsg['content'];
$msgInfo['type'] = $tempMsg['type'];
$msgInfo['time'] = $msg['dateline'] . '000';
$msgList[] = $msgInfo;
}
}
return array('list' => $msgList, 'hasPrev' => $hasPrev, 'plid' => $plid);
}
示例7: userlogin
function userlogin($username, $password, $questionid, $answer, $loginfield = 'username')
{
$return = array();
if ($loginfield == 'uid') {
$isuid = 1;
} elseif ($loginfield == 'email') {
$isuid = 2;
} elseif ($loginfield == 'auto') {
$isuid = 3;
} else {
$isuid = 0;
}
if (!function_exists('uc_user_login')) {
loaducenter();
}
if ($isuid == 3) {
if (preg_match('/^[1-9]\\d*$/', $username)) {
$return['ucresult'] = uc_user_login($username, $password, 1, 1, $questionid, $answer);
} elseif (isemail($username)) {
$return['ucresult'] = uc_user_login($username, $password, 2, 1, $questionid, $answer);
}
if ($return['ucresult'][0] <= 0) {
$return['ucresult'] = uc_user_login($username, $password, 0, 1, $questionid, $answer);
}
} else {
$return['ucresult'] = uc_user_login($username, $password, $isuid, 1, $questionid, $answer);
}
$tmp = array();
$duplicate = '';
list($tmp['uid'], $tmp['username'], $tmp['password'], $tmp['email'], $duplicate) = daddslashes($return['ucresult'], 1);
$return['ucresult'] = $tmp;
if ($duplicate && $return['ucresult']['uid'] > 0) {
if ($olduid = DB::result_first("SELECT uid FROM " . DB::table('common_member') . " WHERE username='" . addslashes($return['ucresult']['username']) . "'")) {
require_once libfile('function/membermerge');
if ($olduid != $return['ucresult']['uid']) {
membermerge($olduid, $return['ucresult']['uid']);
}
uc_user_merge_remove($return['ucresult']['username']);
} else {
$return['status'] = 0;
return $return;
}
}
if ($return['ucresult']['uid'] <= 0) {
$return['status'] = 0;
return $return;
}
$member = DB::fetch_first("SELECT * FROM " . DB::table('common_member') . " WHERE uid='" . $return['ucresult']['uid'] . "'");
if (!$member) {
$return['status'] = -1;
return $return;
}
$return['member'] = $member;
$return['status'] = 1;
if (addslashes($member['email']) != $return['ucresult']['email']) {
DB::query("UPDATE " . DB::table('common_member') . " SET email='" . $return['ucresult']['email'] . "' WHERE uid='" . $return['ucresult']['uid'] . "'");
}
return $return;
}
示例8: sync4DX
/**
* 同步头像到指定的DZX uid,成功则执行一些更新后的操作
*
* @param integer $uid DZ uid
* @return integer 同步结果
*/
function sync4DX($uid)
{
loaducenter();
$result = $this->syncToUC($uid);
if ($result >= 0) {
$db = XWB_plugin::getDB();
$sql = "UPDATE " . DB::table('common_member') . " SET avatarstatus = '1' WHERE uid='{$uid}'";
$db->query($sql, 'UNBUFFERED');
}
$this->_logFaceSyncResult($result);
}
示例9: 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;
}
示例10: sendpm
public static function sendpm($toid, $subject, $message, $fromid = '', $replypmid = 0, $isusername = 0, $type = 0)
{
global $_G;
if ($fromid === '') {
$fromid = $_G['uid'];
}
$author = '';
if ($fromid) {
if ($fromid == $_G['uid']) {
$sendpmmaxnum = $_G['group']['allowsendpmmaxnum'];
$author = $_G['username'];
} else {
$user = getuserbyuid($fromid);
$author = $user['username'];
loadcache('usergroup_' . $user['groupid']);
$sendpmmaxnum = $_G['cache']['usergroup_' . $user['groupid']]['allowsendpmmaxnum'];
}
$currentnum = C::t('common_member_action_log')->count_day_hours(getuseraction('pmid'), $fromid);
if ($sendpmmaxnum && $currentnum >= $sendpmmaxnum) {
return -16;
}
}
loaducenter();
$return = uc_pm_send($fromid, $toid, addslashes($subject), addslashes($message), 1, $replypmid, $isusername, $type);
if ($return > 0 && $fromid) {
if ($_G['setting']['cloud_status']) {
$msgService = Cloud::loadClass('Cloud_Service_Client_Message');
if (is_numeric($toid)) {
$tospace = getuserbyuid($toid);
if ($tospace['conisbind']) {
$msgService->add($toid, $fromid, $author, $_G['timestamp']);
}
} else {
$senduids = array();
foreach (C::t('common_member')->fetch_all_by_username(explode(',', $toid)) as $touser) {
if ($touser['conisbind']) {
$senduids[$touser['uid']] = $touser['uid'];
}
}
if ($senduids) {
$msgService->add($senduids, $fromid, $author, $_G['timestamp']);
}
}
}
foreach (explode(',', $fromid) as $v) {
useractionlog($fromid, 'pmid');
}
}
return $return;
}
示例11: _getPmInfos
private function _getPmInfos($uid)
{
$pmInfos = array();
loaducenter();
$pmList = uc_pm_list($uid, 1, 10000, 'inbox', 'newpm', 200);
$pmList = (array) $pmList['data'];
foreach ($pmList as $pm) {
// 目前只要两人对话的列表
if ($pm['members'] > 2 || $pm['pmtype'] != 1) {
continue;
}
$pmInfos[] = array('fromUid' => (int) $pm['touid'], 'plid' => (int) $pm['plid'], 'pmid' => (int) $pm['pmid'], 'time' => $pm['lastdateline'] . '000');
}
return $pmInfos;
}
示例12: _uploadAvatarByUcenter
private function _uploadAvatarByUcenter($uid, $fileName, $fileData)
{
$image = '';
loaducenter();
$uc_avatarflash = uc_avatar($uid, 'virtual', 0);
if (!empty($uc_avatarflash[7])) {
$parse = parse_url($uc_avatarflash[7]);
if (!empty($parse['query'])) {
$url = sprintf('%s/index.php?m=user&a=uploadavatar&%s', UC_API, $parse['query']);
$res = WebUtils::httpRequestByDiscuzApi($url, array('Filedata' => $fileData), '', array('Filedata' => $fileName));
strpos($res, 'http') !== false && ($image = $res);
}
}
return $image;
}
示例13: _getPMList
private function _getPMList($page, $pageSize)
{
$pmList = array('list' => array(), 'count' => 0);
global $_G;
// 在DISCUZ_ROOT/source/include/space/space_pm.php基础上二次开发
loaducenter();
$filter = 'privatepm';
$perpage = $pageSize;
$count = 0;
$list = array();
if ($filter == 'privatepm' || $filter == 'newpm') {
$result = uc_pm_list($_G['uid'], $page, $perpage, 'inbox', $filter, 200);
$count = $result['count'];
$list = $result['data'];
}
if ($_G['member']['newpm']) {
if ($newpm && $_G['setting']['cloud_status']) {
$msgService = Cloud::loadClass('Cloud_Service_Client_Message');
$msgService->setMsgFlag($_G['uid'], $_G['timestamp']);
}
C::t('common_member')->update($_G['uid'], array('newpm' => 0));
uc_pm_ignore($_G['uid']);
}
$tempPMList = array();
foreach ($list as $pm) {
// 目前只要两人对话的列表
if ($pm['members'] > 2 || $pm['pmtype'] != 1) {
$count--;
continue;
}
$tempPm = array();
$tempPm['plid'] = (int) $pm['plid'];
$tempPm['pmid'] = (int) $pm['pmid'];
$tempPm['lastUserId'] = (int) $pm['lastauthorid'];
$tempPm['lastUserName'] = (string) $pm['lastauthor'];
$tempPm['lastSummary'] = (string) $pm['lastsummary'];
$tempPm['lastDateline'] = $pm['lastdateline'] . '000';
$tempPm['toUserId'] = (int) $pm['touid'];
$tempPm['toUserAvatar'] = UserUtils::getUserAvatar($pm['touid']);
$tempPm['toUserName'] = (string) $pm['tousername'];
$tempPm['toUserIsBlack'] = UserUtils::isBlacklist($_G['uid'], $pm['touid']) ? 1 : 0;
$tempPm['isNew'] = $pm['new'] ? 1 : 0;
$tempPMList[] = $tempPm;
}
$pmList['list'] = $tempPMList;
$pmList['count'] = $count;
return $pmList;
}
示例14: autoactivationuser
function autoactivationuser($uid)
{
global $_G;
$member = null;
if (!function_exists('uc_get_user')) {
loaducenter();
}
list($uid, $username, $email) = uc_get_user($uid, 1);
$uid = intval($uid);
if ($uid > 0) {
$password = md5(time() . rand(100000, 999999));
$userdata = array('uid' => $uid, 'username' => addslashes($username), 'password' => $password, 'email' => $email, 'adminid' => 0, 'groupid' => 0, 'regdate' => TIMESTAMP, 'credits' => 0);
DB::insert('common_member', $userdata);
$status_data = array('uid' => $uid, 'regip' => $_G['clientip'], 'lastip' => $_G['clientip'], 'lastvisit' => TIMESTAMP, 'lastactivity' => TIMESTAMP);
DB::insert('common_member_status', $status_data);
$member = $userdata;
}
return $member;
}
示例15: verify
/**
* 进行身份验证
* 请保证传参所用字符集和论坛字符集一致,否则请先自行转换再传参
* @param string $username
* @param string $password
* @param int $questionid
* @param string $answer
* @param boolen $isuid 使用UID验证么?
* @return array
* 第一个数组下标($return[0])若大于0,则表示验证成功的登录uid。否则为错误信息:
* -1:UC用户不存在,或者被删除
* -2:密码错
* -3:安全提问错
* -4:用户没有在dz注册
* 第二个数组下标($return[1])若大于等于0,则表示验证成功的adminid;
* 否则为-1,表示验证失败
*/
function verify($username, $password, $questionid = '', $answer = '', $isuid = 0)
{
$return = array(0 => -1, 1 => -1);
loaducenter();
$ucresult = uc_user_login($username, $password, $isuid, 1, $questionid, $answer);
if ($ucresult[0] < 1) {
$return[0] = $ucresult[0];
} else {
$uid = (int) $ucresult[0];
$member = $this->db->fetch_first("SELECT uid, username, adminid\n\t\t\t\t\t\t\t\t\t\t\t\tFROM " . DB::table('common_member') . " \n\t\t\t\t\t\t\t\t\t\t\t\tWHERE uid='{$uid}'");
if (!$member) {
$return[0] = -4;
} else {
$return[0] = (int) $member['uid'];
$return[1] = (int) $member['adminid'];
}
}
return $return;
}