} } //图片 if ($picids) { $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('pic') . " WHERE picid IN (" . simplode($picids) . ")"); while ($value = $_SGLOBAL['db']->fetch_array($query)) { $value['pic'] = mkpicurl($value); $list['pic'][$value['picid']]['info'] = $value; unset($emptyids['picid' . $value['picid']]); } } //相册 if ($albumids) { $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('album') . " WHERE albumid IN (" . simplode($albumids) . ")"); while ($value = $_SGLOBAL['db']->fetch_array($query)) { $value['pic'] = mkpicurl($value); $list['album'][$value['albumid']]['info'] = $value; unset($emptyids['album' . $value['albumid']]); } } //话题 if ($threadids) { $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('thread') . " WHERE tid IN (" . simplode($threadids) . ")"); while ($value = $_SGLOBAL['db']->fetch_array($query)) { $list['thread'][$value['tid']]['info'] = $value; unset($emptyids['thread' . $value['tid']]); } } //群组 if ($mtagids) { $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('mtag') . " WHERE tagid IN (" . simplode($mtagids) . ")");
function block_uchphoto($paramarr) { global $_SGLOBAL, $_SC, $_SGET, $_SCONFIG; dbconnect(2); if (empty($paramarr['sql'])) { $sql = array(); $sql['select'] = 'SELECT *'; $sql['from'] = 'FROM ' . tname('album', '2'); $wherearr = array(); //where if (!empty($paramarr['albumid'])) { $paramarr['albumid'] = getdotstring($paramarr['albumid'], 'int'); if ($paramarr['albumid']) { $wherearr[] = 'albumid IN (' . $paramarr['albumid'] . ')'; } } else { if (!empty($paramarr['dateline'])) { $paramarr['dateline'] = intval($paramarr['dateline']); if ($paramarr['dateline']) { $wherearr[] = 'dateline >= ' . ($_SGLOBAL['timestamp'] - $paramarr['dateline']); } } if (!empty($paramarr['updatetime'])) { $paramarr['updatetime'] = intval($paramarr['updatetime']); if ($paramarr['updatetime']) { $wherearr[] = 'updatetime >= ' . ($_SGLOBAL['timestamp'] - $paramarr['updatetime']); } } if (!empty($paramarr['uid'])) { $paramarr['uid'] = getdotstring($paramarr['uid'], 'int'); if ($paramarr['uid']) { $wherearr[] = 'uid IN (' . $paramarr['uid'] . ')'; } } $wherearr[] = 'friend = 0'; $wherearr[] = 'picnum != 0'; if (!empty($paramarr['dateline'])) { $paramarr['dateline'] = intval($paramarr['dateline']); if ($paramarr['dateline']) { $wherearr[] = 'dateline >= ' . ($_SGLOBAL['timestamp'] - $paramarr['dateline']); } } if (!empty($paramarr['updatetime'])) { $paramarr['updatetime'] = intval($paramarr['updatetime']); if ($paramarr['updatetime']) { $wherearr[] = 'updatetime >= ' . ($_SGLOBAL['timestamp'] - $paramarr['updatetime']); } } } $sql['where'] = ''; if (!empty($wherearr)) { $sql['where'] = 'WHERE ' . implode(' AND ', $wherearr); } //order if (!empty($paramarr['order'])) { $sql['order'] = 'ORDER BY ' . $paramarr['order']; } //limit if (!empty($paramarr['perpage'])) { $paramarr['perpage'] = intval($paramarr['perpage']); if (empty($paramarr['perpage'])) { $paramarr['perpage'] = 20; } if (empty($_SGET['page'])) { $_SGET['page'] = 1; } $_SGET['page'] = intval($_SGET['page']); if ($_SGET['page'] < 1) { $_SGET['page'] = 1; } $start = ($_SGET['page'] - 1) * $paramarr['perpage']; $sql['limit'] = 'LIMIT ' . $start . ',' . $paramarr['perpage']; } else { if (empty($paramarr['limit'])) { $sql['limit'] = 'LIMIT 0,1'; } else { $paramarr['limit'] = getdotstring($paramarr['limit'], 'int', true, array(), 1, false); if ($paramarr['limit']) { $sql['limit'] = 'LIMIT ' . $paramarr['limit']; } else { $sql['limit'] = 'LIMIT 0,1'; } } } //query $sqlstring = implode(' ', $sql); //multi $listcount = 1; if (!empty($paramarr['perpage'])) { $listcount = $_SGLOBAL['db_uch']->result($_SGLOBAL['db_uch']->query('SELECT COUNT(*) FROM ' . tname('album', '2') . ' ' . $sql['where']), 0); if ($listcount) { $urlarr = $_SGET; unset($urlarr['page']); $theblockarr['multipage'] = multi($listcount, $paramarr['perpage'], $_SGET['page'], $urlarr, 0); } } } else { $uchdb = $_SGLOBAL['db_uch']; include_once S_ROOT . './function/block_sql.func.php'; list($sqlstring, $listcount) = runsql($paramarr, $uchdb); } //查询数据 if ($listcount) { //预处理 if (empty($paramarr['subjectdot'])) { $paramarr['subjectdot'] = 0; } //查询 $query = $_SGLOBAL['db_uch']->query($sqlstring); while ($value = $_SGLOBAL['db_uch']->fetch_array($query)) { //图片处理 $value['pic'] = mkpicurl($value); //标题处理 $value['subjectall'] = $value['albumname']; //连接处理 if ($_SCONFIG['bbsurltype'] == 'bbs' || !empty($paramarr['bbsurltype']) && $paramarr['bbsurltype'] == 'bbs') { $value['url'] = $_SC['uchurl'] . '/space.php?uid=' . $value['uid'] . '&do=album&id=' . $value['albumid']; } else { $value['url'] = geturl('action/imagelist/uid/' . $value['uid'] . '/id/' . $value['albumid']); } if (!empty($value['albumname']) && !empty($paramarr['subjectlen'])) { $value['albumname'] = cutstr($value['albumname'], $paramarr['subjectlen'], $paramarr['subjectdot']); } $theblockarr[] = $value; } } return $theblockarr; }
function newMediaObject($uid, $username, $password, $mediaobject = array()) { global $_SGLOBAL, $space; $fileext = fileext($mediaobject['name']); if (!in_array($fileext, array('jpg', 'gif', 'png'))) { $this->sendFault(500, 'You should choose image file to upload.'); } $this->authUser($username, $password); include_once S_ROOT . './source/function_cp.php'; $struct = array(); if ($stream_save = stream_save(sstripslashes($mediaobject['bits']), '0', $fileext)) { $struct['url'] = mkpicurl($stream_save, 0); } else { $this->sendFault(500, 'Sorry, your image could not be uploaded. Something wrong happened.'); } if (!preg_match("/^(http\\:\\/\\/|\\/)/i", $struct['url'])) { $struct['url'] = $this->siteUrl . $struct['url']; } return $struct; }
function blog_post($POST, $olds = array()) { global $_SGLOBAL, $_SC; //操作者角色切换 if (!empty($olds['uid'])) { $__SGLOBAL = $_SGLOBAL; $_SGLOBAL['supe_uid'] = $olds['uid']; $_SGLOBAL['supe_username'] = addslashes($olds['username']); } //标题 $POST['subject'] = getstr(trim($POST['subject']), 80, 1, 1, 1); if (strlen($POST['subject']) < 1) { $POST['subject'] = sgmdate('Y-m-d'); } $POST['friend'] = intval($POST['friend']); //隐私 $POST['target_ids'] = ''; if ($POST['friend'] == 2) { //特定好友 $uids = array(); $names = empty($_POST['target_names']) ? array() : explode(' ', str_replace(cplang('tab_space'), ' ', $_POST['target_names'])); if ($names) { $query = $_SGLOBAL['db']->query("SELECT uid FROM " . tname('space') . " WHERE username IN (" . simplode($names) . ")"); while ($value = $_SGLOBAL['db']->fetch_array($query)) { $uids[] = $value['uid']; } } if (empty($uids)) { $POST['friend'] = 3; //仅自己可见 } else { $POST['target_ids'] = implode(',', $uids); } } elseif ($POST['friend'] == 4) { //加密 $POST['password'] = trim($POST['password']); if ($POST['password'] == '') { $POST['friend'] = 0; } //公开 } if ($POST['friend'] !== 2) { $POST['target_ids'] = ''; } if ($POST['friend'] !== 4) { $POST['password'] == ''; } $POST['tag'] = shtmlspecialchars(trim($POST['tag'])); $POST['tag'] = getstr($POST['tag'], 500, 1, 1, 1); //语词屏蔽 //内容 $POST['message'] = checkhtml($POST['message']); $POST['message'] = getstr($POST['message'], 0, 1, 0, 1, 0, 1); $POST['message'] = preg_replace("/\\<div\\>\\<\\/div\\>/i", '', $POST['message']); $message = $POST['message']; //个人分类 if (empty($olds['classid']) || $POST['classid'] != $olds['classid']) { if (!empty($POST['classid']) && substr($POST['classid'], 0, 4) == 'new:') { //分类名 $classname = shtmlspecialchars(trim(substr($POST['classid'], 4))); $classname = getstr($classname, 0, 1, 1, 1); if (empty($classname)) { $classid = 0; } else { $classid = getcount('class', array('classname' => $classname, 'uid' => $_SGLOBAL['supe_uid']), 'classid'); if (empty($classid)) { $setarr = array('classname' => $classname, 'uid' => $_SGLOBAL['supe_uid'], 'dateline' => $_SGLOBAL['timestamp']); $classid = inserttable('class', $setarr, 1); } } } else { $classid = intval($POST['classid']); } } else { $classid = $olds['classid']; } if ($classid && empty($classname)) { //是否是自己的 $classname = getcount('class', array('classid' => $classid, 'uid' => $_SGLOBAL['supe_uid']), 'classname'); if (empty($classname)) { $classid = 0; } } //主表 $blogarr = array('subject' => $POST['subject'], 'classid' => $classid, 'friend' => $POST['friend'], 'password' => $POST['password'], 'noreply' => empty($_POST['noreply']) ? 0 : 1); //标题图片 $titlepic = ''; //获取上传的图片 $uploads = array(); if (!empty($POST['picids'])) { $picids = array_keys($POST['picids']); $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('pic') . " WHERE picid IN (" . simplode($picids) . ") AND uid='{$_SGLOBAL['supe_uid']}'"); while ($value = $_SGLOBAL['db']->fetch_array($query)) { if (empty($titlepic) && $value['thumb']) { $titlepic = $value['filepath'] . '.thumb.jpg'; $blogarr['picflag'] = $value['remote'] ? 2 : 1; } $uploads[$POST['picids'][$value['picid']]] = $value; } if (empty($titlepic) && $value) { $titlepic = $value['filepath']; $blogarr['picflag'] = $value['remote'] ? 2 : 1; } } //插入文章 if ($uploads) { preg_match_all("/\\<img\\s.*?\\_uchome\\_localimg\\_([0-9]+).+?src\\=\"(.+?)\"/i", $message, $mathes); if (!empty($mathes[1])) { $searchs = $idsearchs = array(); $replaces = array(); foreach ($mathes[1] as $key => $value) { if (!empty($mathes[2][$key]) && !empty($uploads[$value])) { $searchs[] = $mathes[2][$key]; $idsearchs[] = "_uchome_localimg_{$value}"; $replaces[] = mkpicurl($uploads[$value], 0); unset($uploads[$value]); } } if ($searchs) { $message = str_replace($searchs, $replaces, $message); $message = str_replace($idsearchs, 'uchomelocalimg[]', $message); } } //未插入文章 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']}'"); } else { //积分 updatespacestatus('get', 'blog'); } //feed if (empty($olds) && $blogarr['friend'] != 3) { //事件feed $fs = array(); $fs['icon'] = 'blog'; $fs['title_data'] = array(); $fs['images'] = $fs['image_links'] = array(); if ($blogarr['friend'] == 4) { //加密日志feed $fs['title_template'] = cplang('feed_blog_password'); $fs['title_data'] = array('subject' => "<a href=\"space.php?uid={$_SGLOBAL['supe_uid']}&do=blog&id={$blogid}\">{$blogarr['subject']}</a>"); $fs['body_template'] = ''; $fs['body_data'] = array(); } else { if ($blogarr['pic']) { $fs['images'] = array(mkpicurl($blogarr)); $fs['image_links'] = array("space.php?uid={$_SGLOBAL['supe_uid']}&do=blog&id={$blogid}"); } $fs['title_template'] = cplang('feed_blog'); $fs['body_template'] = '<b>{subject}</b><br>{summary}'; $fs['body_data'] = array('subject' => "<a href=\"space.php?uid={$_SGLOBAL['supe_uid']}&do=blog&id={$blogid}\">{$blogarr['subject']}</a>", 'summary' => getstr($message, 150, 1, 1, 0, 0, -1)); } $fs['body_general'] = ''; $fs['target_ids'] = $fieldarr['target_ids']; $fs['friend'] = $blogarr['friend']; if (ckprivacy('blog', 1)) { include_once S_ROOT . './source/function_cp.php'; 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']); } } //角色切换 if (!empty($__SGLOBAL)) { $_SGLOBAL = $__SGLOBAL; } return $blogarr; }
$picsql = $picid ? "picid='{$picid}' AND " : ''; if ($albumid > 0) { $wheresql = "albumid='{$albumid}'"; $count = $album['picnum']; } else { $wheresql = "albumid='0' AND uid='{$_SGLOBAL['supe_uid']}'"; $count = $_SGLOBAL['db']->result($_SGLOBAL['db']->query("SELECT COUNT(*) FROM " . tname('pic') . " WHERE {$picsql} {$wheresql}"), 0); } $list = array(); if ($count) { $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('pic') . " WHERE {$picsql} {$wheresql} ORDER BY dateline DESC LIMIT {$start},{$perpage}"); while ($value = $_SGLOBAL['db']->fetch_array($query)) { $value['title'] = html2bbcode($value['title']); //转换 $value['pic'] = mkpicurl($value); $value['bigpic'] = mkpicurl($value, 0); $list[] = $value; } } $multi = multi($count, $perpage, $page, "cp.php?ac=album&op=editpic&albumid={$albumid}"); //相册列表 $albumlist = getalbums($_SGLOBAL['supe_uid']); } elseif ($_GET['op'] == 'setpic') { $picid = empty($_GET['picid']) ? 0 : intval($_GET['picid']); $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('pic') . " WHERE picid='{$picid}' AND uid='{$_SGLOBAL['supe_uid']}'"); if ($pic = $_SGLOBAL['db']->fetch_array($query)) { if ($pic['albumid']) { $pic['picflag'] = $pic['remote'] ? 2 : 1; $pic['filepath'] = $pic['filepath'] . ($pic['thumb'] ? '.thumb.jpg' : ''); updatetable('album', array('pic' => $pic['filepath'], 'picflag' => $pic['picflag']), array('albumid' => $pic['albumid'])); }
function album_feed($albumid) { global $_SGLOBAL, $space; if ($albumid > 0) { //得到最新的4张图片 $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('album') . " WHERE albumid='{$albumid}' AND uid='{$_SGLOBAL['supe_uid']}'"); if (!($album = $_SGLOBAL['db']->fetch_array($query))) { return false; } if ($album['friend'] > 2) { return false; } //隐私设置 } else { $picnum = $_SGLOBAL['db']->result($_SGLOBAL['db']->query("SELECT COUNT(*) FROM " . tname('pic') . " WHERE uid='{$_SGLOBAL['supe_uid']}' AND albumid='0'"), 0); if ($picnum < 1) { return false; } $album = array('uid' => $_SGLOBAL['supe_uid'], 'albumid' => -1, 'albumname' => cplang('default_albumname'), 'picnum' => $picnum, 'target_ids' => '', 'friend' => 0); $albumid = 0; } if (empty($space)) { $space = getspace($_SGLOBAL['supe_uid']); } if (empty($space)) { return false; } //图片 $fs = array(); $nowdateline = $_SGLOBAL['timestamp'] - 600; //10分钟内上传的图片 $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('pic') . " WHERE albumid='{$albumid}' AND uid='{$_SGLOBAL['supe_uid']}' AND dateline>'{$nowdateline}' ORDER BY dateline DESC LIMIT 0,4"); while ($value = $_SGLOBAL['db']->fetch_array($query)) { $fs['images'][] = mkpicurl($value); $fs['image_links'][] = "space.php?uid={$value['uid']}&do=album&picid={$value['picid']}"; } if (empty($fs['images'])) { return false; } $fs['icon'] = 'album'; $fs['title_template'] = '{actor} ' . cplang('upload_a_new_picture'); $fs['title_data'] = array(); $fs['body_template'] = '<b>{album}</b><br>' . cplang('the_total_picture', array('{picnum}')); $fs['body_data'] = array('album' => "<a href=\"space.php?uid={$album['uid']}&do=album&id={$album['albumid']}\">{$album['albumname']}</a>", 'picnum' => $album['picnum']); $fs['body_general'] = ''; if (ckprivacy('upload', 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'], $album['target_ids'], $album['friend']); } }
if (isblacklist($pic['uid'])) { showmessage('is_blacklist'); } if (empty($pic['albumid'])) { $pic['albumid'] = 0; } if (empty($pic['albumname'])) { $pic['albumname'] = cplang('default_albumname'); } //实名 realname_set($pic['uid'], $pic['username']); realname_get(); $arr['title_template'] = cplang('share_image'); $arr['body_template'] = cplang('album') . ': <b>{albumname}</b><br>{username}<br>{title}'; $arr['body_data'] = array('albumname' => "<a href=\"space.php?uid={$pic['uid']}&do=album&id={$pic['albumid']}\">{$pic['albumname']}</a>", 'username' => "<a href=\"space.php?uid={$pic['uid']}\">" . $_SN[$pic['uid']] . "</a>", 'title' => getstr($pic['title'], 100, 0, 1, 0, 0, -1)); $arr['image'] = mkpicurl($pic); $arr['image_link'] = "space.php?uid={$pic['uid']}&do=album&picid={$pic['picid']}"; //通知 $note_uid = $pic['uid']; $note_message = cplang('note_share_pic', array("space.php?uid={$pic['uid']}&do=album&picid={$pic['picid']}", $pic['albumname'])); break; case 'thread': $query = $_SGLOBAL['db']->query("SELECT t.*, p.message FROM " . tname('thread') . " t\r\n\t\t\t\tLEFT JOIN " . tname('post') . " p ON p.tid=t.tid AND p.isthread='1'\r\n\t\t\t\tWHERE t.tid='{$id}'"); if (!($thread = $_SGLOBAL['db']->fetch_array($query))) { showmessage('topics_does_not_exist'); } //黑名单 if (isblacklist($thread['uid'])) { showmessage('is_blacklist'); } include_once S_ROOT . './data/data_profield.php';
if (empty($value['pic'])) { $value['pic'] = 'image/nologo.jpg'; } $netcache['mtaglist'][] = $value; } //幻灯图片 $netcache['piclist'] = array(); if (empty($network['slide'])) { $sql = "," . tname('album') . " a WHERE a.friend='0' AND a.albumid=p.albumid ORDER BY p.dateline DESC LIMIT 0,5"; } else { eval("\$network['slide'] = \"{$network['slide']}\";"); $sql = ' ' . trim($network['slide']); } $query = $_SGLOBAL['db']->query("SELECT p.* FROM " . tname('pic') . " p {$sql}"); while ($value = $_SGLOBAL['db']->fetch_array($query)) { $value['pic'] = mkpicurl($value, 0); $value['title'] = getstr($value['title'], 50, 0, 1, 0, 0, -1); $netcache['piclist'][] = $value; } realname_get(); $netcache['SN'] = $_SN; //写缓存操作 if ($writestate) { include_once S_ROOT . './source/function_cache.php'; cache_write('network', "netcache", $netcache); @unlink($lockfile); } } if ($netcache['mtaglist']) { @(include_once S_ROOT . './data/data_profield.php'); }
function _convertAlbum($albumInfo) { $siteUrl = $this->_getUchomeUrl(); if ($albumInfo && is_array($albumInfo)) { $convAlbum = array(); $convAlbum['aId'] = $albumInfo['albumid']; $convAlbum['name'] = $albumInfo['albumname']; $convAlbum['created'] = $albumInfo['dateline']; $convAlbum['updated'] = $albumInfo['updatetime']; $convAlbum['privacy'] = $this->_convertPrivacy($albumInfo['friend'], true); $convAlbum['passwd'] = $albumInfo['passwd']; $convAlbum['friendIds'] = $albumInfo['target_ids'] ? explode(',', $albumInfo['target_ids']) : ''; $convAlbum['cover'] = $albumInfo['pic'] ? $siteUrl . mkpicurl($albumInfo) : ''; $convAlbum['url'] = $siteUrl . 'space.php?uid=' . $albumInfo['uid'] . '&do=album&id=' . $albumInfo['albumid']; } else { $convAlbum = false; } return $convAlbum; }
foreach ($mathes[1] as $key => $value) { if (!empty($mathes[2][$key]) && !empty($uploads[$value])) { $searchs[] = $mathes[2][$key]; $idsearchs[] = "_uchome_localimg_{$value}"; $replaces[] = mkpicurl($uploads[$value], 0); unset($uploads[$value]); } } if ($searchs) { $message = str_replace($searchs, $replaces, $message); $message = str_replace($idsearchs, 'uchomelocalimg[]', $message); } } //未插入文章 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)+/is", '', $message); if (strlen($message) < 2) { showmessage('content_is_not_less_than_four_characters'); } //添加slashes $message = addslashes($message); if (empty($_POST['tid'])) { //从内容中读取图片 if (empty($titlepic)) { $titlepic = getmessagepic($message); }
$fs['title_template'] = cplang('feed_comment_space'); $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'] = ''; $fs['images'] = array(); $fs['image_links'] = array(); break; case 'picid': //事件 $fs['title_template'] = cplang('feed_comment_image'); $fs['title_data'] = array('touser' => "<a href=\"space.php?uid={$tospace['uid']}\">" . $_SN[$tospace['uid']] . "</a>"); $fs['body_template'] = '{pic_title}'; $fs['body_data'] = array('pic_title' => $pic['title']); $fs['body_general'] = $summay; $fs['images'] = array(mkpicurl($pic)); $fs['image_links'] = array("space.php?uid={$tospace['uid']}&do=album&picid={$pic['picid']}"); $fs['target_ids'] = $album['target_ids']; $fs['friend'] = $album['friend']; break; case 'blogid': //更新评论统计 $_SGLOBAL['db']->query("UPDATE " . tname('blog') . " SET replynum=replynum+1 WHERE blogid='{$id}'"); //事件 $fs['title_template'] = cplang('feed_comment_blog'); $fs['title_data'] = array('touser' => "<a href=\"space.php?uid={$tospace['uid']}\">" . $_SN[$tospace['uid']] . "</a>", 'blog' => "<a href=\"space.php?uid={$tospace['uid']}&do=blog&id={$id}\">{$blog['subject']}</a>"); $fs['body_template'] = ''; $fs['body_data'] = array(); $fs['body_general'] = ''; $fs['target_ids'] = $blog['target_ids']; $fs['friend'] = $blog['friend'];