本文整理汇总了PHP中ckfriend函数的典型用法代码示例。如果您正苦于以下问题:PHP ckfriend函数的具体用法?PHP ckfriend怎么用?PHP ckfriend使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ckfriend函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getAlbumImagePic
public static function getAlbumImagePic($value)
{
loadcache('albumcategory');
require_once DISCUZ_ROOT . './source/function/function_home.php';
if ($value['friend'] != 4 && ckfriend($value['uid'], $value['friend'], $value['target_ids'])) {
$value['pic'] = pic_cover_get($value['pic'], $value['picflag']);
} elseif ($value['picnum']) {
$value['pic'] = STATICURL . 'image/common/nopublish.gif';
} else {
$value['pic'] = '';
}
return $value['pic'];
}
示例2: array
}
$actives = array($_GET['view'] => ' class="a"');
if ($need_count) {
if ($searchkey = stripsearchkey($_GET['searchkey'])) {
$searchsubject = $searchkey;
$searchkey = dhtmlspecialchars($searchkey);
}
$catid = empty($_GET['catid']) ? 0 : intval($_GET['catid']);
$count = C::t('home_blog')->count_all_by_search(null, $uids, null, null, $gthot, null, null, null, null, null, $privacyfriend, null, null, null, $classid, $catid, $searchsubject, true, $status);
if ($count) {
$query = C::t('home_blog')->fetch_all_by_search(1, null, $uids, null, null, $gthot, null, null, null, null, null, $privacyfriend, null, null, null, 'dateline', 'DESC', $start, $perpage, $classid, $catid, $searchsubject, $f_index, false, $status);
}
}
if ($count) {
foreach ($query as $value) {
if (ckfriend($value['uid'], $value['friend'], $value['target_ids']) && ($value['status'] == 0 || $value['uid'] == $_G['uid'] || $_G['adminid'] == 1)) {
if (!empty($stickblogs) && in_array($value['blogid'], $stickblogs)) {
continue;
}
if ($value['friend'] == 4) {
$value['message'] = $value['pic'] = '';
} else {
$value['message'] = getstr($value['message'], $summarylen, 0, 0, 0, -1);
}
$value['message'] = preg_replace("/&[a-z]+\\;/i", '', $value['message']);
if ($value['pic']) {
$value['pic'] = pic_cover_get($value['pic'], $value['picflag']);
}
$value['dateline'] = dgmdate($value['dateline']);
$list[] = $value;
} else {
示例3: intval
}
$sql .= $friend ? " AND a.friend = '{$friend}'" : '';
$orderby = $orderby ? "a.{$orderby}" : 'a.updatetime';
$ordersc = $ordersc ? "{$ordersc}" : 'DESC';
if ($_G['adminid'] == 2 && $endtime - $starttime > 86400 * 16 || $_G['adminid'] == 3 && $endtime - $starttime > 86400 * 8) {
$error = 'album_mod_range_illegal';
}
if (!$error) {
if ($detail) {
$_G['gp_perpage'] = intval($_G['gp_perpage']) < 1 ? 20 : intval($_G['gp_perpage']);
$perpage = $_G['gp_pp'] ? $_G['gp_pp'] : $_G['gp_perpage'];
$query = DB::query("SELECT * FROM " . DB::table('home_album') . " a WHERE 1 {$sql} ORDER BY {$orderby} {$ordersc} LIMIT " . ($page - 1) * $perpage . ",{$perpage}");
$albums = '';
include_once libfile('function/home');
while ($album = DB::fetch($query)) {
if ($album['friend'] != 4 && ckfriend($album['uid'], $album['friend'], $album['target_ids'])) {
$album['pic'] = pic_cover_get($album['pic'], $album['picflag']);
} else {
$album['pic'] = STATICURL . 'image/common/nopublish.gif';
}
$album['updatetime'] = dgmdate($album['updatetime']);
switch ($album['friend']) {
case '0':
$privacy_name = $lang[setting_home_privacy_alluser];
break;
case '1':
$privacy_name = $lang[setting_home_privacy_friend];
break;
case '2':
$privacy_name = $lang[setting_home_privacy_specified_friend];
break;
示例4: ckfriend_album
function ckfriend_album($album)
{
global $_G, $space;
if ($_G['adminid'] != 1) {
if (!ckfriend($album['uid'], $album['friend'], $album['target_ids'])) {
if (empty($_G['uid'])) {
showmessage('to_login', null, array(), array('showmsg' => true, 'login' => 1));
}
require_once libfile('function/friend');
$isfriend = friend_check($album['uid']);
space_merge($space, 'count');
space_merge($space, 'profile');
$_G['privacy'] = 1;
require_once libfile('space/profile', 'include');
include template('home/space_privacy');
exit;
} elseif (!$space['self'] && $album['friend'] == 4) {
$cookiename = "view_pwd_album_{$album['albumid']}";
$cookievalue = empty($_G['cookie'][$cookiename]) ? '' : $_G['cookie'][$cookiename];
if ($cookievalue != md5(md5($album['password']))) {
$invalue = $album;
include template('home/misc_inputpwd');
exit;
}
}
}
}
示例5: ckfriend_album
function ckfriend_album($album)
{
global $_SGLOBAL, $_SC, $_SCONFIG, $_SCOOKIE, $space, $_SN;
if (!ckfriend($album['uid'], $album['friend'], $album['target_ids'])) {
//没有权限
include template('space_privacy');
exit;
} elseif (!$space['self'] && $album['friend'] == 4) {
//密码输入问题
$cookiename = "view_pwd_album_{$album['albumid']}";
$cookievalue = empty($_SCOOKIE[$cookiename]) ? '' : $_SCOOKIE[$cookiename];
if ($cookievalue != md5(md5($album['password']))) {
$invalue = $album;
include template('do_inputpwd');
exit;
}
}
}
示例6: ckfriend_album
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;
}
}
示例7: while
//个人动态
while ($value = $_SGLOBAL['db']->fetch_array($query)) {
if (ckfriend($value) && ckicon_uid($value)) {
realname_set($value['uid'], $value['username']);
$feed_list[] = $value;
}
$count++;
}
//分页
$multi = smulti($start, $perpage, $count, $theurl);
} else {
//好友动态
$space['filter_icon'] = empty($space['privacy']['filter_icon']) ? array() : array_keys($space['privacy']['filter_icon']);
while ($value = $_SGLOBAL['db']->fetch_array($query)) {
if (empty($feed_list[$value['hash_data']][$value['uid']])) {
if (ckfriend($value) && ckicon_uid($value)) {
realname_set($value['uid'], $value['username']);
$feed_list[$value['hash_data']][$value['uid']] = $value;
}
}
$count++;
}
}
$olfriendlist = $visitorlist = $task = $ols = $birthlist = $myapp = array();
$namestatus = $addfriendcount = $mtaginvitecount = $myinvitecount = $pokecount = $newreport = 0;
if ($space['self'] && empty($start)) {
//好友申请
$addfriendcount = getcount('friend', array('fuid' => $space['uid'], 'status' => 0));
//群组邀请
$mtaginvitecount = getcount('mtaginvite', array('uid' => $space['uid']));
//应用请求
示例8: str_replace
//echo 111111111111111111111111111111111111111111;
//print_r($HrefString);
//echo "----matchstring: $MatchString----tmpstring: $TmpString----username: $HrefString\n";
$blog['message'] = str_replace($TmpString, $HrefString, $blog['message']);
}
//将日志中的图片进行绝对路径化。 end
*/
//检查权限 start
if (empty($blog)) {
$result = array('flag' => 'blog_not_exist');
returnblog($result);
}
//检查好友权限
if (!ckfriend($blog['uid'], $blog['friend'], $blog['target_ids'])) {
//没有权限
$result = array('flag' => 'no_privilege');
returnblog($result);
} elseif ($userid != $blog['uid'] && $blog['friend'] == 4) {
//密码输入问题
$result = array('flag' => 'need_password');
returnblog($result);
}
//检查权限 end
realname_set($blog['uid'], $blog[username]);
realname_get();
//访问统计
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'));
示例9: add_comment
function add_comment($message, $id, $idtype, $cid = 0)
{
global $_G, $bbcode;
$allowcomment = false;
switch ($idtype) {
case 'uid':
$allowcomment = helper_access::check_module('wall');
break;
case 'picid':
$allowcomment = helper_access::check_module('album');
break;
case 'blogid':
$allowcomment = helper_access::check_module('blog');
break;
case 'sid':
$allowcomment = helper_access::check_module('share');
break;
}
if (!$allowcomment) {
showmessage('quickclear_noperm');
}
$summay = getstr($message, 150, 0, 0, 0, -1);
$comment = array();
if ($cid) {
$comment = C::t('home_comment')->fetch_by_id_idtype($id, $idtype, $cid);
if ($comment && $comment['authorid'] != $_G['uid']) {
$comment['message'] = preg_replace("/\\<div class=\"quote\"\\>\\<blockquote\\>.*?\\<\\/blockquote\\>\\<\\/div\\>/is", '', $comment['message']);
$comment['message'] = $bbcode->html2bbcode($comment['message']);
$message = "<div class=\"quote\"><blockquote><b>" . $comment['author'] . "</b>: " . getstr($comment['message'], 150, 0, 0, 2, 1) . '</blockquote></div>' . $message;
if ($comment['idtype'] == 'uid') {
$id = $comment['authorid'];
}
} else {
$comment = array();
}
}
$hotarr = array();
$stattype = '';
$tospace = $pic = $blog = $album = $share = $poll = array();
switch ($idtype) {
case 'uid':
$tospace = getuserbyuid($id);
$stattype = 'wall';
break;
case 'picid':
$pic = C::t('home_pic')->fetch($id);
if (empty($pic)) {
showmessage('view_images_do_not_exist');
}
$picfield = C::t('home_picfield')->fetch($id);
$pic['hotuser'] = $picfield['hotuser'];
$tospace = getuserbyuid($pic['uid']);
$album = array();
if ($pic['albumid']) {
$query = C::t('home_album')->fetch($pic['albumid']);
if (!$query['albumid']) {
C::t('home_pic')->update_for_albumid($albumid, array('albumid' => 0));
}
}
if (!ckfriend($album['uid'], $album['friend'], $album['target_ids'])) {
showmessage('no_privilege_ckfriend_pic');
} elseif (!$tospace['self'] && $album['friend'] == 4) {
$cookiename = "view_pwd_album_{$album['albumid']}";
$cookievalue = empty($_G['cookie'][$cookiename]) ? '' : $_G['cookie'][$cookiename];
if ($cookievalue != md5(md5($album['password']))) {
showmessage('no_privilege_ckpassword_pic');
}
}
$hotarr = array('picid', $pic['picid'], $pic['hotuser']);
$stattype = 'piccomment';
break;
case 'blogid':
$blog = array_merge(C::t('home_blog')->fetch($id), C::t('home_blogfield')->fetch_targetids_by_blogid($id));
if (empty($blog)) {
showmessage('view_to_info_did_not_exist');
}
$tospace = getuserbyuid($blog['uid']);
if (!ckfriend($blog['uid'], $blog['friend'], $blog['target_ids'])) {
showmessage('no_privilege_ckfriend_blog');
} elseif (!$tospace['self'] && $blog['friend'] == 4) {
$cookiename = "view_pwd_blog_{$blog['blogid']}";
$cookievalue = empty($_G['cookie'][$cookiename]) ? '' : $_G['cookie'][$cookiename];
if ($cookievalue != md5(md5($blog['password']))) {
showmessage('no_privilege_ckpassword_blog');
}
}
if (!empty($blog['noreply'])) {
showmessage('do_not_accept_comments');
}
if ($blog['target_ids']) {
$blog['target_ids'] .= ",{$blog['uid']}";
}
$hotarr = array('blogid', $blog['blogid'], $blog['hotuser']);
$stattype = 'blogcomment';
break;
case 'sid':
$share = C::t('home_share')->fetch($id);
if (empty($share)) {
showmessage('sharing_does_not_exist');
}
//.........这里部分代码省略.........
示例10: getblockhtml
//.........这里部分代码省略.........
}
}
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;
}
$data_blog = C::t('home_blog')->fetch_all($bids);
if ($parameters['showmessage'] > 0) {
$data_blogfield = C::t('home_blogfield')->fetch_all($bids);
}
foreach ($data_blog as $curblogid => $value) {
if (ckfriend($value['uid'], $value['friend'], $value['target_ids'])) {
if ($parameters['showmessage'] > 0) {
$value = array_merge($value, (array) $data_blogfield[$curblogid]);
}
if ($value['pic']) {
$value['pic'] = pic_cover_get($value['pic'], $value['picflag']);
}
$value['message'] = $value['friend'] == 4 ? '' : getstr($value['message'], $parameters['showmessage'], 0, 0, 0, -1);
$html .= lang('space', 'blog_li', array('uid' => $value['uid'], 'blogid' => $value['blogid'], 'subject' => $value['subject'], 'date' => dgmdate($value['dateline'], 'Y-m-d')));
if (!empty($parameters['showmessage'])) {
if ($value['pic']) {
$html .= lang('space', 'blog_li_img', array('uid' => $value['uid'], 'blogid' => $value['blogid'], 'src' => $value['pic']));
}
$html .= "<dd>{$value['message']}</dd>";
}
$html .= lang('space', 'blog_li_ext', array('uid' => $value['uid'], 'blogid' => $value['blogid'], 'viewnum' => $value['viewnum'], 'replynum' => $value['replynum']));
$html .= "</dl>";
} else {
$html .= '<p>' . lang('space', 'block_view_noperm') . '</p>';
}
}
}
}
$more = $html ? '<p class="ptm" style="text-align: right;"><a href="home.php?mod=space&uid=' . $uid . '&do=blog&view=me&from=space">' . lang('space', 'viewmore') . '</a></p>' : '';
$contentclassname = ' xld';
$html = $html . $more;
break;
case 'blog':
$do = $blockname;
$view = 'me';
$from = 'space';
if (!isset($parameters['showmessage'])) {
$parameters['showmessage'] = 150;
示例11: getblockhtml
function getblockhtml($blockname, $parameters = array())
{
global $_G, $space;
$parameters = empty($parameters) ? array() : $parameters;
$list = array();
$sql = $title = $html = $wheresql = $ordersql = '';
$shownum = 6;
$uid = intval($space['uid']);
$shownum = empty($parameters['shownum']) ? $shownum : intval($parameters['shownum']);
switch ($blockname) {
case 'profile':
$html .= '<div class="avt avtm">' . avatar($space['uid'], 'middle');
$html .= '<h2>' . $space['username'] . '</h2>';
$html .= '</div><ul class="xl xl2 cl">';
if ($space['self']) {
$html .= '<li><a href="home.php?mod=space&diy=yes">' . lang('space', 'block_profile_diy') . '</a></li>';
$html .= '<li><a href="home.php?mod=space&do=wall">' . lang('space', 'block_profile_wall') . '</a></li>';
$html .= '<li><a href="home.php?mod=spacecp&ac=avatar">' . lang('space', 'block_profile_avatar') . '</a></li>';
$html .= '<li><a href="home.php?mod=spacecp&ac=profile">' . lang('space', 'block_profile_update') . '</a></li>';
} else {
require_once libfile('function/friend');
$isfriend = friend_check($space['uid']);
if (!$isfriend) {
$html .= "<li><a href=\"home.php?mod=spacecp&ac=friend&op=add&uid={$space['uid']}&handlekey=addfriendhk_{$space[uid]}\" id=\"a_friend_li_{$space[uid]}\" onclick=\"showWindow(this.id, this.href, 'get', 0);\">" . lang('space', 'block_profile_friend_add') . "</a></li>";
} else {
$html .= "<li><a href=\"home.php?mod=spacecp&ac=friend&op=ignore&uid={$space['uid']}&handlekey=ignorefriendhk_{$space[uid]}\" id=\"a_ignore_{$space[uid]}\" onclick=\"showWindow(this.id, this.href, 'get', 0);\">" . lang('space', 'block_profile_friend_ignore') . "</a></li>";
}
$html .= "<li><a href=\"home.php?mod=space&uid={$space['uid']}&do=wall\">" . lang('space', 'block_profile_wall_to_me') . "</a></li>";
$html .= "<li><a href=\"home.php?mod=spacecp&ac=poke&op=send&uid={$space['uid']}&handlekey=propokehk_{$space[uid]}\" id=\"a_poke_{$space[uid]}\" onclick=\"showWindow(this.id, this.href, 'get', 0);\">" . lang('space', 'block_profile_poke') . "</a></li>";
$html .= "<li><a href=\"home.php?mod=spacecp&ac=pm&op=showmsg&handlekey=showmsg_{$space['uid']}&touid={$space['uid']}&pmid=0&daterange=2\" id=\"a_sendpm_{$space['uid']}\" onclick=\"showWindow('showMsgBox', this.href, 'get', 0)\">" . lang('space', 'block_profile_sendmessage') . "</a></li>";
}
$html .= '</ul>';
$html = '<div class="content"><div id="pcd">' . $html . '</div></div>';
break;
case 'doing':
$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)) {
$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>";
}
$html = '<div class="content"><ul class="xl">' . $html . '</ul></div>';
break;
case 'blog':
$query = DB::query("SELECT bf.*, b.* FROM " . DB::table('home_blog') . " b\n\t\t\t\tLEFT JOIN " . DB::table('home_blogfield') . " bf ON bf.blogid=b.blogid\n\t\t\t\tWHERE b.uid='{$uid}'\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']);
}
$value['message'] = $value['friend'] == 4 ? '' : getstr($value['message'], 150, 0, 0, 0, 0, -1);
$html .= lang('space', 'blog_li', array('uid' => $value['uid'], 'blogid' => $value['blogid'], 'subject' => $value['subject'], 'date' => dgmdate($value['dateline'], 'Y-m-d')));
if ($parameters['showmessage']) {
if ($value['pic']) {
$html .= lang('space', 'blog_li_img', array('uid' => $value['uid'], 'blogid' => $value['blogid'], 'src' => $value['pic']));
}
$html .= "<dd>{$value['message']}</dd>";
}
$html .= lang('space', 'blog_li_ext', array('uid' => $value['uid'], 'blogid' => $value['blogid'], 'viewnum' => $value['viewnum'], 'replynum' => $value['replynum']));
$html .= "</dl>";
} else {
$html .= '<p>' . lang('space', 'block_view_noperm') . '</p>';
}
}
$more = $html ? '<p class="ptm" style="text-align: right;"><a href="home.php?mod=space&uid=' . $space['uid'] . '&do=blog&view=me&from=space">' . lang('space', 'viewmore') . '</a></p>' : '';
$html = '<div class="content xld">' . $html . $more . '</div>';
break;
case 'album':
if (ckprivacy('album', 'view')) {
$query = DB::query("SELECT * FROM " . DB::table('home_album') . " WHERE uid='{$uid}' ORDER BY updatetime DESC LIMIT 0,{$shownum}");
while ($value = DB::fetch($query)) {
if (ckfriend($value['uid'], $value['friend'], $value['target_ids'])) {
$value['pic'] = pic_cover_get($value['pic'], $value['picflag']);
$html .= lang('space', 'album_li', array('albumid' => $value['albumid'], 'src' => $value['pic'], 'albumname' => $value['albumname'], 'uid' => $value['uid'], 'picnum' => $value['picnum'], 'date' => dgmdate($value['updatetime'], 'n-j')));
}
}
} else {
$html .= '<li>' . lang('space', 'block_view_noperm') . '</li>';
}
$html = '<div class="content"><ul class="ml mla cl">' . $html . '</ul></div>';
break;
case 'feed':
if (ckprivacy('feed', 'view')) {
require_once libfile('function/feed');
$query = DB::query("SELECT * FROM " . DB::table('home_feed') . " WHERE uid='{$uid}' ORDER BY dateline DESC LIMIT 0,{$shownum}");
while ($value = DB::fetch($query)) {
if (ckfriend($value['uid'], $value['friend'], $value['target_ids'])) {
$html .= mkfeedhtml(mkfeed($value));
//.........这里部分代码省略.........
示例12: intval
include_once '../iauth_verify_forward.php';
$userid = intval(iauth_verify());
include_once '../../../common.php';
$Message = empty($_POST['message']) ? '' : getstr($_POST['message']);
$BlogId = empty($_POST['blogid']) ? 0 : intval($_POST['blogid']);
$Message .= ' ';
/*$userid = 18;
$username = 'seen';
$Message = '88888';
$BlogId = 89;
$_SGLOBAL['supe_uid'] = $userid;
$_SGLOBAL['supe_username'] = $username;*/
getmember();
$query = $_SGLOBAL['db']->query("SELECT bf.target_ids, b.* FROM " . tname('blog') . " b left join " . tname('blogfield') . " bf on b.blogid=bf.blogid where b.blogid={$BlogId} ");
$blog = $_SGLOBAL['db']->fetch_array($query);
if (!ckfriend($blog['uid'], $blog['friend'], $blog['target_ids']) || $blog['noreply'] == 1) {
$arrs = array('flag' => 'no_privilege');
} else {
//处理评论的@功能 Add by xuxing 2012-12-6 start
//提取AT用户
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}");
if ($rs = $_SGLOBAL['db']->fetch_array($result)) {
$realname = $rs['name'];
if (empty($realname)) {
$realname = $rs['username'];
}
示例13: elseif
$list['today'][] = $value;
} elseif ($value['dateline'] >= $_G['home_today'] - 3600 * 24) {
$list['yesterday'][] = $value;
} else {
$theday = dgmdate($value['dateline'], 'Y-m-d');
$list[$theday][] = $value;
}
}
$count++;
}
} else {
$hash_datas = array();
$more_list = array();
$uid_feedcount = array();
while ($value = DB::fetch($query)) {
if (!isset($hotlist[$value['feedid']]) && !isset($hotlist_all[$value['feedid']]) && ckfriend($value['uid'], $value['friend'], $value['target_ids'])) {
$value = mkfeed($value);
if (ckicon_uid($value)) {
if ($value['dateline'] >= $_G['home_today']) {
$dkey = 'today';
} elseif ($value['dateline'] >= $_G['home_today'] - 3600 * 24) {
$dkey = 'yesterday';
} else {
$dkey = dgmdate($value['dateline'], 'Y-m-d');
}
$maxshownum = 3;
if (empty($value['uid'])) {
$maxshownum = 10;
}
if (empty($value['hash_data'])) {
if (empty($feed_users[$dkey][$value['uid']])) {
示例14: intval
$theurl .= "&classid={$classid}";
}
//设置权限
$_GET['friend'] = intval($_GET['friend']);
if ($_GET['friend']) {
$wheresql .= " AND b.friend='{$_GET['friend']}'";
$theurl .= "&friend={$_GET['friend']}";
}
$count = $_SGLOBAL['db']->result($_SGLOBAL['db']->query("SELECT COUNT(*) FROM " . tname('blog') . " b WHERE {$wheresql}"), 0);
if ($count) {
$query = $_SGLOBAL['db']->query("SELECT bf.message, bf.target_ids, b.* FROM " . tname('blog') . " b {$f_index}\r\n\t\t\t\tLEFT JOIN " . tname('blogfield') . " bf ON bf.blogid=b.blogid\r\n\t\t\t\tWHERE {$wheresql}\r\n\t\t\t\tORDER BY b.dateline DESC LIMIT {$start},{$perpage}");
}
}
if ($count) {
while ($value = $_SGLOBAL['db']->fetch_array($query)) {
if (ckfriend($value)) {
realname_set($value['uid'], $value['username']);
$value['message'] = $value['friend'] == 4 ? '' : getstr($value['message'], $summarylen, 0, 0, 0, 0, -1);
$value['pic'] = mkpicurl($value);
$list[] = $value;
$userlist[$value['uid']] = $value['username'];
} else {
$pricount++;
}
}
}
//分页
$multi = multi($count, $perpage, $page, $theurl);
//实名
realname_get();
include_once template("space_blog_list");
示例15: cksearch
$wheresql .= " AND b.subject LIKE '%{$searchkey}%'";
$theurl .= "&searchkey={$_GET['searchkey']}";
cksearch($theurl);
}
$count = $_SGLOBAL['db']->result($_SGLOBAL['db']->query("SELECT COUNT(*) FROM " . tname('bwzt') . " b WHERE {$wheresql}"), 0);
//更新统计
if ($wheresql == "b.uid='{$space['uid']}'" && $space['bwztnum'] != $count) {
updatetable('space', array('bwztnum' => $count), array('uid' => $space['uid']));
}
if ($count) {
$query = $_SGLOBAL['db']->query("SELECT bf.message, bf.target_ids, bf.magiccolor, b.*, s.name FROM " . tname('bwzt') . " b {$f_index}\n\t\t\t\tLEFT JOIN " . tname('space') . " s ON s.uid=b.uid\n\t\t\t\tLEFT JOIN " . tname('bwztfield') . " bf ON bf.bwztid=b.bwztid\n\t\t\t\tWHERE {$wheresql}\n\t\t\t\tORDER BY {$ordersql} DESC LIMIT {$start},{$perpage}");
}
}
if ($count) {
while ($value = $_SGLOBAL['db']->fetch_array($query)) {
if (ckfriend($value['uid'], $value['friend'], $value['target_ids'])) {
realname_set($value['uid'], $value['username']);
if ($value['friend'] == 4) {
$value['message'] = $value['pic'] = '';
} else {
$value['message'] = strip_tags($value['message']);
//剥去字符串中的 HTML 标签
$value['message'] = getstr($value['message'], $summarylen, 0, 0, 0, 0, -1);
}
if ($value['pic']) {
$value['pic'] = pic_cover_get($value['pic'], $value['picflag']);
}
$value['pics'] = json_decode($value['pics']);
//json解密picurls
//增加发布者头像地址
$value['avatar_url'] = avatar($value['uid'], 'middle', TRUE);