本文整理汇总了PHP中ckprivacy函数的典型用法代码示例。如果您正苦于以下问题:PHP ckprivacy函数的具体用法?PHP ckprivacy怎么用?PHP ckprivacy使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ckprivacy函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getblockhtml
//.........这里部分代码省略.........
$html .= '<p class="mbm xw1">';
if (empty($parameters['banviews'])) {
$html .= lang('space', 'space_views', array('views' => $space['views'] ? $space['views'] : '--'));
}
$html .= '</p><ul class="xl xl2 cl">';
if (empty($parameters['bancredits'])) {
$html .= "<li>" . lang('space', 'credits') . ': <a href="home.php?mod=spacecp&ac=credit">' . ($space['credits'] ? $space['credits'] : '--') . "</a></li>";
foreach ($_G['setting']['extcredits'] as $extcreditid => $extcredit) {
$html .= "<li>" . ($extcredit['img'] ? $extcredit['img'] . ' ' : '') . $extcredit['title'] . ': <a href="home.php?mod=spacecp&ac=credit">' . ($space['extcredits' . $extcreditid] ? $space['extcredits' . $extcreditid] : '--') . '</a>';
}
}
if (empty($parameters['banfriends'])) {
$html .= "<li>" . lang('space', 'friends') . ': <a href="home.php?mod=space&uid=' . $uid . '&do=friend&view=me&from=space">' . ($space['friends'] ? $space['friends'] : '--') . "</a></li>";
}
if (empty($parameters['banthreads']) && $_G['setting']['allowviewuserthread'] !== -1 || $_G['adminid'] == 1) {
$html .= "<li>" . lang('space', 'threads') . ': <a href="home.php?mod=space&uid=' . $uid . '&do=thread&view=me&from=space">' . ($space['threads'] ? $space['threads'] : '--') . "</a></li>";
}
if (empty($parameters['banblogs'])) {
$html .= "<li>" . lang('space', 'blogs') . ': <a href="home.php?mod=space&uid=' . $uid . '&do=blog&view=me&from=space">' . ($space['blogs'] ? $space['blogs'] : '--') . "</a></li>";
}
if (empty($parameters['banalbums'])) {
$html .= "<li>" . lang('space', 'albums') . ': <a href="home.php?mod=space&uid=' . $uid . '&do=album&view=me&from=space">' . ($space['albums'] ? $space['albums'] : '--') . "</a></li>";
}
if (empty($parameters['bansharings'])) {
$html .= "<li>" . lang('space', 'sharings') . ': <a href="home.php?mod=space&uid=' . $uid . '&do=share&view=me&from=space">' . ($space['sharings'] ? $space['sharings'] : '--') . "</a></li>";
}
$html .= '</ul>';
$html = '<div>' . $html . '</div>';
break;
case 'doing':
$do = $blockname;
$view = 'me';
$from = 'space';
if (ckprivacy('doing', 'view')) {
$dolist = array();
$query = C::t('home_doing')->fetch_all_by_uid_doid(array($uid), '', 'dateline', 0, $shownum, false, true);
foreach ($query as $value) {
if ($value['status'] == 0 || $value['uid'] == $_G['uid']) {
$dolist[] = $value;
}
}
if ($dolist) {
foreach ($dolist as $dv) {
$doid = $dv['doid'];
$_GET[key] = $key = random(8);
$html .= "<li class=\"pbn bbda\">";
$html .= $dv['message'];
$html .= " <a href=\"home.php?mod=space&uid={$dv['uid']}&do=doing&view=me&from=space&doid={$dv['doid']}\" target=\"_blank\" class=\"xg1\">" . lang('space', 'block_doing_reply') . "</a>";
$html .= "</li>";
}
} else {
$html .= "<p class=\"emp\">" . lang('space', 'block_doing_no_content') . ($space['self'] ? lang('space', 'block_doing_no_content_publish', $space) : '') . "</p>";
}
} else {
$html .= "<p class=\"emp\">" . lang('space', 'block_view_noperm') . "</p>";
}
$html = '<ul class="xl">' . $html . '</ul>';
break;
case 'stickblog':
space_merge($space, 'profile');
$stickblogs = explode(',', $space['stickblogs']);
if (!empty($stickblogs)) {
$bids = array_slice($stickblogs, 0, $shownum);
if (count($bids)) {
if (!isset($parameters['showmessage'])) {
$parameters['showmessage'] = 150;
示例2: template
} else {
include_once template('cp_friend');
exit;
}
} else {
showmessage('waiting_for_the_other_test');
}
} else {
//对方加了我为好友,我审核通过
if (submitcheck('add2submit')) {
//成为好友
$gid = intval($_POST['gid']);
friend_update($space['uid'], $space['username'], $tospace['uid'], $tospace['username'], 'add', $gid);
//事件发布
//加好友不发布事件
if (ckprivacy('friend', 1)) {
$fs = array();
$fs['icon'] = 'friend';
$fs['title_template'] = cplang('feed_friend_title');
$fs['title_data'] = array('touser' => "<a href=\"space.php?uid={$tospace['uid']}\">" . $_SN[$tospace['uid']] . "</a>");
$fs['body_template'] = '';
$fs['body_data'] = array();
$fs['body_general'] = '';
feed_add($fs['icon'], $fs['title_template'], $fs['title_data'], $fs['body_template'], $fs['body_data'], $fs['body_general']);
}
//我的好友申请数进行变化
$_SGLOBAL['db']->query("UPDATE " . tname('space') . " SET addfriendnum=addfriendnum-1 WHERE uid='{$space['uid']}' AND addfriendnum>0");
//通知
notification_add($uid, 'friend', cplang('note_friend_add'));
showmessage('friends_add', $_POST['refer'], 1, array($_SN[$tospace['uid']]));
} else {
示例3: json_decode
$flink = json_decode($fresult['flink'], true);
}
}
//ᅯᄚ¥
$walllist = array();
if ($_SGLOBAL['mygroupid'] == 3 || ckprivacy('wall')) {
$query_sql = "SELECT * FROM " . tname('comment') . " WHERE ((id={$space['uid']} AND secret='on' AND authorid={$_SGLOBAL['supe_uid']}) OR (id={$space['uid']} AND secret='on' AND id={$_SGLOBAL['supe_uid']}) OR (id={$space['uid']} AND secret!='on') AND idtype='uid') ORDER BY dateline DESC LIMIT 0,5";
$query = $_SGLOBAL['db']->query($query_sql);
while ($value = $_SGLOBAL['db']->fetch_array($query)) {
realname_set($value['authorid'], $value['author']);
$value['message'] = strlen($value['message']) > 500 ? getstr($value['message'], 500, 0, 0, 0, 0, -1) . ' ...' : $value['message'];
$walllist[] = $value;
}
}
$mywalllist = array();
if ($_SGLOBAL['mygroupid'] == 3 || ckprivacy('wall')) {
$query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('comment') . " WHERE authorid='{$space['uid']}' AND idtype='uid' ORDER BY dateline DESC LIMIT 0,12");
while ($value = $_SGLOBAL['db']->fetch_array($query)) {
realname_set($value['authorid'], $value['author']);
$value['message'] = strlen($value['message']) > 500 ? getstr($value['message'], 500, 0, 0, 0, 0, -1) . ' ...' : $value['message'];
$mywalllist[] = $value;
}
}
//ᅧᅦ워ᅳᅬ
$query = $_SGLOBAL['db']->query('SELECT * FROM ' . tname('session') . " WHERE uid = '{$space['uid']}'");
$value = $_SGLOBAL['db']->fetch_array($query);
$isonline = empty($value) || $value['magichidden'] ? 0 : sgmdate('H:i:s', $value['lastactivity'], 1);
//ᄋᄌ
$theme = empty($_GET['theme']) ? '' : preg_replace("/[^0-9a-z]/i", '', $_GET['theme']);
if ($theme == 'uchomedefault') {
$_SGLOBAL['space_theme'] = $_SGLOBAL['space_css'] = '';
示例4: empty
$is_anonymous = empty($_G['cookie']['anonymous_visit_' . $_G['uid'] . '_' . $space['uid']]) ? 0 : 1;
if (empty($visitor['dateline'])) {
$setarr = array('uid' => $space['uid'], 'vuid' => $_G['uid'], 'vusername' => $is_anonymous ? '' : $_G['username'], 'dateline' => $_G['timestamp']);
DB::insert('home_visitor', $setarr, 0, true);
show_credit();
} else {
if ($_G['timestamp'] - $visitor['dateline'] >= 300) {
DB::update('home_visitor', array('dateline' => $_G['timestamp'], 'vusername' => $is_anonymous ? '' : $_G['username']), array('uid' => $space['uid'], 'vuid' => $_G['uid']));
}
if ($_G['timestamp'] - $visitor['dateline'] >= 3600) {
show_credit();
}
}
updatecreditbyaction('visit', 0, array(), $space['uid']);
}
if ($do != 'profile' && !ckprivacy($do, 'view')) {
$_G['privacy'] = 1;
require_once libfile('space/profile', 'include');
include template('home/space_privacy');
exit;
}
$widths = getlayout($userdiy['currentlayout']);
$leftlist = formatdata($userdiy, 'left', $space);
$centerlist = formatdata($userdiy, 'center', $space);
$rightlist = formatdata($userdiy, 'right', $space);
dsetcookie('home_diymode', 1);
}
$navtitle = !empty($space['spacename']) ? $space['spacename'] : lang('space', 'sb_space', array('who' => $space['username']));
$metakeywords = lang('space', 'sb_space', array('who' => $space['username']));
$metadescription = lang('space', 'sb_space', array('who' => $space['username']));
$space['medals'] = getuserprofile('medals');
示例5: getblockhtml
//.........这里部分代码省略.........
case 'statistic':
space_merge($space, 'count');
$html .= '<p class="mbm xw1">';
if (empty($parameters['banviews'])) {
$html .= lang('space', 'space_views', array('views' => $space['views'] ? $space['views'] : '--'));
}
$html .= '</p><ul class="xl xl2 cl">';
if (empty($parameters['bancredits'])) {
$html .= "<li>" . lang('space', 'credits') . ': <a href="home.php?mod=spacecp&ac=credit">' . ($space['credits'] ? $space['credits'] : '--') . "</a></li>";
foreach ($_G['setting']['extcredits'] as $extcreditid => $extcredit) {
$html .= "<li>" . $extcredit['img'] . $extcredit['title'] . ': <a href="home.php?mod=spacecp&ac=credit">' . ($space['extcredits' . $extcreditid] ? $space['extcredits' . $extcreditid] : '--') . '</a>';
}
}
if (empty($parameters['banfriends'])) {
$html .= "<li>" . lang('space', 'friends') . ': <a href="home.php?mod=space&uid=' . $uid . '&do=friend&view=me&from=space">' . ($space['friends'] ? $space['friends'] : '--') . "</a></li>";
}
if (empty($parameters['banthreads']) && $_G['setting']['allowviewuserthread'] !== false || $_G['adminid'] == 1) {
$html .= "<li>" . lang('space', 'threads') . ': <a href="home.php?mod=space&uid=' . $uid . '&do=thread&view=me&from=space">' . ($space['threads'] ? $space['threads'] : '--') . "</a></li>";
}
if (empty($parameters['banblogs'])) {
$html .= "<li>" . lang('space', 'blogs') . ': <a href="home.php?mod=space&uid=' . $uid . '&do=blog&view=me&from=space">' . ($space['blogs'] ? $space['blogs'] : '--') . "</a></li>";
}
if (empty($parameters['banalbums'])) {
$html .= "<li>" . lang('space', 'albums') . ': <a href="home.php?mod=space&uid=' . $uid . '&do=album&view=me&from=space">' . ($space['albums'] ? $space['albums'] : '--') . "</a></li>";
}
if (empty($parameters['bansharings'])) {
$html .= "<li>" . lang('space', 'sharings') . ': <a href="home.php?mod=space&uid=' . $uid . '&do=share&view=me&from=space">' . ($space['sharings'] ? $space['sharings'] : '--') . "</a></li>";
}
$html .= '</ul>';
$html = '<div id="pcd">' . $html . '</div>';
break;
case 'doing':
$do = $blockname;
if (ckprivacy('doing', 'view')) {
$dolist = array();
$sql = "SELECT * FROM " . DB::table('home_doing') . " WHERE uid='{$uid}' ORDER BY dateline DESC LIMIT 0,{$shownum}";
$query = DB::query($sql);
while ($value = DB::fetch($query)) {
if ($value['status'] == 0 || $value['uid'] == $_G['uid']) {
$dolist[] = $value;
}
}
if ($dolist) {
foreach ($dolist as $dv) {
$doid = $dv['doid'];
$_G[gp_key] = $key = random(8);
$html .= "<li class=\"pbn bbda\">";
$html .= $dv['message'];
$html .= " <a href=\"home.php?mod=space&uid={$dv['uid']}&do=doing&view=me&from=space&doid={$dv['doid']}\" target=\"_blank\" class=\"xg1\">" . lang('space', 'block_doing_reply') . "</a>";
$html .= "</li>";
}
} else {
$html .= "<p class=\"emp\">" . lang('space', 'block_doing_no_content') . "</p>";
}
} else {
$html .= "<p class=\"emp\">" . lang('space', 'block_view_noperm') . "</p>";
}
$html = '<ul class="xl">' . $html . '</ul>';
break;
case 'blog':
$do = $blockname;
$query = DB::query("SELECT bf.*, b.* FROM " . DB::table('home_blog') . " b\r\n\t\t\t\tLEFT JOIN " . DB::table('home_blogfield') . " bf ON bf.blogid=b.blogid\r\n\t\t\t\tWHERE b.uid='{$uid}'\r\n\t\t\t\tORDER BY b.dateline DESC LIMIT 0,{$shownum}");
while ($value = DB::fetch($query)) {
if (ckfriend($value['uid'], $value['friend'], $value['target_ids'])) {
if ($value['pic']) {
$value['pic'] = pic_cover_get($value['pic'], $value['picflag']);
示例6: getstr
}
}
$magvalues['type'] = $commentcable[$type];
}
$arr['body_general'] = getstr($_POST['general'], 150, 1, 1, 1);
$arr['body_general'] = censor($arr['body_general']);
if (censormod($arr['body_general']) || $_G['group']['allowsharemod']) {
$arr['status'] = 1;
} else {
$arr['status'] = 0;
}
$arr['type'] = $type;
$arr['uid'] = $_G['uid'];
$arr['username'] = $_G['username'];
$arr['dateline'] = $_G['timestamp'];
if ($arr['status'] == 0 && ckprivacy('share', 'feed')) {
require_once libfile('function/feed');
feed_add('share', '{actor} ' . $arr['title_template'], array('hash_data' => $feed_hash_data), $arr['body_template'], $arr['body_data'], $arr['body_general'], array($arr['image']), array($arr['image_link']));
}
$arr['body_data'] = serialize($arr['body_data']);
$setarr = daddslashes($arr);
$sid = DB::insert('home_share', $setarr, 1);
switch ($type) {
case 'space':
DB::query("UPDATE " . DB::table('common_member_status') . " SET sharetimes=sharetimes+1 WHERE uid='{$id}'");
break;
case 'blog':
DB::query("UPDATE " . DB::table('home_blog') . " SET sharetimes=sharetimes+1 WHERE blogid='{$id}'");
break;
case 'album':
DB::query("UPDATE " . DB::table('home_album') . " SET sharetimes=sharetimes+1 WHERE albumid='{$id}'");
示例7: array
$fs['title_data'] = array('touser' => "<a href=\"space.php?uid={$item['uid']}\">{$_SN[$item['uid']]}</a>", 'subject' => "<a href=\"space.php?uid={$item['uid']}&do=thread&id={$item['tid']}\">{$item['subject']}</a>", 'click' => $click['name']);
$note_type = 'clickthread';
$q_note = cplang('note_click_thread', array("space.php?uid={$item['uid']}&do=thread&id={$item['tid']}", $item['subject']));
break;
case 'picid':
$fs['title_template'] = cplang('feed_click_pic');
$fs['title_data'] = array('touser' => "<a href=\"space.php?uid={$item['uid']}\">{$_SN[$item['uid']]}</a>", 'click' => $click['name']);
$fs['images'] = array(pic_get($item['filepath'], $item['thumb'], $item['remote']));
$fs['image_links'] = array("space.php?uid={$item['uid']}&do=album&picid={$item['picid']}");
$fs['body_general'] = $item['title'];
$note_type = 'clickpic';
$q_note = cplang('note_click_pic', array("space.php?uid={$item['uid']}&do=album&picid={$item['picid']}"));
break;
}
//Event Publishing
if (empty($item['friend']) && ckprivacy('click', 1)) {
feed_add('click', $fs['title_template'], $fs['title_data'], '', array(), $fs['body_general'], $fs['images'], $fs['image_links']);
}
//Reward visitors
getreward('click', 1, 0, $idtype . $id);
//Statistics
updatestat('click');
//Notice
notification_add($item['uid'], $note_type, $q_note);
showmessage('click_success', $_SGLOBAL['refer']);
} elseif ($_GET['op'] == 'show') {
foreach ($clicks as $key => $value) {
$value['clicknum'] = $item["click_{$key}"];
$value['classid'] = mt_rand(1, 4);
if ($value['clicknum'] > $maxclicknum) {
$maxclicknum = $value['clicknum'];
示例8: array
$magvalues = array();
break;
case 'sid':
$n_url = "home.php?mod=space&uid={$tospace['uid']}&do=share&id={$id}&cid={$cid}";
$note_type = 'sharecomment';
$note = 'share_comment';
$note_values = array('url' => $n_url);
$q_note = 'share_comment_reply';
$q_values = array('url' => $n_url);
$msg = 'do_success';
$magvalues = array();
break;
}
if (empty($comment)) {
if ($tospace['uid'] != $_G['uid']) {
if (ckprivacy('comment', 'feed')) {
require_once libfile('function/feed');
$fs['title_data']['hash_data'] = "{$idtype}{$id}";
feed_add($fs['icon'], $fs['title_template'], $fs['title_data'], $fs['body_template'], $fs['body_data'], $fs['body_general'], $fs['images'], $fs['image_links'], $fs['target_ids'], $fs['friend']);
}
$note_values['from_id'] = $_POST['id'];
$note_values['from_idtype'] = $_POST['idtype'];
$note_values['url'] .= "&goto=new#comment_{$cid}_li";
notification_add($tospace['uid'], $note_type, $note, $note_values);
}
} elseif ($comment['authorid'] != $_G['uid']) {
notification_add($comment['authorid'], $note_type, $q_note, $q_values);
}
if ($stattype) {
include_once libfile('function/stat');
updatestat($stattype);
示例9: array
$newdoid = DB::insert('home_doing', $setarr, 1);
$setarr = array('recentnote' => $message, 'spacenote' => $message);
$credit = $experience = 0;
$extrasql = array('doings' => 1);
updatecreditbyaction('doing', 0, $extrasql);
DB::update('common_member_field_home', $setarr, "uid='{$_G['uid']}'");
if ($_POST['to_signhtml'] && $_G['group']['maxsigsize']) {
if ($_G['group']['maxsigsize'] < 200) {
$signhtml = getstr($message, $_G['group']['maxsigsize'], 0, 0, 1);
$signhtml = preg_replace("/\\<br.*?\\>/i", ' ', $signhtml);
} else {
$signhtml = $message;
}
DB::update('common_member_field_forum', array('sightml' => $signhtml), "uid='{$_G['uid']}'");
}
if (ckprivacy('doing', 'feed') && $doing_status == '0') {
$feedarr = array('appid' => '', 'icon' => 'doing', 'uid' => $_G['uid'], 'username' => $_G['username'], 'dateline' => $_G['timestamp'], 'title_template' => lang('feed', 'feed_doing_title'), 'title_data' => daddslashes(serialize(dstripslashes(array('message' => $message)))), 'body_template' => '', 'body_data' => '', 'id' => $newdoid, 'idtype' => 'doid');
DB::insert('home_feed', $feedarr);
}
if ($doing_status == '1') {
updatemoderate('doid', $newdoid);
manage_addnotify('verifydoing');
}
require_once libfile('function/stat');
updatestat('doing');
DB::update('common_member_status', array('lastpost' => $_G['timestamp']), array('uid' => $_G['uid']));
if (!empty($_G['gp_fromcard'])) {
showmessage($message . lang('spacecp', 'card_update_doing'));
} else {
showmessage('do_success', dreferer(), array('doid' => $newdoid), $_G['gp_spacenote'] ? array('showmsg' => false) : array('header' => true));
}
示例10: cplang
$note = cplang('note_share_at', array("space.php?uid=" . $_SGLOBAL['supe_uid'] . "&do=share&id=" . $sid));
notification_add($UserId, 'atyou', $note);
}
//更新用户统计
if (empty($space['sharenum'])) {
$space['sharenum'] = getcount('share', array('uid' => $space['uid']));
$sharenumsql = "sharenum=" . $space['sharenum'];
} else {
$sharenumsql = 'sharenum=sharenum+1';
}
//积分
$needle = $id ? $type . $id : '';
$reward = getreward('createshare', 0, 0, $needle);
$_SGLOBAL['db']->query("UPDATE " . tname('space') . " SET {$sharenumsql}, lastpost='{$_SGLOBAL['timestamp']}', updatetime='{$_SGLOBAL['timestamp']}', credit=credit+{$reward['credit']}, experience=experience+{$reward['experience']} WHERE uid='{$_SGLOBAL['supe_uid']}'");
//动态
if (ckprivacy('share')) {
include_once S_ROOT . './source/function_feed.php';
feed_publish($sid, 'sid', 1);
}
if ($_POST['topicid']) {
topic_join($_POST['topicid'], $_SGLOBAL['supe_uid'], $_SGLOBAL['supe_username']);
$url = 'space.php?do=topic&topicid=' . $_POST['topicid'] . '&view=share';
} else {
$url = $_POST['refer'];
}
//martin 修改 start
if ($inspace == '1') {
$_SGLOBAL['inajax'] = 0;
}
if ($_GET['type'] == 'outernews') {
showmessage('do_success');
示例11: cplang
// 活动
$n_url = "space.php?do=event&id={$id}&view=comment&cid={$cid}";
$note_type = 'eventcomment';
$note = cplang('note_event_comment', array($n_url));
$q_note = cplang('note_event_comment_reply', array($n_url));
$msg = 'do_success';
$magvalues = array();
$msgtype = 'event_comment';
$q_msgtype = 'event_comment_reply';
break;
}
if (empty($comment)) {
//非引用评论
if ($tospace['uid'] != $_SGLOBAL['supe_uid']) {
//事件发布
if (ckprivacy('comment', 1)) {
feed_add($fs['icon'], $fs['title_template'], $fs['title_data'], $fs['body_template'], $fs['body_data'], $fs['body_general'], $fs['images'], $fs['image_links'], $fs['target_ids'], $fs['friend']);
}
//发送通知
notification_add($tospace['uid'], $note_type, $note);
//留言发送短消息
if ($_POST['idtype'] == 'uid' && $tospace['updatetime'] == $tospace['dateline']) {
include_once S_ROOT . './uc_client/client.php';
uc_pm_send($_SGLOBAL['supe_uid'], $tospace['uid'], cplang('wall_pm_subject'), cplang('wall_pm_message', array(addslashes(getsiteurl() . $n_url))), 1, 0, 0);
}
//发送邮件通知
smail($tospace['uid'], '', cplang($msgtype, array($_SN[$space['uid']], shtmlspecialchars(getsiteurl() . $n_url))), '', $msgtype);
}
} elseif ($comment['authorid'] != $_SGLOBAL['supe_uid']) {
//发送邮件通知
smail($comment['authorid'], '', cplang($q_msgtype, array($_SN[$space['uid']], shtmlspecialchars(getsiteurl() . $n_url))), '', $q_msgtype);
示例12: add_comment
//.........这里部分代码省略.........
$comment_status = 0;
}
$setarr = array('uid' => $tospace['uid'], 'id' => $id, 'idtype' => $idtype, 'authorid' => $_G['uid'], 'author' => $_G['username'], 'dateline' => $_G['timestamp'], 'message' => $message, 'ip' => $_G['clientip'], 'port' => $_G['remoteport'], 'status' => $comment_status);
$cid = C::t('home_comment')->insert($setarr, true);
$action = 'comment';
$becomment = 'getcomment';
$note = $q_note = '';
$note_values = $q_values = array();
switch ($idtype) {
case 'uid':
$n_url = "home.php?mod=space&uid={$tospace['uid']}&do=wall&cid={$cid}";
$note_type = 'wall';
$note = 'wall';
$note_values = array('url' => $n_url);
$q_note = 'wall_reply';
$q_values = array('url' => $n_url);
if ($comment) {
$msg = 'note_wall_reply_success';
$magvalues = array('username' => $tospace['username']);
$becomment = '';
} else {
$msg = 'do_success';
$magvalues = array();
$becomment = 'getguestbook';
}
$action = 'guestbook';
break;
case 'picid':
$n_url = "home.php?mod=space&uid={$tospace['uid']}&do=album&picid={$id}&cid={$cid}";
$note_type = 'comment';
$note = 'pic_comment';
$note_values = array('url' => $n_url);
$q_note = 'pic_comment_reply';
$q_values = array('url' => $n_url);
$msg = 'do_success';
$magvalues = array();
break;
case 'blogid':
$n_url = "home.php?mod=space&uid={$tospace['uid']}&do=blog&id={$id}&cid={$cid}";
$note_type = 'comment';
$note = 'blog_comment';
$note_values = array('url' => $n_url, 'subject' => $blog['subject']);
$q_note = 'blog_comment_reply';
$q_values = array('url' => $n_url);
$msg = 'do_success';
$magvalues = array();
break;
case 'sid':
$n_url = "home.php?mod=space&uid={$tospace['uid']}&do=share&id={$id}&cid={$cid}";
$note_type = 'comment';
$note = 'share_comment';
$note_values = array('url' => $n_url);
$q_note = 'share_comment_reply';
$q_values = array('url' => $n_url);
$msg = 'do_success';
$magvalues = array();
break;
}
if (empty($comment)) {
if ($tospace['uid'] != $_G['uid']) {
if (ckprivacy('comment', 'feed')) {
require_once libfile('function/feed');
$fs['title_data']['hash_data'] = "{$idtype}{$id}";
feed_add($fs['icon'], $fs['title_template'], $fs['title_data'], $fs['body_template'], $fs['body_data'], $fs['body_general'], $fs['images'], $fs['image_links'], $fs['target_ids'], $fs['friend']);
}
$note_values['from_id'] = $id;
$note_values['from_idtype'] = $idtype;
$note_values['url'] .= "&goto=new#comment_{$cid}_li";
notification_add($tospace['uid'], $note_type, $note, $note_values);
}
} elseif ($comment['authorid'] != $_G['uid']) {
notification_add($comment['authorid'], $note_type, $q_note, $q_values);
}
if ($comment_status == 1) {
updatemoderate($idtype . '_cid', $cid);
manage_addnotify('verifycommontes');
}
if ($stattype) {
include_once libfile('function/stat');
updatestat($stattype);
}
if ($tospace['uid'] != $_G['uid']) {
$needle = $id;
if ($idtype != 'uid') {
$needle = $idtype . $id;
} else {
$needle = $tospace['uid'];
}
updatecreditbyaction($action, 0, array(), $needle);
if ($becomment) {
if ($idtype == 'uid') {
$needle = $_G['uid'];
}
updatecreditbyaction($becomment, $tospace['uid'], array(), $needle);
}
}
C::t('common_member_status')->update($_G['uid'], array('lastpost' => $_G['timestamp']), 'UNBUFFERED');
$magvalues['cid'] = $cid;
return array('cid' => $cid, 'msg' => $msg, 'magvalues' => $magvalues);
}
示例13: array
//相册
$albumlist = array();
if($space['albumnum'] && ckprivacy('album')) {
$query = $_SGLOBAL['db']->query("SELECT * FROM ".tname('album')." WHERE uid='$space[uid]' ORDER BY updatetime DESC LIMIT 0,6");
while ($value = $_SGLOBAL['db']->fetch_array($query)) {
if(ckfriend($value['uid'], $value['friend'], $value['target_ids'])) {
$value['pic'] = pic_cover_get($value['pic'], $value['picflag']);
$albumlist[] = $value;
}
}
}
//留言板
$walllist = array();
if(ckprivacy('wall')) {
$query = $_SGLOBAL['db']->query("SELECT * FROM ".tname('comment')." WHERE id='$space[uid]' AND idtype='uid' ORDER BY dateline DESC LIMIT 0,5");
while ($value = $_SGLOBAL['db']->fetch_array($query)) {
realname_set($value['authorid'], $value['author']);
$value['message'] = strlen($value['message'])>500?getstr($value['message'], 500, 0, 0, 0, 0, -1).' ...':$value['message'];
$walllist[] = $value;
}
}
//是否在线
$query = $_SGLOBAL['db']->query('SELECT * FROM '.tname('session')." WHERE uid = '$space[uid]'");
$value = $_SGLOBAL['db']->fetch_array($query);
$isonline = (empty($value) || $value['magichidden']) ? 0 : sgmdate('H:i:s', $value['lastactivity'], 1);
//风格
$theme = empty($_GET['theme'])?'':preg_replace("/[^0-9a-z]/i", '', $_GET['theme']);
示例14: space_open
function space_open($uid, $username, $gid = 0, $email = '')
{
global $_SGLOBAL, $_SCONFIG;
if (empty($uid) || empty($username)) {
return array();
}
//验证 space 是否被管理员 delete
$query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('spacelog') . " WHERE uid='{$uid}' AND flag='-1'");
if ($value = $_SGLOBAL['db']->fetch_array($query)) {
showmessage('the_space_has_been_closed');
}
$space = array('uid' => $uid, 'username' => $username, 'dateline' => $_SGLOBAL['timestamp'], 'groupid' => $gid, 'regip' => getonlineip());
// Bonus Points
$reward = getreward('register', 0, $uid);
if ($reward['credit']) {
$space['credit'] = $reward['credit'];
}
if ($reward['experience']) {
$space['experience'] = $reward['experience'];
}
inserttable('space', $space, 0, true);
inserttable('spacefield', array('uid' => $uid, 'email' => $email), 0, true);
//发送PM
if ($_SGLOBAL['supe_uid'] && $_SGLOBAL['supe_uid'] != $uid) {
include_once S_ROOT . './uc_client/client.php';
uc_pm_send($_SGLOBAL['supe_uid'], $uid, cplang('space_open_subject'), cplang('space_open_message', array(getsiteurl())), 1, 0, 0);
}
//发送邮箱验证邮件
include_once S_ROOT . './source/function_cp.php';
emailcheck_send($uid, $email);
//产生feed
$_uid = $_SGLOBAL['supe_uid'];
$_username = $_SGLOBAL['supe_username'];
$_SGLOBAL['supe_uid'] = $uid;
$_SGLOBAL['supe_username'] = addslashes($username);
if (ckprivacy('spaceopen', 1)) {
feed_add('profile', cplang('feed_space_open'));
}
// update 最新会员
if ($_SCONFIG['newspacenum'] > 0) {
$newspacelist = array();
$wherearr = array('1');
if ($_SCONFIG['newspaceavatar']) {
$wherearr[] = "avatar='1'";
}
if ($_SCONFIG['newspacerealname']) {
$wherearr[] = "namestatus='1'";
}
if ($_SCONFIG['newspacevideophoto']) {
$wherearr[] = "videostatus='1'";
}
$query = $_SGLOBAL['db']->query("SELECT uid,username,name,namestatus,videostatus,dateline FROM " . tname('space') . " WHERE " . implode(' AND ', $wherearr) . " ORDER BY uid DESC LIMIT 0,{$_SCONFIG['newspacenum']}");
while ($value = $_SGLOBAL['db']->fetch_array($query)) {
$newspacelist[] = $value;
}
data_set('newspacelist', $newspacelist);
}
//Statistics update
include_once S_ROOT . './source/function_cp.php';
updatestat('register');
$_SGLOBAL['supe_uid'] = $_uid;
$_SGLOBAL['supe_username'] = $_username;
return $space;
}
示例15: notification_add
if ($note_uid && $note_uid != $_SGLOBAL['supe_uid']) {
notification_add($note_uid, 'sharenotice', $note_message);
}
// update user Statistics
if (empty($space['sharenum'])) {
$space['sharenum'] = getcount('share', array('uid' => $space['uid']));
$sharenumsql = "sharenum=" . $space['sharenum'];
} else {
$sharenumsql = 'sharenum=sharenum+1';
}
// points
$needle = $id ? $type . $id : '';
$reward = getreward('createshare', 0, 0, $needle);
$_SGLOBAL['db']->query("UPDATE " . tname('space') . " SET {$sharenumsql}, lastpost='{$_SGLOBAL['timestamp']}', updatetime='{$_SGLOBAL['timestamp']}', credit=credit+{$reward['credit']}, experience=experience+{$reward['experience']} WHERE uid='{$_SGLOBAL['supe_uid']}'");
//̬
if (ckprivacy('share', 1)) {
include_once S_ROOT . './source/function_feed.php';
feed_publish($sid, 'sid', 1);
}
if ($_POST['topicid']) {
topic_join($_POST['topicid'], $_SGLOBAL['supe_uid'], $_SGLOBAL['supe_username']);
$url = 'space.php?do=topic&topicid=' . $_POST['topicid'] . '&view=share';
} else {
$url = $_POST['refer'];
}
showmessage('do_success', $url, 0);
}
//ʾ
$arr['body_data'] = serialize($arr['body_data']);
// groups ת
$arr = mkshare($arr);