function ckfriend_album($album) { global $_SGLOBAL; if (!ckfriend($album['uid'], $album['friend'], $album['target_ids'])) { $result = array('flag' => 'no_privilege'); returnvalue($result); exit; } elseif ($album['uid'] != $_SGLOBAL['supe_uid'] && $album['friend'] == 4) { $result = array('flag' => 'need_password'); returnvalue($result); exit; } }
} //去除<i> end //去除<div> start preg_match_all("#[<]div[>](.*)[<][\][/]div[>]#U",$blog['message'], $matches, PREG_SET_ORDER); foreach($matches as $item){ $MatchString = $item[0]; $HrefString = $item[1]; $blog['message'] = str_replace($MatchString, "\n".$HrefString, $blog['message']); } //去除<div> end*/ //$blog['message'] = str_replace("#[<][/]div[>]#U", "[/]n", $blog['message']); //访问统计 if ($userid != $blog['uid']) { $_SGLOBAL['db']->query("UPDATE " . tname('blog') . " SET viewnum=viewnum+1 WHERE blogid='{$blog['blogid']}'"); inserttable('log', array('id' => $userid, 'idtype' => 'uid')); //延迟更新 } $result = array('flag' => 'success', 'blog_authorpic' => avatar($blog[uid], small), 'blog_title' => $blog[subject], 'blog_text' => $blog[message], 'blog_author' => $_SN[$blog[uid]], 'blog_authorid' => $blog[uid], 'blog_image' => $blog[pic], 'blog_noreply' => $blog[noreply], 'blog_readnum' => $blog[viewnum], 'blog_replynum' => $blog[replynum], 'blog_time' => $blog[dateline]); returnvalue($result); function returnvalue($result) { $result = json_encode($result); $result = preg_replace("#\\\\u([0-9a-f]{4})#ie", "iconv('UCS-2BE', 'UTF-8', pack('H4', '\\1'))", $result); echo $result; exit; } //如果输出结果为空,则次日志不存在或已被删除