本文整理汇总了PHP中getonlineip函数的典型用法代码示例。如果您正苦于以下问题:PHP getonlineip函数的具体用法?PHP getonlineip怎么用?PHP getonlineip使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getonlineip函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: wz_record
function wz_record($get)
{
global $_SGLOBAL, $_SC;
reset($get);
foreach ($get as $k => $v) {
if ($k == 'wxid') {
$wxid = getstr($get[$k]);
}
if ($k == 'token') {
$token = getstr($get[$k]);
}
if ($k == 'mid') {
$mid = intval($get[$k]) ? intval($get[$k]) : 0;
}
if ($k == 'wxid' || $k == 'token' || $k == 'mid') {
unset($get[$k]);
continue;
} else {
$get[$k] = getstr($get[$k]);
}
$get[$k] = getstr($get[$k]);
}
$query = json_encode($get);
$arr = array('token_id' => $_SGLOBAL['supe_token_id'], 'query' => $query, 'ip' => getonlineip(), 'user_agent' => $_SERVER["HTTP_USER_AGENT"], 'wxid' => $wxid, 'token' => $token, 'mid' => $mid, 'addtime' => $_SGLOBAL['timestamp']);
$record_id = inserttable(tname('wz_record'), $arr, 1);
return $record_id;
}
示例2: insertsession
function insertsession($setarr)
{
global $_SGLOBAL, $_SCONFIG;
$_SCONFIG['onlinehold'] = intval($_SCONFIG['onlinehold']);
if ($_SCONFIG['onlinehold'] < 300) {
$_SCONFIG['onlinehold'] = 300;
}
$_SGLOBAL['db']->query("DELETE FROM " . tname('session') . " WHERE uid='{$setarr['uid']}' OR lastactivity<'" . ($_SGLOBAL['timestamp'] - $_SCONFIG['onlinehold']) . "'");
//添加在线
$ip = getonlineip(1);
$setarr['lastactivity'] = $_SGLOBAL['timestamp'];
$setarr['ip'] = $ip;
//检查是否使用了道具隐身草
if ($_SGLOBAL['magic']['invisible']) {
$query = $_SGLOBAL['db']->query('SELECT * FROM ' . tname('magicuselog') . " WHERE uid='{$setarr['uid']}' AND mid='invisible'");
$value = $_SGLOBAL['db']->fetch_array($query);
if ($value && $value['expire'] > $_SGLOBAL['timestamp']) {
$setarr['magichidden'] = '1';
}
}
//查询实名
$uid = $setarr[uid];
$query = $_SGLOBAL['db']->query("SELECT uid, name, namestatus FROM " . tname('space') . " WHERE uid='{$uid}'");
if ($value = $_SGLOBAL['db']->fetch_array($query)) {
$setarr['name'] = addslashes($value['name']);
}
inserttable('session', $setarr, 0, true, 1);
$spacearr = array('lastlogin' => "lastlogin='{$_SGLOBAL['timestamp']}'", 'ip' => "ip='{$ip}'");
$_SGLOBAL['supe_uid'] = $setarr['uid'];
$experience = $credit = 0;
//每天登陆奖励
$reward = getreward('daylogin', 0, $setarr['uid']);
$credit = $reward['credit'];
$experience = $reward['experience'];
if ($credit) {
$spacearr['credit'] = "credit=credit+{$credit}";
}
if ($experience) {
$spacearr['experience'] = "experience=experience+{$experience}";
}
//更新用户
$_SGLOBAL['db']->query("UPDATE " . tname('space') . " SET " . implode(',', $spacearr) . " WHERE uid='{$setarr['uid']}'");
//验证用户组是否过期
$query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('spacelog') . " WHERE uid='{$setarr['uid']}'");
if ($value = $_SGLOBAL['db']->fetch_array($query)) {
if ($value['expiration'] <= $_SGLOBAL['timestamp']) {
//到期
//清除用户组
updatetable('space', array('groupid' => 0), array('uid' => $setarr['uid']));
//删除记录
$_SGLOBAL['db']->query("DELETE FROM " . tname('spacelog') . " WHERE uid='{$setarr['uid']}'");
}
}
//统计更新
include_once S_ROOT . './source/function_cp.php';
updatestat('login', 1);
}
示例3: email_reg
function email_reg($email, $backurl = '')
{
global $_SGLOBAL, $_SC;
$email_reg['email'] = $email;
$email_reg['ip'] = getonlineip(1);
$email_reg['salt'] = random(6);
$email_reg['hash'] = substr(md5(md5($email) . $email_reg['salt']), 8, 7);
$email_reg['addtime'] = $_SGLOBAL['timestamp'];
$email_reg['used'] = 0;
$email_reg['backurl'] = $backurl;
$id = inserttable(tname("open_email_reg"), $email_reg, 1, 1);
$h = $email_reg['hash'];
return $_SC['site_host'] . "/?r=" . $h;
}
示例4: insertsession
function insertsession($setarr)
{
global $_SGLOBAL, $_SCONFIG;
$_SCONFIG['onlinehold'] = intval($_SCONFIG['onlinehold']);
if ($_SCONFIG['onlinehold'] < 300) {
$_SCONFIG['onlinehold'] = 300;
}
$_SGLOBAL['db']->query("DELETE FROM " . tname('session') . " WHERE uid='{$setarr['uid']}' OR lastactivity<'" . ($_SGLOBAL['timestamp'] - $_SCONFIG['onlinehold']) . "'");
//添加在线
$ip = getonlineip(1);
$setarr['lastactivity'] = $_SGLOBAL['timestamp'];
$setarr['ip'] = $ip;
inserttable('session', $setarr, 0, true, 1);
//更新用户
updatetable('space', array('lastlogin' => $_SGLOBAL['timestamp'], 'ip' => $ip), array('uid' => $setarr['uid']), 1);
}
示例5: array
$configs = array();
$query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('config'));
while ($value = $_SGLOBAL['db']->fetch_array($query)) {
$configs[$value['var']] = shtmlspecialchars($value['datavalue']);
}
if (empty($configs['feedfilternum']) || $configs['feedfilternum'] < 1) {
$configs['feedfilternum'] = 1;
}
$datasets = $datas = $mails = array();
$query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('data'));
while ($value = $_SGLOBAL['db']->fetch_array($query)) {
if ($value['var'] == 'setting' || $value['var'] == 'mail') {
$datasets[$value['var']] = empty($value['datavalue']) ? array() : unserialize($value['datavalue']);
} else {
$datasets[$value['var']] = shtmlspecialchars($value['datavalue']);
}
}
$datas = $datasets['setting'];
$mails = $datasets['mail'];
// templates directory
$templatearr = array('default' => 'default');
$tpl_dir = sreaddir(S_ROOT . './template');
foreach ($tpl_dir as $dir) {
if (file_exists(S_ROOT . './template/' . $dir . '/style.css')) {
$templatearr[$dir] = $dir;
}
}
$templateselect = array($configs['template'] => ' selected');
$toselect = array($configs['timeoffset'] => ' selected');
$onlineip = getonlineip();
示例6: tname
$TmpName = $value[1];
$UserId = $value[2];
$result = $_SGLOBAL['db']->query("select uid,username,name from " . tname('space') . " where uid={$UserId}");
$rs = $_SGLOBAL['db']->fetch_array($result);
$realname = $rs['name'];
//调用检查函数将@后的内容进行验证,为UID对应的姓名相同则返回@与姓名,不相同则继续判断下一个@,没有找到匹配的最终将返回false
$ValidValue = getAtName($TmpString, $TmpName, $realname);
$ValidValue = trim($ValidValue);
$at_friend = "space.php?uid=" . $UserId;
$Message = str_replace($ValidValue, "<a href={$at_friend}>@" . $realname . "</a> ", $Message);
}
//替换表情
$Message = preg_replace("/\\[em:(\\d+):]/is", "<img src=\"image/face/\\1.gif\" class=\"face\">", $Message);
$Message = preg_replace("/\\<br.*?\\>/is", ' ', $Message);
//print_r($Message);
$arr = array("username" => getstr($username, 15, 1, 1, 1), "message" => $Message, "uid" => intval($userid), "replynum" => 0, "mood" => 0, 'dateline' => $_SGLOBAL['timestamp'], 'ip' => getonlineip());
$newdoid = inserttable('doing', $arr, 1);
//事件feed
$feedarr = array('appid' => UC_APPID, 'icon' => 'doing', 'uid' => $userid, 'username' => $username, 'dateline' => $_SGLOBAL['timestamp'], 'title_template' => cplang('feed_doing_title'), 'title_data' => saddslashes(serialize(sstripslashes(array('message' => $Message)))), 'body_template' => '', 'body_data' => '', 'id' => $newdoid, 'idtype' => 'doid');
$feedarr['hash_template'] = md5($feedarr['title_template'] . "\t" . $feedarr['body_template']);
//喜好hash
$feedarr['hash_data'] = md5($feedarr['title_template'] . "\t" . $feedarr['title_data'] . "\t" . $feedarr['body_template'] . "\t" . $feedarr['body_data']);
//合并hash
inserttable('feed', $feedarr, 1);
updatestat('doing');
//更新空间note
$setarr = array('note' => $Message);
if (!empty($_POST['spacenote'])) {
$reward = getreward('updatemood', 0);
$setarr['spacenote'] = $Message;
} else {
示例7: array
$list = $ols = $fuids = array();
$count = 0;
$page = empty($_GET['page']) ? 0 : intval($_GET['page']);
if ($page < 1) {
$page = 1;
}
$start = ($page - 1) * $perpage;
//检查开始数
ckstart($start, $perpage);
if ($_GET['view'] == 'online') {
$theurl = "space.php?uid={$space['uid']}&do=friend&view=online";
$actives = array('me' => ' class="active"');
$wheresql = '';
if ($_GET['type'] == 'near') {
$theurl = "space.php?uid={$space['uid']}&do=friend&view=online&type=near";
$wheresql = " WHERE main.ip='" . getonlineip(1) . "'";
} elseif ($_GET['type'] == 'friend' && $space['feedfriend']) {
$theurl = "space.php?uid={$space['uid']}&do=friend&view=online&type=friend";
$wheresql = " WHERE main.uid IN ({$space['feedfriend']})";
}
$count = $_SGLOBAL['db']->result($_SGLOBAL['db']->query("SELECT COUNT(*) FROM " . tname('session') . " main {$wheresql}"), 0);
if ($count) {
$query = $_SGLOBAL['db']->query("SELECT f.resideprovince, f.residecity, f.note, f.sex, f.note, f.spacenote, main.uid, main.username, main.lastactivity \r\n\t\t\tFROM " . tname('session') . " main\r\n\t\t\tLEFT JOIN " . tname('spacefield') . " f ON f.uid=main.uid\r\n\t\t\t{$wheresql}\r\n\t\t\tLIMIT {$start},{$perpage}");
while ($value = $_SGLOBAL['db']->fetch_array($query)) {
if ($_GET['type'] == 'near') {
if ($value['uid'] = $space['uid']) {
$count = $count - 1;
continue;
}
}
realname_set($value['uid'], $value['username']);
示例8: stream_save
function stream_save($strdata, $albumid = 0, $fileext = 'jpg', $name='', $title='', $delsize=0, $from = false) {
global $_SGLOBAL, $space, $_SCONFIG, $_SC;
if($albumid<0) $albumid = 0;
$setarr = array();
$filepath = getfilepath($fileext, true);
$newfilename = $_SC['attachdir'].'./'.$filepath;
if($handle = fopen($newfilename, 'wb')) {
if(fwrite($handle, $strdata) !== FALSE) {
fclose($handle);
$size = filesize($newfilename);
//检查空间大小
if(empty($space)) {
$space = getspace($_SGLOBAL['supe_uid']);
$query = $_SGLOBAL['db']->query("SELECT * FROM ".tname('space')." WHERE uid='$_SGLOBAL[supe_uid]'");
$space = $_SGLOBAL['db']->fetch_array($query);
$_SGLOBAL['supe_username'] = addslashes($space['username']);
}
$_SGLOBAL['member'] = $space;
$maxattachsize = checkperm('maxattachsize');//单位MB
if($maxattachsize) {//0为不限制
if($space['attachsize'] + $size - $delsize > $maxattachsize + $space['addsize']) {
@unlink($newfilename);
return -1;
}
}
//检查是否图片
if(function_exists('getimagesize')) {
$tmp_imagesize = @getimagesize($newfilename);
list($tmp_width, $tmp_height, $tmp_type) = (array)$tmp_imagesize;
$tmp_size = $tmp_width * $tmp_height;
if($tmp_size > 16777216 || $tmp_size < 4 || empty($tmp_type) || strpos($tmp_imagesize['mime'], 'flash') > 0) {
@unlink($newfilename);
return -2;
}
}
//缩略图
include_once(S_ROOT.'./source/function_image.php');
$thumbpath = makethumb($newfilename);
$thumb = empty($thumbpath)?0:1;
//大头帖不添加水印
if($_SCONFIG['allowwatermark']) {
makewatermark($newfilename);
}
//入库
$filename = addslashes(($name ? $name : substr(strrchr($filepath, '/'), 1)));
$title = getstr($title, 200, 1, 1, 1);
if($albumid) {
preg_match("/^new\:(.+)$/i", $albumid, $matchs);
if(!empty($matchs[1])) {
$albumname = shtmlspecialchars(trim($matchs[1]));
if(empty($albumname)) $albumname = sgmdate('Ymd');
$albumid = album_creat(array('albumname' => $albumname));
} else {
$albumid = intval($albumid);
if($albumid) {
$query = $_SGLOBAL['db']->query("SELECT albumname,friend FROM ".tname('album')." WHERE albumid='$albumid' AND uid='$_SGLOBAL[supe_uid]'");
if($value = $_SGLOBAL['db']->fetch_array($query)) {
$albumname = addslashes($value['albumname']);
$albumfriend = $value['friend'];
} else {
$albumname = sgmdate('Ymd');
$albumid = album_creat(array('albumname' => $albumname));
}
}
}
} else {
$albumid = 0;
}
$setarr = array(
'albumid' => $albumid,
'uid' => $_SGLOBAL['supe_uid'],
'username' => $_SGLOBAL['supe_username'],
'dateline' => $_SGLOBAL['timestamp'],
'filename' => $filename,
'postip' => getonlineip(),
'title' => $title,
'type' => $fileext,
'size' => $size,
'filepath' => $filepath,
'thumb' => $thumb
);
$setarr['picid'] = inserttable('pic', $setarr, 1);
//更新附件大小
//积分
$setsql = '';
if($from) {
$reward = getreward($from, 0);
if($reward['credit']) {
//.........这里部分代码省略.........
示例9: getAtName
if (empty($realname)) {
$realname = $rs['username'];
}
//调用检查函数将@后的内容进行验证,为UID对应的姓名相同则返回@与姓名,不相同则继续判断下一个@,没有找到匹配的最终将返回false
$ValidValue = getAtName($TmpString, $TmpName, $realname);
$ValidValue = trim($ValidValue);
$at_friend = "space.php?uid=" . $UserId;
if ($ValidValue != false) {
$Message = str_replace($ValidValue, "<a href={$at_friend}>@" . $realname . "</a> ", $Message);
$UserIds[] = $UserId;
}
}
}
//Add by Add by am 2013-12-07 end
$arr = array("topicid" => 0, "uid" => intval($userid), "username" => getstr($username, 15, 1, 1, 1), "subject" => getstr($Subject, 80, 1, 1, 1), "classid" => 0, "viewnum" => 0, "replynum" => 0, "hot" => 0, "picflag" => 0, "noreply" => 0, 'dateline' => $_SGLOBAL['timestamp'], 'friend' => 1, 'click_1' => 0, 'click_2' => 0, 'click_3' => 0, 'click_4' => 0, 'click_5' => 0, 'fromdevice' => $FromDevice);
$blogid = inserttable('blog', $arr, 1);
$arr1 = array("blogid" => intval($blogid), "uid" => intval($userid), "message" => getstr($Message, 5000, 1, 1, 1), "postip" => getonlineip(), "relatedtime" => 0, "magiccolor" => 0, "magicpaper" => 0, "magiccall" => 0);
$blogfield = inserttable('blogfield', $arr1, 1);
include_once S_ROOT . './source/function_feed.php';
feed_publish($blogid, 'blogid', 0, $FromDevice);
if ($blogid) {
$arrs = array('flag' => 'success');
} else {
$arrs = array('flag' => 'fail');
}
}
}
$result = json_encode($arrs);
$result = preg_replace("#\\\\u([0-9a-f]+)#ie", "iconv('UCS-2BE', 'UTF-8', pack('H4', '\\1'))", $result);
echo $result;
exit;
示例10: getIpDetails
$_POST["country"] = $res['country'];
$_POST["school"] = $res['school'];
$_SGLOBAL["inviteactive_showemail"] = true;
$_SGLOBAL["no_inviteactive"] = true;
$inviteactive_showmsg = true;
$country = $_POST['country'];
$school = $_POST['school'];
$_SCONFIG['overseas'] = true;
include_once 'do_quickmarkregister.php';
$lng = '';
$lat = '';
try {
$res = getIpDetails();
$lng = $res['longitude'];
$lat = $res['latitude'];
$forg = array("uid" => $newuid, "ip" => getonlineip(), "country" => $country, "school" => $school, "lng" => $lng, "lat" => $lat);
inserttable("spaceforeign", $forg);
//设置隐私
$_SGLOBAL['db']->query("INSERT INTO " . tname('spaceinfo') . " (type,subtype,uid,friend) VALUES ('contact','mobile'," . $newuid . ",1)");
$query = $_SGLOBAL['db']->query("UPDATE " . tname("spaceforeign") . " SET dataline='" . time() . "' WHERE uid={$newuid}");
//给外事处发消息进行认证
$query = $_SGLOBAL['db']->query("SELECT * FROM " . tname("space") . " WHERE consul=1");
if ($res = $_SGLOBAL['db']->fetch_array($query)) {
$recver = $res['uid'];
}
$setarr = array('uid' => $recver, 'type' => "friend", 'new' => 1, 'authorid' => $newuid, 'author' => $name, 'note' => "({$birthday},{$academy}," . $startyear . "级)" . '向您发起了' . $country . $school . '学校的认证请求<br/><a href="space.php?do=friend&view=confirmoverseas&uid=%27' . $newuid . '%27&type=overseas">通过请求</a><span class="pipe">|</span><a href="space.php?do=friend&view=refuseoverseas&uid=%27' . $newuid . '%27&type=overseas">忽略</a>', 'dateline' => $_SGLOBAL['timestamp']);
$_SGLOBAL['db']->query("UPDATE " . tname('space') . " SET notenum=notenum+1 WHERE uid='{$recver}'");
inserttable('notification', $setarr);
//变更记录
if ($_SCONFIG['my_status']) {
inserttable('userlog', array('uid' => $newuid, 'action' => 'add', 'dateline' => $_SGLOBAL['timestamp']), 0, true);
示例11: tname
}
if (empty($updo) && $doid) {
$query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('doing') . " WHERE doid='{$doid}'");
$updo = $_SGLOBAL['db']->fetch_array($query);
}
if (empty($updo)) {
showmessage('docomment_error');
} else {
//黑名单
if (isblacklist($updo['uid'])) {
showmessage('is_blacklist');
}
}
$updo['id'] = intval($updo['id']);
$updo['grade'] = intval($updo['grade']);
$setarr = array('doid' => $updo['doid'], 'upid' => $updo['id'], 'uid' => $_SGLOBAL['supe_uid'], 'username' => $_SGLOBAL['supe_username'], 'dateline' => $_SGLOBAL['timestamp'], 'message' => $message, 'ip' => getonlineip(), 'grade' => $updo['grade'] + 1);
//最多层级
if ($updo['grade'] >= 3) {
$setarr['upid'] = $updo['upid'];
//更母一个级别
}
$newid = inserttable('docomment', $setarr, 1);
//更新回复数
$_SGLOBAL['db']->query("UPDATE " . tname('doing') . " SET replynum=replynum+1 WHERE doid='{$updo['doid']}'");
//通知
if ($updo['uid'] != $_SGLOBAL['supe_uid']) {
$note = cplang('note_doing_reply', array("space.php?do=doing&doid={$updo['doid']}&highlight={$newid}"));
notification_add($updo['uid'], 'doing', $note);
}
$_POST['refer'] = preg_replace("/((\\#|\\&highlight|\\-highlight|\\.html).*?)\$/", '', $_POST['refer']);
if (strexists($_POST['refer'], '?')) {
示例12: preg_match_all
//以下摘取addnews部分代码,私下觉得@功能不完整!
preg_match_all("/[@](.*)[(]([\\d]+)[)]\\s/U", $Message, $Matches, PREG_SET_ORDER);
foreach ($Matches as $value) {
$TmpString = $value[0];
$TmpName = $value[1];
$UserId = $value[2];
$result = $_SGLOBAL['db']->query("select uid,username,name from " . tname('space') . " where uid={$UserId}");
$rs = $_SGLOBAL['db']->fetch_array($result);
$realname = $rs['name'];
$ValidValue = getAtName($TmpString, $TmpName, $realname);
$ValidValue = trim($ValidValue);
$at_friend = "space.php?uid=" . $UserId;
$Message = str_replace($ValidValue, "<a href={$at_friend}>@" . $realname . "</a> ", $Message);
}
$Message = preg_replace("/\\[em:(\\d+):]/is", "<img src=\"image/face/\\1.gif\" class=\"face\">", $Message);
$Message = preg_replace("/\\<br.*?\\>/is", ' ', $Message);
chdir("../../");
include_once 'source/function_cp.php';
$MobileFile = pic_save($File, $_POST['albumid'], $Message, $_POST['topicid']);
if ($MobileFile && is_array($MobileFile)) {
$arr = array("username" => getstr($username, 30, 1, 1, 1), "message" => $Message, "uid" => intval($userid), "replynum" => 0, "mood" => 0, 'dateline' => $_SGLOBAL['timestamp'], 'ip' => getonlineip(), 'fromdevice' => $FromDevice, 'image_1' => pic_get($MobileFile['filepath'], $MobileFile['thumb'], $MobileFile['remote']), 'image_1_link' => "space.php?uid={$MobileFile['uid']}&do=album&picid={$MobileFile['picid']}");
$newdoid = inserttable('doing', $arr, 1);
$Feedarray = array('appid' => 'UC_APPID', 'icon' => 'doing', 'id' => $newdoid, 'idtype' => 'doid', 'uid' => $MobileFile['uid'], 'username' => $MobileFile['username'], 'dateline' => $MobileFile['dateline'], 'fromdevice' => $FromDevice, 'title_template' => cplang('feed_doing_title'), 'title_data' => saddslashes(serialize(sstripslashes(array('message' => $Message)))), 'body_template' => '', 'body_data' => '', 'image_1' => pic_get($MobileFile['filepath'], $MobileFile['thumb'], $MobileFile['remote']), 'image_1_link' => "space.php?uid={$MobileFile['uid']}&do=album&picid={$MobileFile['picid']}");
$Feedarray['hash_template'] = md5($Feedarray['title_template'] . "\t" . $Feedarray['body_template']);
$Feedarray['hash_data'] = md5($Feedarray['title_template'] . "\t" . $Feedarray['title_data'] . "\t" . $Feedarray['body_template'] . "\t" . $Feedarray['body_data']);
$Feedid = inserttable('feed', $Feedarray, 1);
updatestat('doing');
$Result = array('flag' => 'success');
} else {
$Result = array('flag' => 'fail_file&msg');
}
示例13: saddslashes
$value = saddslashes($value);
$dateline = intval(sstrtotime($value['dateCreated']));
$subject = getstr($value['title'], 80, 1, 1, 1);
$message = isset($value['description']) ? $value['description'] : $value['content'];
$message = getstr($message, 0, 1, 1, 1, 0, 1);
$message = checkhtml($message);
if (empty($subject) || empty($message)) {
$results[$key]['status'] = '--';
$results[$key]['blogid'] = 0;
continue;
}
//开始导入
$blogarr = array('uid' => $_SGLOBAL['supe_uid'], 'username' => $_SGLOBAL['supe_username'], 'subject' => $subject, 'pic' => getmessagepic($message), 'dateline' => $dateline ? $dateline : $_SGLOBAL['timestamp']);
$blogid = inserttable('blog', $blogarr, 1);
//插入内容
$fieldarr = array('blogid' => $blogid, 'message' => $message, 'postip' => getonlineip());
inserttable('blogfield', $fieldarr);
//统计
$incount = $incount + 1;
$results[$key]['status'] = 'OK';
$results[$key]['blogid'] = $blogid;
} else {
$results[$key]['status'] = '--';
$results[$key]['blogid'] = 0;
}
}
if ($incount) {
//扣除积分
updatespacestatus('pay', 'xmlrpc');
@unlink($userfile);
}
示例14: showmessage
//黑名单
if (isblacklist($post['uid'])) {
showmessage('is_blacklist');
}
//实名
realname_set($post['uid'], $post['username']);
realname_get();
$post['message'] = preg_replace("/\\<div class=\"quote\"\\>\\<span class=\"q\"\\>.*?\\<\\/span\\>\\<\\/div\\>/is", '', $post['message']);
//移除编辑记录
$post['message'] = preg_replace("/<ins class=\"modify\".+?<\\/ins>/is", '', $post['message']);
$post['message'] = html2bbcode($post['message']);
//显示用
$message = addslashes("<div class=\"quote\"><span class=\"q\"><b>" . $_SN[$post['uid']] . "</b>: " . getstr($post['message'], 150, 0, 0, 0, 2, 1) . '</span></div>') . $message;
}
$anonymous = empty($_POST['anonymous']) ? 0 : intval($_POST['anonymous']);
$setarr = array('tagid' => intval($thread['tagid']), 'anonymous' => $anonymous, 'tid' => $tid, 'uid' => $_SGLOBAL['supe_uid'], 'username' => $_SGLOBAL['supe_username'], 'ip' => getonlineip(), 'dateline' => $_SGLOBAL['timestamp'], 'message' => $message);
$pid = inserttable('post', $setarr, 1);
//邮件通知
smail($thread['uid'], '', cplang('mtag_reply', array($_SN[$space['uid']], shtmlspecialchars(getsiteurl() . "space.php?uid={$thread['uid']}&do=thread&id={$thread['tid']}"))), '', 'mtag_reply');
//更新统计数据
$last_author_name = $anonymous ? 'null' : $_SGLOBAL[supe_username];
$_SGLOBAL['db']->query("UPDATE " . tname('thread') . "\r\n\t\tSET replynum=replynum+1, lastpost='{$_SGLOBAL['timestamp']}', lastauthor='{$last_author_name}', lastauthorid='{$_SGLOBAL['supe_uid']}'\r\n\t\tWHERE tid='{$tid}'");
//更新群组统计
$_SGLOBAL['db']->query("UPDATE " . tname("mtag") . " SET postnum=postnum+1 WHERE tagid='{$thread['tagid']}'");
//普通回复
if (empty($post) && $thread['uid'] != $_SGLOBAL['supe_uid']) {
//积分
getreward('replythread', 1, 0, $thread['tid']);
realname_set($thread['uid'], $thread['username']);
realname_get();
if (empty($mtag['viewperm'])) {
示例15: blog_post
//.........这里部分代码省略.........
foreach ($uploads as $value) {
$picurl = mkpicurl($value, 0);
$message .= "<div class=\"uchome-message-pic\"><img src=\"{$picurl}\"><p>{$value['title']}</p></div>";
}
}
//没有填写任何东西
$ckmessage = preg_replace("/(\\<div\\>|\\<\\/div\\>|\\s|\\ \\;|\\<br\\>|\\<p\\>|\\<\\/p\\>)+/is", '', $message);
if (empty($ckmessage)) {
return false;
}
//添加slashes
$message = addslashes($message);
//从内容中读取图片
if (empty($titlepic)) {
$titlepic = getmessagepic($message);
$blogarr['picflag'] = 0;
}
$blogarr['pic'] = $titlepic;
if ($olds['blogid']) {
//更新
$blogid = $olds['blogid'];
updatetable('blog', $blogarr, array('blogid' => $blogid));
$fuids = array();
$blogarr['uid'] = $olds['uid'];
$blogarr['username'] = $olds['username'];
} else {
$blogarr['uid'] = $_SGLOBAL['supe_uid'];
$blogarr['username'] = $_SGLOBAL['supe_username'];
$blogarr['dateline'] = empty($POST['dateline']) ? $_SGLOBAL['timestamp'] : $POST['dateline'];
$blogid = inserttable('blog', $blogarr, 1);
}
$blogarr['blogid'] = $blogid;
//附表
$fieldarr = array('message' => $message, 'postip' => getonlineip(), 'target_ids' => $POST['target_ids']);
//TAG
$oldtagstr = addslashes(empty($olds['tag']) ? '' : implode(' ', unserialize($olds['tag'])));
$tagarr = array();
if ($POST['tag'] != $oldtagstr) {
if (!empty($olds['tag'])) {
//先把以前的给清理掉
$oldtags = array();
$query = $_SGLOBAL['db']->query("SELECT tagid, blogid FROM " . tname('tagblog') . " WHERE blogid='{$blogid}'");
while ($value = $_SGLOBAL['db']->fetch_array($query)) {
$oldtags[] = $value['tagid'];
}
if ($oldtags) {
$_SGLOBAL['db']->query("UPDATE " . tname('tag') . " SET blognum=blognum-1 WHERE tagid IN (" . simplode($oldtags) . ")");
$_SGLOBAL['db']->query("DELETE FROM " . tname('tagblog') . " WHERE blogid='{$blogid}'");
}
}
$tagarr = tag_batch($blogid, $POST['tag']);
//更新附表中的tag
$fieldarr['tag'] = empty($tagarr) ? '' : addslashes(serialize($tagarr));
}
if ($olds) {
//更新
updatetable('blogfield', $fieldarr, array('blogid' => $blogid));
} else {
$fieldarr['blogid'] = $blogid;
$fieldarr['uid'] = $blogarr['uid'];
inserttable('blogfield', $fieldarr);
}
//空间更新
if ($olds) {
//空间更新
$_SGLOBAL['db']->query("UPDATE " . tname('space') . " SET updatetime='{$_SGLOBAL['timestamp']}' WHERE uid='{$_SGLOBAL['supe_uid']}'");