本文整理汇总了PHP中friend_cache函数的典型用法代码示例。如果您正苦于以下问题:PHP friend_cache函数的具体用法?PHP friend_cache怎么用?PHP friend_cache使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了friend_cache函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addslashes
$pokes[] = "('{$newuid}','{$value['uid']}','{$value['username']}','" . addslashes($_SCONFIG['defaultpoke']) . "','{$_SGLOBAL['timestamp']}')";
//添加好友变更记录
$flog[] = "('{$value['uid']}','{$newuid}','add','{$_SGLOBAL['timestamp']}')";
}
if ($inserts) {
$_SGLOBAL['db']->query("REPLACE INTO " . tname('friend') . " (uid,fuid,fusername,status,dateline) VALUES " . implode(',', $inserts));
$_SGLOBAL['db']->query("REPLACE INTO " . tname('poke') . " (uid,fromuid,fromusername,note,dateline) VALUES " . implode(',', $pokes));
$_SGLOBAL['db']->query("REPLACE INTO " . tname('friendlog') . " (uid,fuid,action,dateline) VALUES " . implode(',', $flog));
//添加到附加表
$friendstr = empty($fuids) ? '' : implode(',', $fuids);
updatetable('space', array('friendnum' => count($fuids), 'pokenum' => count($pokes)), array('uid' => $newuid));
updatetable('spacefield', array('friend' => $friendstr, 'feedfriend' => $friendstr), array('uid' => $newuid));
//更新默认用户好友缓存
include_once S_ROOT . './source/function_cp.php';
foreach ($fuids as $fuid) {
friend_cache($fuid);
}
}
}
}
//在线session
insertsession($setarr);
//设置cookie
ssetcookie('auth', authcode("{$setarr['password']}\t{$setarr['uid']}", 'ENCODE'), 2592000);
ssetcookie('loginuser', $username, 31536000);
ssetcookie('_refer', '');
//好友邀请
if ($invitearr) {
include_once S_ROOT . './source/function_cp.php';
invite_update($invitearr['id'], $setarr['uid'], $setarr['username'], $invitearr['uid'], $invitearr['username'], $app);
//如果提交的邮箱地址与邀请相符的则直接通过邮箱验证
示例2: friend_update
function friend_update($uid, $username, $fuid, $fusername, $op='add', $gid=0) {
global $_SGLOBAL, $_SCONFIG;
if(empty($uid) || empty($fuid) || $uid == $fuid) return false;
$flog = array(
'uid' => $uid > $fuid ? $uid : $fuid,
'fuid' => $uid > $fuid ? $fuid : $uid,
'dateline' => $_SGLOBAL['timestamp']
);
//好友状态
if($op == 'add' || $op == 'invite') {
//自己
inserttable('friend', array('uid'=>$uid, 'fuid'=>$fuid, 'fusername'=>$fusername, 'status'=>1, 'gid'=>$gid, 'dateline'=>$_SGLOBAL['timestamp']), 0, true);
//对方更新
if($op == 'invite') {
//邀请模式
inserttable('friend', array('uid'=>$fuid, 'fuid'=>$uid, 'fusername'=>$username, 'status'=>1, 'dateline'=>$_SGLOBAL['timestamp']), 0, true);
} else {
updatetable('friend', array('status'=>1, 'dateline'=>$_SGLOBAL['timestamp']), array('uid'=>$fuid, 'fuid'=>$uid));
}
//用户中心添加
if($_SCONFIG['uc_status']) {
include_once S_ROOT.'./uc_client/client.php';
uc_friend_add($uid, $fuid);
uc_friend_add($fuid, $uid);
}
$flog['action'] = 'add';
} else {
//删除
$_SGLOBAL['db']->query("DELETE FROM ".tname('friend')." WHERE (uid='$uid' AND fuid='$fuid') OR (uid='$fuid' AND fuid='$uid')");
//从用户中心删除
if($_SCONFIG['uc_status']) {
include_once S_ROOT.'./uc_client/client.php';
uc_friend_delete($uid, array($fuid));
uc_friend_delete($fuid, array($uid));
}
$flog['action'] = 'delete';
}
if($_SCONFIG['my_status']) inserttable('friendlog', $flog, 0, true);
//缓存
friend_cache($uid);
friend_cache($fuid);
}
示例3: showmessage
showmessage('do_success', $_POST['refer']);
}
} elseif ($op == 'groupignore') {
$groups = getfriendgroup();
$group = intval($_GET['group']);
if (!isset($groups[$group])) {
showmessage('change_friend_groupname_error');
}
if (submitcheck('groupignoresubmit')) {
if (isset($space['privacy']['filter_gid'][$group])) {
unset($space['privacy']['filter_gid'][$group]);
} else {
$space['privacy']['filter_gid'][$group] = $group;
}
privacy_update();
friend_cache($_SGLOBAL['supe_uid']);
//缓存更新
showmessage('do_success', $_POST['refer'], 0);
}
} elseif ($op == 'blacklist') {
if ($_GET['subop'] == 'delete') {
$_GET['uid'] = intval($_GET['uid']);
$_SGLOBAL['db']->query("DELETE FROM " . tname('blacklist') . " WHERE uid='{$space['uid']}' AND buid='{$_GET['uid']}'");
showmessage('do_success', "space.php?do=friend&view=blacklist&start={$_GET['start']}", 0);
}
if (submitcheck('blacklistsubmit')) {
$_POST['username'] = trim($_POST['username']);
$query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('space') . " WHERE username='{$_POST['username']}'");
if (!($tospace = $_SGLOBAL['db']->fetch_array($query))) {
showmessage('space_does_not_exist');
}
示例4: array
}
$friendfans2 = '我的好友';
$friendlist2 = array();
$friendnumquery2 = $_SGLOBAL['db']->query("SELECT count(x.uid) FROM " . tname('friend') . " x , " . tname('space') . " y WHERE x.uid='{$space['uid']}' AND x.fuid = y.uid AND x.status='1' ORDER BY x.num DESC, x.dateline DESC");
$friendnumarray2 = mysql_fetch_array($friendnumquery2);
$friendnum2 = $friendnumarray2['0'];
$query = $_SGLOBAL['db']->query("SELECT x.* , y.* FROM " . tname('friend') . " x , " . tname('space') . " y WHERE x.uid='{$space['uid']}' AND x.fuid = y.uid AND y.groupid != 3 AND x.status='1' ORDER BY x.num DESC, x.dateline DESC LIMIT 0,6");
while ($value = $_SGLOBAL['db']->fetch_array($query)) {
realname_set($value['fuid'], $value['fusername']);
$oluids[$value['fuid']] = $value['fuid'];
$friendlist2[] = $value;
}
if ($friendlist2 && empty($space['friendnum'])) {
//자채ᅮᄏᄎᄡ₩
include_once S_ROOT . './source/function_cp.php';
friend_cache($space['uid']);
}
}
/*
if($_SGLOBAL['mygroupid']==3||ckprivacy('friend')) {
$friendfans = '我的粉丝';
$query = $_SGLOBAL['db']->query("SELECT * FROM ".tname('friend')." WHERE uid='$space[uid]' AND status='1' ORDER BY num DESC, dateline DESC LIMIT 0,6");
while ($value = $_SGLOBAL['db']->fetch_array($query)) {
realname_set($value['fuid'], $value['fusername']);
$oluids[$value['fuid']] = $value['fuid'];
$friendlist[] = $value;
}
if($friendlist && empty($space['friendnum'])) {
//자채ᅮᄏᄎᄡ₩
include_once(S_ROOT.'./source/function_cp.php');
friend_cache($space['uid']);
示例5: array
}
$space['privacy']['filter_gid'] = array();
if (isset($_POST['privacy']['filter_gid'])) {
foreach ($_POST['privacy']['filter_gid'] as $key => $value) {
$space['privacy']['filter_gid'][$key] = intval($value);
}
}
$space['privacy']['filter_note'] = array();
if (isset($_POST['privacy']['filter_note'])) {
foreach ($_POST['privacy']['filter_note'] as $key => $value) {
$space['privacy']['filter_note'][$key] = 1;
}
}
privacy_update();
require_once libfile('function/friend');
friend_cache($_G['uid']);
showmessage('do_success', 'home.php?mod=spacecp&ac=privacy&op=' . $operation);
}
if ($operation == 'filter') {
require_once libfile('function/friend');
$groups = friend_group_list();
$filter_icons = empty($space['privacy']['filter_icon']) ? array() : $space['privacy']['filter_icon'];
$filter_note = empty($space['privacy']['filter_note']) ? array() : $space['privacy']['filter_note'];
$iconnames = $appids = $icons = $uids = $users = array();
foreach ($filter_icons as $key => $value) {
list($icon, $uid) = explode('|', $key);
$icons[$key] = $icon;
$uids[$key] = $uid;
if (is_numeric($icon)) {
$appids[$key] = $icon;
}
示例6: friend_delete
function friend_delete($touid)
{
global $_G;
if (!friend_check($touid)) {
return false;
}
DB::delete('home_friend', "(uid='{$_G['uid']}' AND fuid='{$touid}') OR (fuid='{$_G['uid']}' AND uid='{$touid}')");
if (DB::affected_rows()) {
addfriendlog($_G['uid'], $touid, 'delete');
friend_cache($_G['uid']);
friend_cache($touid);
}
}
示例7: regiter_user_to_uchome
function regiter_user_to_uchome()
{
global $_SCONFIG, $_SGLOBAL, $_SN, $openid_identifier, $setarr, $email, $username, $newuid;
// echo var_dump($_SCONFIG)."--_SCONFIG<br/>";
// echo var_dump($_SGLOBAL)."--_SGLOBAL<br/>";
// echo var_dump($setarr)."--setarr<br/>";
$invitearr = $_SESSION['invitearr'];
//从会话里将已有帐户登录时的邀请信息取出,不用从通行证返回信息里取
$url_plus = $_SESSION['url_plus'];
//从会话里将已有帐户登录时的邀请信息取出,不用从通行证返回信息里取
$app = $_SESSION['app'];
//从会话里将已有帐户登录时的邀请信息取出,不用从通行证返回信息里取
$_SN = $_SESSION['SN'];
//从会话里取出后边要用的这个变量
// echo var_dump($invitearr)."--invitearr<br>";
// echo var_dump($url_plus)."--url_plus<br>";
// echo var_dump($app)."--app<br>";
// echo var_dump($_SN)."--_SN1<br>";
// echo var_dump($_SESSION['jumpurl'])."--_SESSION['jumpurl']<br/>";
//开通空间
// echo var_dump($_SGLOBAL['db'])."--_SGLOBAL['db']<br/>";
$query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('space') . " WHERE uid='{$setarr['uid']}'");
// echo var_dump($query)."--query<br/>";
include S_ROOT . './source/function_space.php';
if (!($space = $_SGLOBAL['db']->fetch_array($query))) {
$space = space_open($setarr['uid'], $setarr['username'], 0, $email);
}
// echo var_dump($space)."--space<br/>";
// breakpoint();
$_SGLOBAL['member'] = $space;
// echo var_dump($_SGLOBAL['member'])."--_SGLOBAL['member']<br/>";
//实名
realname_set($space['uid'], $space['username'], $space['name'], $space['namestatus']);
//这里$_SN再次被赋值
// echo var_dump($_SN)."--_SNn2<br>";
//检索当前用户
$query = $_SGLOBAL['db']->query("SELECT password FROM " . tname('member') . " WHERE uid='{$setarr['uid']}'");
if ($value = $_SGLOBAL['db']->fetch_array($query)) {
$setarr['password'] = addslashes($value['password']);
} else {
//更新本地用户库
inserttable('member', $setarr, 0, true);
}
// 关联uid和openid
//$db->query("INSERT INTO {$tablepre}user_openids VALUES (null,$newuid,'$openid_identifier')");//openid自带的db链接
$openids = array('uid' => $setarr['uid'], 'url' => $openid_identifier);
inserttable('user_openids', $openids, 0, true);
//uchome的db链接
// showmessage($openidlang['msg_bind_ok'],$plugin_url);//绑定成功
//默认好友
$flog = $inserts = $fuids = $pokes = array();
echo var_dump($_SCONFIG['defaultfusername']) . "--_SCONFIG['defaultfusername']<br/>";
if (!empty($_SCONFIG['defaultfusername'])) {
$query = $_SGLOBAL['db']->query("SELECT uid,username FROM " . tname('space') . " WHERE username IN (" . simplode(explode(',', $_SCONFIG['defaultfusername'])) . ")");
while ($value = $_SGLOBAL['db']->fetch_array($query)) {
$value = saddslashes($value);
$fuids[] = $value['uid'];
$inserts[] = "('{$newuid}','{$value['uid']}','{$value['username']}','1','{$_SGLOBAL['timestamp']}')";
//$inserts[] = "('$value[uid]','$newuid','$username','1','$_SGLOBAL[timestamp]')";
$inserts[] = "('{$value['uid']}','{$newuid}','{$setarr['username']}','1','{$_SGLOBAL['timestamp']}')";
$pokes[] = "('{$newuid}','{$value['uid']}','{$value['username']}','" . addslashes($_SCONFIG['defaultpoke']) . "','{$_SGLOBAL['timestamp']}')";
//添加好友变更记录
$flog[] = "('{$value['uid']}','{$newuid}','add','{$_SGLOBAL['timestamp']}')";
}
/////////
if ($inserts) {
$_SGLOBAL['db']->query("REPLACE INTO " . tname('friend') . " (uid,fuid,fusername,status,dateline) VALUES " . implode(',', $inserts));
$_SGLOBAL['db']->query("REPLACE INTO " . tname('poke') . " (uid,fromuid,fromusername,note,dateline) VALUES " . implode(',', $pokes));
$_SGLOBAL['db']->query("REPLACE INTO " . tname('friendlog') . " (uid,fuid,action,dateline) VALUES " . implode(',', $flog));
//添加到附加表
$friendstr = empty($fuids) ? '' : implode(',', $fuids);
updatetable('space', array('friendnum' => count($fuids), 'pokenum' => count($pokes)), array('uid' => $newuid));
updatetable('spacefield', array('friend' => $friendstr, 'feedfriend' => $friendstr), array('uid' => $newuid));
//更新默认用户好友缓存
include_once S_ROOT . './source/function_cp.php';
foreach ($fuids as $fuid) {
friend_cache($fuid);
}
}
}
//清理在线session
insertsession($setarr);
//设置cookie
ssetcookie('auth', authcode("{$setarr['password']}\t{$setarr['uid']}", 'ENCODE'), 2592000);
ssetcookie('loginuser', $username, 31536000);
ssetcookie('_refer', '');
// echo var_dump($invitearr)."--invitearr<br/>";
//好友邀请
if ($invitearr) {
//成为好友
invite_update($invitearr['id'], $setarr['uid'], $setarr['username'], $invitearr['uid'], $invitearr['username'], $app);
//统计更新
include_once S_ROOT . './source/function_cp.php';
if ($app) {
updatestat('appinvite');
} else {
updatestat('invite');
}
}
$_SGLOBAL['supe_uid'] = $space['uid'];
//.........这里部分代码省略.........
示例8: friend_delete
function friend_delete($touid)
{
global $_G;
if (!friend_check($touid)) {
return false;
}
C::t('home_friend')->delete_by_uid_fuid_dual($_G['uid'], $touid);
if (DB::affected_rows()) {
addfriendlog($_G['uid'], $touid, 'delete');
friend_cache($_G['uid']);
friend_cache($touid);
}
}
示例9: quickregister_interface
//.........这里部分代码省略.........
$sqladd .= " secques='',";
$_SGLOBAL['db']->query("INSERT INTO ihomeuser_members SET {$sqladd} username='{$username}', password='{$hhpassword}', email='{$email}', regip='" . $_SERVER["HTTP_X_FORWARDED_FOR"] . "', regdate='" . time() . "', salt='{$salt}'");
$_SGLOBAL['db']->query("INSERT INTO ihomeuser_memberfields SET uid='{$newuid}'");
}
$setarr = array('uid' => $newuid, 'username' => $username, 'password' => md5($password));
inserttable('member', $setarr, 0, true);
//add action log
inserttable('actionlog', array('uid' => "{$newuid}", 'dateline' => "{$_SGLOBAL['timestamp']}", 'action' => 'register', 'value' => 'quick'));
include_once S_ROOT . './source/function_space.php';
$space = space_open($newuid, $username, 0, $email);
//默认好友
$flog = $inserts = $fuids = $pokes = array();
if (!empty($_SCONFIG['defaultfusername'])) {
$query = $_SGLOBAL['db']->query("SELECT uid,username FROM " . tname('space') . " WHERE\tusername IN (" . simplode(explode(',', $_SCONFIG['defaultfusername'])) . ")");
while ($value = $_SGLOBAL['db']->fetch_array($query)) {
$value = saddslashes($value);
$fuids[] = $value['uid'];
$inserts[] = "('{$newuid}','{$value['uid']}','{$value['username']}','1','{$_SGLOBAL['timestamp']}')";
$inserts[] = "('{$value['uid']}','{$newuid}','{$username}','1','{$_SGLOBAL['timestamp']}')";
$pokes[] = "('{$newuid}','{$value['uid']}','{$value['username']}','" . addslashes($_SCONFIG['defaultpoke']) . "','{$_SGLOBAL['timestamp']}')";
$flog[] = "('{$value['uid']}','{$newuid}','add','{$_SGLOBAL['timestamp']}')";
}
if ($inserts) {
$_SGLOBAL['db']->query("REPLACE INTO " . tname('friend') . " (uid,fuid,fusername,status,dateline) VALUES " . implode(',', $inserts));
$_SGLOBAL['db']->query("REPLACE INTO " . tname('poke') . " (uid,fromuid,fromusername,note,dateline) VALUES " . implode(',', $pokes));
$_SGLOBAL['db']->query("REPLACE INTO " . tname('friendlog') . " (uid,fuid,action,dateline) VALUES " . implode(',', $flog));
//添加到附加表
$friendstr = empty($fuids) ? '' : implode(',', $fuids);
updatetable('space', array('friendnum' => count($fuids), 'pokenum' => count($pokes)), array('uid' => $newuid));
updatetable('spacefield', array('friend' => $friendstr, 'feedfriend' => $friendstr), array('uid' => $newuid));
//更新默认用户好友缓存
include_once S_ROOT . '../source/function_cp.php';
foreach ($fuids as $fuid) {
friend_cache($fuid);
}
}
}
//好友邀请
if ($invitearr) {
include_once S_ROOT . '../source/function_cp.php';
invite_update($invitearr['id'], $setarr['uid'], $setarr['username'], $invitearr['uid'], $invitearr['username'], $app);
//如果提交的邮箱地址与邀请相符的则直接通过邮箱验证
if ($invitearr['email'] == $email) {
updatetable('spacefield', array('emailcheck' => 1), array('uid' => $newuid));
}
//统计更新
include_once S_ROOT . '../source/function_cp.php';
if ($app) {
updatestat('appinvite');
} else {
updatestat('invite');
}
}
//标记为已激活,并反写uid
if ($recordids) {
$useridlist = implode(',', $recordids);
$_SGLOBAL['db']->query("UPDATE " . tname('baseprofile') . " SET isactive=1, uid={$newuid} WHERE userid in ({$useridlist})");
}
$insertinfo = array('identifier' => $one['identifier'], 'realname' => $realname, 'defaultemail' => $one['defaultemail']);
//获得用户生日数据
//$decid = M_decode($value['identifier'], aeskeyA);
$UserBirthday = '';
if ($birthday_id) {
$UserBirthday = $birthday_id;
} elseif ($birthday_exist) {
$UserBirthday = $birthday_exist;