First commit
This commit is contained in:
0
source/include/space/index.htm
Normal file
0
source/include/space/index.htm
Normal file
147
source/include/space/space_activity.php
Normal file
147
source/include/space/space_activity.php
Normal file
@@ -0,0 +1,147 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: space_activity.php 30378 2012-05-24 09:52:46Z zhangguosheng $
|
||||
*/
|
||||
|
||||
if(!defined('IN_DISCUZ')) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
|
||||
if (!$_G['setting']['forumstatus']) {
|
||||
showmessage('forum_status_off');
|
||||
}
|
||||
|
||||
$minhot = $_G['setting']['feedhotmin']<1?3:$_G['setting']['feedhotmin'];
|
||||
$page = empty($_GET['page'])?1:intval($_GET['page']);
|
||||
if($page<1) $page=1;
|
||||
$id = empty($_GET['id'])?0:intval($_GET['id']);
|
||||
$opactives['activity'] = 'class="a"';
|
||||
|
||||
$_GET['view'] = in_array($_GET['view'], array('we', 'me', 'all')) ? $_GET['view'] : 'we';
|
||||
$_GET['order'] = in_array($_GET['order'], array('hot', 'dateline')) ? $_GET['order'] : 'dateline';
|
||||
|
||||
$perpage = 20;
|
||||
$perpage = mob_perpage($perpage);
|
||||
$start = ($page-1)*$perpage;
|
||||
ckstart($start, $perpage);
|
||||
|
||||
$list = array();
|
||||
$userlist = array();
|
||||
$hiddennum = $count = $pricount = 0;
|
||||
|
||||
$gets = array(
|
||||
'mod' => 'space',
|
||||
'uid' => $space['uid'],
|
||||
'do' => 'activity',
|
||||
'view' => $_GET['view'],
|
||||
'order' => $_GET['order'],
|
||||
'type' => $_GET['type'],
|
||||
'fuid' => $_GET['fuid'],
|
||||
'searchkey' => $_GET['searchkey']
|
||||
);
|
||||
$theurl = 'home.php?'.url_implode($gets);
|
||||
$multi = '';
|
||||
|
||||
$wheresql = '1';
|
||||
$threadsql = $apply_sql = '';
|
||||
|
||||
$f_index = '';
|
||||
$need_count = true;
|
||||
require_once libfile('function/misc');
|
||||
if($_GET['view'] == 'me') {
|
||||
$viewtype = in_array($_GET['type'], array('orig', 'apply')) ? $_GET['type'] : 'orig';
|
||||
$orderactives = array($viewtype => ' class="a"');
|
||||
} else {
|
||||
|
||||
space_merge($space, 'field_home');
|
||||
|
||||
if($space['feedfriend']) {
|
||||
$fuid_actives = array();
|
||||
require_once libfile('function/friend');
|
||||
$fuid = intval($_GET['fuid']);
|
||||
if($fuid && friend_check($fuid, $space['uid'])) {
|
||||
$fuid_actives = array($fuid=>' selected');
|
||||
$frienduid = $fuid;
|
||||
} else {
|
||||
$theurl = "home.php?mod=space&uid={$space['uid']}&do=$do&view=we";
|
||||
$frienduid = explode(',', $space['feedfriend']);
|
||||
}
|
||||
|
||||
$query = C::t('home_friend')->fetch_all_by_uid($space['uid'], 0, 100, true);
|
||||
foreach($query as $value) {
|
||||
$userlist[] = $value;
|
||||
}
|
||||
} else {
|
||||
$need_count = false;
|
||||
}
|
||||
}
|
||||
|
||||
$actives = array($_GET['view'] =>' class="a"');
|
||||
|
||||
if($need_count) {
|
||||
|
||||
if(!empty($_GET['searchkey'])) {
|
||||
$_GET['searchkey'] = stripsearchkey($_GET['searchkey']);
|
||||
}
|
||||
$count = C::t('forum_activity')->fetch_all_for_search($_GET['view'], $_GET['order'], $_GET['searchkey'], $_GET['type'], $frienduid, $space['uid'], $minhot, 1);
|
||||
if($count) {
|
||||
$query = C::t('forum_activity')->fetch_all_for_search($_GET['view'], $_GET['order'], $_GET['searchkey'], $_GET['type'], $frienduid, $space['uid'], $minhot, 0, $start, $perpage);
|
||||
|
||||
loadcache('forums');
|
||||
$daytids = $tids = array();
|
||||
foreach($query as $value) {
|
||||
if(empty($value['author']) && $value['authorid'] != $_G['uid']) {
|
||||
$hiddennum++;
|
||||
continue;
|
||||
}
|
||||
$date = dgmdate($value['starttimefrom'], 'Ymd');
|
||||
$posttableid = $value['posttableid'] ? $value['posttableid'] : 0;
|
||||
$tids[$posttableid][$value['tid']] = $value['tid'];
|
||||
$value['week'] = dgmdate($value['starttimefrom'], 'w');
|
||||
$value['month'] = dgmdate($value['starttimefrom'], 'n'.lang('space', 'month'));
|
||||
$value['day'] = dgmdate($value['starttimefrom'], 'j');
|
||||
$value['time'] = dgmdate($value['starttimefrom'], 'Y'.lang('space', 'year').'m'.lang('space', 'month').'d'.lang('space', 'day'));
|
||||
$value['starttimefrom'] = dgmdate($value['starttimefrom']);
|
||||
|
||||
$daytids[$value['tid']] = $date;
|
||||
$list[$date][$value['tid']] = procthread($value);
|
||||
}
|
||||
if($tids) {
|
||||
require_once libfile('function/post');
|
||||
foreach($tids as $ptid=>$ids) {
|
||||
foreach(C::t('forum_post')->fetch_all_by_tid($ptid, $ids, true, '', 0, 0, 1) as $value) {
|
||||
$date = $daytids[$value['tid']];
|
||||
$value['message'] = messagecutstr($value['message'], 150);
|
||||
$list[$date][$value['tid']]['message'] = $value['message'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$multi = multi($count, $perpage, $page, $theurl);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if($_G['uid']) {
|
||||
if($_GET['view'] == 'all') {
|
||||
$navtitle = lang('core', 'title_view_all').lang('core', 'title_activity');
|
||||
} elseif($_GET['view'] == 'me') {
|
||||
$navtitle = lang('core', 'title_my_activity');
|
||||
} else {
|
||||
$navtitle = lang('core', 'title_friend_activity');
|
||||
}
|
||||
} else {
|
||||
if($_GET['order'] == 'hot') {
|
||||
$navtitle = lang('core', 'title_top_activity');
|
||||
} else {
|
||||
$navtitle = lang('core', 'title_newest_activity');
|
||||
}
|
||||
}
|
||||
|
||||
include_once template("diy:home/space_activity");
|
||||
|
||||
?>
|
459
source/include/space/space_album.php
Normal file
459
source/include/space/space_album.php
Normal file
@@ -0,0 +1,459 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: space_album.php 33249 2013-05-09 07:27:16Z kamichen $
|
||||
*/
|
||||
|
||||
if(!defined('IN_DISCUZ')) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
|
||||
if (!$_G['setting']['albumstatus']) {
|
||||
showmessage('album_status_off');
|
||||
}
|
||||
|
||||
$minhot = $_G['setting']['feedhotmin']<1?3:intval($_G['setting']['feedhotmin']);
|
||||
$id = empty($_GET['id'])?0:intval($_GET['id']);
|
||||
$picid = empty($_GET['picid'])?0:intval($_GET['picid']);
|
||||
|
||||
$page = empty($_GET['page'])?1:intval($_GET['page']);
|
||||
if($page<1) $page=1;
|
||||
|
||||
if($id) {
|
||||
|
||||
$perpage = 20;
|
||||
$perpage = mob_perpage($perpage);
|
||||
|
||||
$start = ($page-1)*$perpage;
|
||||
|
||||
ckstart($start, $perpage);
|
||||
|
||||
if($id > 0) {
|
||||
$album = C::t('home_album')->fetch_album($id, $space['uid']);
|
||||
if(empty($album)) {
|
||||
showmessage('to_view_the_photo_does_not_exist');
|
||||
}
|
||||
|
||||
ckfriend_album($album);
|
||||
|
||||
|
||||
$album['picnum'] = $count = C::t('home_pic')->check_albumpic($id);
|
||||
|
||||
if(empty($count) && !$space['self']) {
|
||||
C::t('home_album')->delete($id);
|
||||
showmessage('to_view_the_photo_does_not_exist', "home.php?mod=space&uid={$album['uid']}&do=album&view=me");
|
||||
}
|
||||
|
||||
if($album['catid']) {
|
||||
$album['catname'] = C::t('home_album_category')->fetch_catname_by_catid($album['catid']);
|
||||
$album['catname'] = dhtmlspecialchars($album['catname']);
|
||||
}
|
||||
|
||||
} else {
|
||||
$count = C::t('home_pic')->check_albumpic(0, NULL, $space['uid']);
|
||||
|
||||
$album = array(
|
||||
'uid' => $space['uid'],
|
||||
'albumid' => -1,
|
||||
'albumname' => lang('space', 'default_albumname'),
|
||||
'picnum' => $count
|
||||
);
|
||||
}
|
||||
|
||||
$albumlist = array();
|
||||
$maxalbum = $nowalbum = $key = 0;
|
||||
$query = C::t('home_album')->fetch_all_by_uid($space['uid'], 'updatetime', 0, 100);
|
||||
foreach($query as $value) {
|
||||
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.svg';
|
||||
} else {
|
||||
$value['pic'] = '';
|
||||
}
|
||||
$albumlist[$key][$value['albumid']] = $value;
|
||||
$key = count($albumlist[$key]) == 5 ? ++$key : $key;
|
||||
}
|
||||
$maxalbum = count($albumlist);
|
||||
|
||||
$list = array();
|
||||
$pricount = 0;
|
||||
if($count) {
|
||||
$query = C::t('home_pic')->fetch_all_by_albumid($id, $start, $perpage, 0, 0, 1, $space['uid']);
|
||||
foreach($query as $value) {
|
||||
if($value['status'] == 0 || $value['uid'] == $_G['uid'] || $_G['adminid'] == 1) {
|
||||
$value['pic'] = pic_get($value['filepath'], 'album', $value['thumb'], $value['remote']);
|
||||
$list[] = $value;
|
||||
} else {
|
||||
$pricount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
$multi = multi($count, $perpage, $page, "home.php?mod=space&uid={$album['uid']}&do=$do&id=$id#comment");
|
||||
|
||||
$actives = array('me' =>' class="a"');
|
||||
|
||||
$_G['home_css'] = 'album';
|
||||
|
||||
$diymode = intval($_G['cookie']['home_diymode']);
|
||||
|
||||
$seodata = array('album' => $album['albumname'], 'user' => $album['username'], 'depict' => $album['depict']);
|
||||
list($navtitle, $metadescription, $metakeywords) = get_seosetting('album', $seodata);
|
||||
if(empty($navtitle)) {
|
||||
$navtitle = (empty($album['albumname']) ? '' : $album['albumname'].' - ').lang('space', 'sb_album', array('who' => $album['username']));
|
||||
$nobbname = false;
|
||||
} else {
|
||||
$nobbname = true;
|
||||
}
|
||||
if(empty($metakeywords)) {
|
||||
$metakeywords = $album['albumname'];
|
||||
}
|
||||
if(empty($metadescription)) {
|
||||
$metadescription = $album['albumname'];
|
||||
}
|
||||
|
||||
include_once template("diy:home/space_album_view");
|
||||
|
||||
} elseif ($picid) {
|
||||
$query = C::t('home_pic')->fetch_all_by_uid($space['uid'], 0, 1, $picid);
|
||||
$pic = $query[0];
|
||||
if(!$pic || ($pic['status'] == 1 && $pic['uid'] != $_G['uid'] && $_G['adminid'] != 1 && $_GET['modpickey'] != modauthkey($pic['picid']))) {
|
||||
showmessage('view_images_do_not_exist');
|
||||
}
|
||||
|
||||
$picid = $pic['picid'];
|
||||
$theurl = "home.php?mod=space&uid={$pic['uid']}&do=$do&picid=$picid";
|
||||
|
||||
$album = array();
|
||||
if($pic['albumid']) {
|
||||
$album = C::t('home_album')->fetch_album($pic['albumid']);
|
||||
if(!$album) {
|
||||
C::t('home_pic')->update_for_albumid($pic['albumid'], array('albumid' => 0));
|
||||
}
|
||||
}
|
||||
|
||||
if($album) {
|
||||
ckfriend_album($album);
|
||||
} else {
|
||||
$album['picnum'] = C::t('home_pic')->check_albumpic(0, NULL, $pic['uid']);
|
||||
$album['albumid'] = $pic['albumid'] = '-1';
|
||||
}
|
||||
|
||||
$piclist = $list = $keys = array();
|
||||
$keycount = 0;
|
||||
$query = C::t('home_pic')->fetch_all_by_albumid($pic['albumid'], 0, 0, 0, 0, 1, $space['uid']);
|
||||
foreach($query as $value) {
|
||||
if($value['status'] == 0 || $value['uid'] == $_G['uid'] || $_G['adminid'] == 1) {
|
||||
$keys[$value['picid']] = $keycount;
|
||||
$list[$keycount] = $value;
|
||||
$keycount++;
|
||||
}
|
||||
}
|
||||
|
||||
$upid = $nextid = 0;
|
||||
$nowkey = $keys[$picid];
|
||||
$endkey = $keycount - 1;
|
||||
if($endkey>4) {
|
||||
$newkeys = array($nowkey-2, $nowkey-1, $nowkey, $nowkey+1, $nowkey+2);
|
||||
if($newkeys[1] < 0) {
|
||||
$newkeys[0] = $endkey-1;
|
||||
$newkeys[1] = $endkey;
|
||||
} elseif($newkeys[0] < 0) {
|
||||
$newkeys[0] = $endkey;
|
||||
}
|
||||
if($newkeys[3] > $endkey) {
|
||||
$newkeys[3] = 0;
|
||||
$newkeys[4] = 1;
|
||||
} elseif($newkeys[4] > $endkey) {
|
||||
$newkeys[4] = 0;
|
||||
}
|
||||
$upid = $list[$newkeys[1]]['picid'];
|
||||
$nextid = $list[$newkeys[3]]['picid'];
|
||||
|
||||
foreach ($newkeys as $nkey) {
|
||||
$piclist[$nkey] = $list[$nkey];
|
||||
}
|
||||
} else {
|
||||
$newkeys = array($nowkey-1, $nowkey, $nowkey+1);
|
||||
if($newkeys[0] < 0) {
|
||||
$newkeys[0] = $endkey;
|
||||
}
|
||||
if($newkeys[2] > $endkey) {
|
||||
$newkeys[2] = 0;
|
||||
}
|
||||
$upid = $list[$newkeys[0]]['picid'];
|
||||
$nextid = $list[$newkeys[2]]['picid'];
|
||||
|
||||
$piclist = $list;
|
||||
}
|
||||
foreach ($piclist as $key => $value) {
|
||||
$value['pic'] = pic_get($value['filepath'], 'album', $value['thumb'], $value['remote']);
|
||||
$piclist[$key] = $value;
|
||||
}
|
||||
|
||||
$pic['pic'] = pic_get($pic['filepath'], 'album', $pic['thumb'], $pic['remote'], 0);
|
||||
$pic['size'] = formatsize($pic['size']);
|
||||
$pic['postip'] = ip::to_display($pic['postip']);
|
||||
|
||||
$exifs = array();
|
||||
$allowexif = function_exists('exif_read_data');
|
||||
if(isset($_GET['exif']) && $allowexif) {
|
||||
require_once libfile('function/exif');
|
||||
$exifs = getexif($pic['pic']);
|
||||
}
|
||||
|
||||
$perpage = 20;
|
||||
$perpage = mob_perpage($perpage);
|
||||
|
||||
$start = ($page-1)*$perpage;
|
||||
|
||||
ckstart($start, $perpage);
|
||||
|
||||
$cid = empty($_GET['cid'])?0:intval($_GET['cid']);
|
||||
|
||||
$siteurl = getsiteurl();
|
||||
$list = array();
|
||||
$count = C::t('home_comment')->count_by_id_idtype($pic['picid'], 'picid', $cid);
|
||||
if($count) {
|
||||
$query = C::t('home_comment')->fetch_all_by_id_idtype($pic['picid'], 'picid', $start, $perpage, $cid);
|
||||
foreach($query as $value) {
|
||||
$list[] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
$multi = multi($count, $perpage, $page, $theurl);
|
||||
|
||||
if(empty($album['albumname'])) $album['albumname'] = lang('space', 'default_albumname');
|
||||
|
||||
$pic_url = $pic['pic'];
|
||||
if(!preg_match("/^(http|https)\:\/\/.+?/i", $pic['pic'])) {
|
||||
$pic_url = getsiteurl().$pic['pic'];
|
||||
}
|
||||
$pic_url2 = rawurlencode($pic['pic']);
|
||||
|
||||
$hash = md5($pic['uid']."\t".$pic['dateline']);
|
||||
$id = $pic['picid'];
|
||||
$idtype = 'picid';
|
||||
|
||||
$maxclicknum = 0;
|
||||
loadcache('click');
|
||||
$clicks = empty($_G['cache']['click']['picid'])?array():$_G['cache']['click']['picid'];
|
||||
foreach ($clicks as $key => $value) {
|
||||
$value['clicknum'] = $pic["click{$key}"];
|
||||
$value['classid'] = mt_rand(1, 4);
|
||||
if($value['clicknum'] > $maxclicknum) $maxclicknum = $value['clicknum'];
|
||||
$clicks[$key] = $value;
|
||||
}
|
||||
|
||||
$clickuserlist = array();
|
||||
foreach(C::t('home_clickuser')->fetch_all_by_id_idtype($id, $idtype, 0, 20) as $value) {
|
||||
$value['clickname'] = $clicks[$value['clickid']]['name'];
|
||||
$clickuserlist[] = $value;
|
||||
}
|
||||
|
||||
$actives = array('me' =>' class="a"');
|
||||
|
||||
if($album['picnum']) {
|
||||
$sequence = $nowkey + 1;
|
||||
}
|
||||
|
||||
$diymode = intval($_G['cookie']['home_diymode']);
|
||||
|
||||
$navtitle = $album['albumname'];
|
||||
if($pic['title']) {
|
||||
$navtitle = $pic['title'].' - '.$navtitle;
|
||||
}
|
||||
$metakeywords = $pic['title'] ? $pic['title'] : $album['albumname'];
|
||||
$metadescription = $pic['title'] ? $pic['title'] : $album['albumname'];
|
||||
|
||||
include_once template("diy:home/space_album_pic");
|
||||
|
||||
} else {
|
||||
|
||||
loadcache('albumcategory');
|
||||
$category = $_G['cache']['albumcategory'];
|
||||
|
||||
$perpage = 20;
|
||||
$perpage = mob_perpage($perpage);
|
||||
|
||||
$start = ($page-1)*$perpage;
|
||||
|
||||
ckstart($start, $perpage);
|
||||
|
||||
$_GET['friend'] = intval($_GET['friend']);
|
||||
|
||||
$default = array();
|
||||
$f_index = '';
|
||||
$list = array();
|
||||
$pricount = 0;
|
||||
$picmode = 0;
|
||||
|
||||
$_GET['view'] = in_array($_GET['view'], array('we', 'me', 'all')) ? $_GET['view'] : 'we';
|
||||
$_GET['order'] = in_array($_GET['order'], array('hot', 'dateline')) ? $_GET['order'] : 'dateline';
|
||||
|
||||
$gets = array(
|
||||
'mod' => 'space',
|
||||
'uid' => $space['uid'],
|
||||
'do' => 'album',
|
||||
'view' => $_GET['view'],
|
||||
'catid' => $_GET['catid'],
|
||||
'order' => $_GET['order'],
|
||||
'fuid' => $_GET['fuid'],
|
||||
'searchkey' => $_GET['searchkey'],
|
||||
'from' => $_GET['from']
|
||||
);
|
||||
$theurl = 'home.php?'.url_implode($gets);
|
||||
$actives = array($_GET['view'] =>' class="a"');
|
||||
|
||||
$need_count = true;
|
||||
|
||||
if($_GET['view'] == 'all') {
|
||||
|
||||
$wheresql = '1';
|
||||
|
||||
if($_GET['order'] == 'hot') {
|
||||
$orderactives = array('hot' => ' class="a"');
|
||||
$picmode = 1;
|
||||
$need_count = false;
|
||||
|
||||
$ordersql = 'p.dateline';
|
||||
|
||||
$count = C::t('home_pic')->fetch_all_by_sql('p.'.DB::field('hot', $minhot, '>='), '', 0, 0, 1);
|
||||
if($count) {
|
||||
$query = C::t('home_pic')->fetch_all_by_sql('p.'.DB::field('hot', $minhot, '>='), 'p.dateline DESC', $start, $perpage);
|
||||
foreach($query as $value) {
|
||||
if($value['friend'] != 4 && ckfriend($value['uid'], $value['friend'], $value['target_ids']) && ($value['status'] == 0 || $value['uid'] == $_G['uid'] || $_G['adminid'] == 1)) {
|
||||
$value['pic'] = pic_get($value['filepath'], 'album', $value['thumb'], $value['remote']);
|
||||
$list[] = $value;
|
||||
} else {
|
||||
$pricount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
$orderactives = array('dateline' => ' class="a"');
|
||||
}
|
||||
|
||||
} elseif($_GET['view'] == 'we') {
|
||||
|
||||
space_merge($space, 'field_home');
|
||||
|
||||
$uids = array();
|
||||
|
||||
if($space['feedfriend']) {
|
||||
|
||||
$uids = explode(',', $space['feedfriend']);
|
||||
$f_index = 'updatetime';
|
||||
|
||||
$fuid_actives = array();
|
||||
|
||||
require_once libfile('function/friend');
|
||||
$fuid = intval($_GET['fuid']);
|
||||
if($fuid && friend_check($fuid)) {
|
||||
$uids = array($fuid);
|
||||
$f_index = '';
|
||||
$fuid_actives = array($fuid=>' selected');
|
||||
}
|
||||
|
||||
$query = C::t('home_friend')->fetch_all_by_uid($space['uid'], 0, 500, true);
|
||||
foreach($query as $value) {
|
||||
$userlist[] = $value;
|
||||
}
|
||||
} else {
|
||||
$need_count = false;
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
if($_GET['from'] == 'space') $diymode = 1;
|
||||
|
||||
$uids = array($space['uid']);
|
||||
}
|
||||
|
||||
if($need_count) {
|
||||
|
||||
if($searchkey = stripsearchkey($_GET['searchkey'])) {
|
||||
$sqlSearchKey = $searchkey;
|
||||
$searchkey = dhtmlspecialchars($searchkey);
|
||||
}
|
||||
|
||||
$catid = empty($_GET['catid'])?0:intval($_GET['catid']);
|
||||
|
||||
$count = C::t('home_album')->fetch_all_by_search(3, $uids, $sqlSearchKey, true, $catid, 0, 0, '');
|
||||
|
||||
if($count) {
|
||||
$query = C::t('home_album')->fetch_all_by_search(1, $uids, $sqlSearchKey, true, $catid, 0, 0, '', '', 'updatetime', 'DESC', $start, $perpage, $f_index);
|
||||
foreach($query as $value) {
|
||||
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.svg';
|
||||
} else {
|
||||
$value['pic'] = '';
|
||||
}
|
||||
$list[] = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$multi = multi($count, $perpage, $page, $theurl);
|
||||
|
||||
dsetcookie('home_diymode', $diymode);
|
||||
|
||||
if($_G['uid']) {
|
||||
if($_GET['view'] == 'all') {
|
||||
$navtitle = lang('core', 'title_view_all').lang('core', 'title_album');
|
||||
} elseif($_GET['view'] == 'me') {
|
||||
$navtitle = lang('core', 'title_my_album');
|
||||
} else {
|
||||
$navtitle = lang('core', 'title_friend_album');
|
||||
}
|
||||
} else {
|
||||
if($_GET['order'] == 'hot') {
|
||||
$navtitle = lang('core', 'title_hot_pic_recommend');
|
||||
} else {
|
||||
$navtitle = lang('core', 'title_newest_update_album');
|
||||
}
|
||||
}
|
||||
if($space['username']) {
|
||||
$navtitle = lang('space', 'sb_album', array('who' => $space['username']));
|
||||
}
|
||||
|
||||
$metakeywords = $navtitle;
|
||||
$metadescription = $navtitle;
|
||||
include_once template("diy:home/space_album_list");
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
380
source/include/space/space_blog.php
Normal file
380
source/include/space/space_blog.php
Normal file
@@ -0,0 +1,380 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: space_blog.php 32130 2012-11-14 09:20:40Z zhengqingpeng $
|
||||
*/
|
||||
|
||||
if(!defined('IN_DISCUZ')) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
|
||||
if (!$_G['setting']['blogstatus']) {
|
||||
showmessage('blog_status_off');
|
||||
}
|
||||
|
||||
$minhot = $_G['setting']['feedhotmin']<1?3:$_G['setting']['feedhotmin'];
|
||||
$page = empty($_GET['page'])?1:intval($_GET['page']);
|
||||
if($page<1) $page=1;
|
||||
$id = empty($_GET['id'])?0:intval($_GET['id']);
|
||||
$_G['colorarray'] = array('', '#EE1B2E', '#EE5023', '#996600', '#3C9D40', '#2897C5', '#2B65B7', '#8F2A90', '#EC1282');
|
||||
|
||||
if($id) {
|
||||
$blog = array_merge(
|
||||
C::t('home_blog')->fetch($id),
|
||||
C::t('home_blogfield')->fetch($id)
|
||||
);
|
||||
if($blog['uid'] != $space['uid']) {
|
||||
$blog = null;
|
||||
}
|
||||
if(!(!empty($blog) && ($blog['status'] == 0 || $blog['uid'] == $_G['uid'] || $_G['adminid'] == 1 || $_GET['modblogkey'] == modauthkey($blog['blogid'])))) {
|
||||
showmessage('view_to_info_did_not_exist');
|
||||
}
|
||||
if(!ckfriend($blog['uid'], $blog['friend'], $blog['target_ids'])) {
|
||||
require_once libfile('function/friend');
|
||||
$isfriend = friend_check($blog['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'] && $blog['friend'] == 4 && $_G['adminid'] != 1) {
|
||||
$cookiename = "view_pwd_blog_{$blog['blogid']}";
|
||||
$cookievalue = empty($_G['cookie'][$cookiename])?'':$_G['cookie'][$cookiename];
|
||||
if($cookievalue != md5(md5($blog['password']))) {
|
||||
$invalue = $blog;
|
||||
include template('home/misc_inputpwd');
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($_G['setting']['antitheft']['allow']) && empty($_G['setting']['antitheft']['disable']['blog'])) {
|
||||
helper_antitheft::check($id, 'bid');
|
||||
}
|
||||
|
||||
$classarr = C::t('home_class')->fetch($blog['classid']);
|
||||
|
||||
if($blog['catid']) {
|
||||
$blog['catname'] = C::t('home_blog_category')->fetch_catname_by_catid($blog['catid']);
|
||||
$blog['catname'] = dhtmlspecialchars($blog['catname']);
|
||||
}
|
||||
|
||||
require_once libfile('function/blog');
|
||||
$blog['message'] = blog_bbcode($blog['message']);
|
||||
|
||||
$otherlist = $newlist = array();
|
||||
|
||||
$otherlist = array();
|
||||
$query = C::t('home_blog')->fetch_all_by_uid($space['uid'], 'dateline', 0, 6);
|
||||
foreach($query as $value) {
|
||||
if($value['blogid'] != $blog['blogid'] && empty($value['friend']) && $value['status'] == 0) {
|
||||
$otherlist[] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
$newlist = array();
|
||||
$query = C::t('home_blog')->fetch_all_by_hot($minhot, 'dateline', 0, 6);
|
||||
foreach($query as $value) {
|
||||
if($value['blogid'] != $blog['blogid'] && empty($value['friend']) && $value['status'] == 0) {
|
||||
$newlist[] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
$perpage = 20;
|
||||
$perpage = mob_perpage($perpage);
|
||||
|
||||
$start = ($page-1)*$perpage;
|
||||
|
||||
ckstart($start, $perpage);
|
||||
|
||||
$count = $blog['replynum'];
|
||||
|
||||
$list = array();
|
||||
if($count) {
|
||||
if($_GET['goto']) {
|
||||
$page = ceil($count/$perpage);
|
||||
$start = ($page-1)*$perpage;
|
||||
} else {
|
||||
$cid = empty($_GET['cid'])?0:intval($_GET['cid']);
|
||||
}
|
||||
|
||||
$query = C::t('home_comment')->fetch_all_by_id_idtype($id, 'blogid', $start, $perpage, $cid);
|
||||
foreach($query as $value) {
|
||||
$list[] = $value;
|
||||
}
|
||||
|
||||
if(empty($list) && empty($cid)) {
|
||||
$count = C::t('home_comment')->count_by_id_idtype($id, 'blogid');
|
||||
C::t('home_blog')->update($blog['blogid'], array('replynum'=>$count));
|
||||
}
|
||||
}
|
||||
|
||||
$multi = multi($count, $perpage, $page, "home.php?mod=space&uid={$blog['uid']}&do=$do&id=$id#comment");
|
||||
|
||||
if(!$_G['setting']['preventrefresh'] || !$space['self'] && $_G['cookie']['viewid'] != 'blog_'.$blog['blogid']) {
|
||||
C::t('home_blog')->increase($blog['blogid'], 0, array('viewnum' => 1));
|
||||
dsetcookie('viewid', 'blog_'.$blog['blogid']);
|
||||
}
|
||||
|
||||
$hash = md5($blog['uid']."\t".$blog['dateline']);
|
||||
$id = $blog['blogid'];
|
||||
$idtype = 'blogid';
|
||||
|
||||
$maxclicknum = 0;
|
||||
loadcache('click');
|
||||
$clicks = empty($_G['cache']['click']['blogid'])?array():$_G['cache']['click']['blogid'];
|
||||
|
||||
foreach ($clicks as $key => $value) {
|
||||
$value['clicknum'] = $blog["click{$key}"];
|
||||
$value['classid'] = mt_rand(1, 4);
|
||||
if($value['clicknum'] > $maxclicknum) $maxclicknum = $value['clicknum'];
|
||||
$clicks[$key] = $value;
|
||||
}
|
||||
|
||||
$clickuserlist = array();
|
||||
foreach(C::t('home_clickuser')->fetch_all_by_id_idtype($id, $idtype, 0, 24) as $value) {
|
||||
$value['clickname'] = $clicks[$value['clickid']]['name'];
|
||||
$clickuserlist[] = $value;
|
||||
}
|
||||
$actives = array('me' =>' class="a"');
|
||||
|
||||
$diymode = intval($_G['cookie']['home_diymode']);
|
||||
|
||||
$tagarray_all = $array_temp = $blogtag_array = $blogmetatag_array = array();
|
||||
$blogmeta_tag = '';
|
||||
$tagarray_all = explode("\t", $blog['tag']);
|
||||
if($tagarray_all) {
|
||||
foreach($tagarray_all as $var) {
|
||||
if($var) {
|
||||
$array_temp = explode(',', $var);
|
||||
$blogtag_array[] = $array_temp;
|
||||
$blogmetatag_array[] = $array_temp['1'];
|
||||
}
|
||||
}
|
||||
}
|
||||
$blog['tag'] = $blogtag_array;
|
||||
$blogmeta_tag = implode(',', $blogmetatag_array);
|
||||
$blog['postip'] = ip::to_display($blog['postip']);
|
||||
|
||||
$summary = cutstr(strip_tags($blog['message']), 140);
|
||||
$seodata = array('subject' => $blog['subject'], 'user' => $blog['username'], 'summary' => $summary, 'tags' => $blogmeta_tag);
|
||||
list($navtitle, $metadescription, $metakeywords) = get_seosetting('blog', $seodata);
|
||||
if(empty($navtitle)) {
|
||||
$navtitle = $blog['subject'].' - '.lang('space', 'sb_blog', array('who' => $blog['username']));
|
||||
$nobbname = false;
|
||||
} else {
|
||||
$nobbname = true;
|
||||
}
|
||||
if(empty($metakeywords)) {
|
||||
$metakeywords = $blogmeta_tag ? $blogmeta_tag : $blog['subject'];
|
||||
}
|
||||
if(empty($metadescription)) {
|
||||
$metadescription = $summary;
|
||||
}
|
||||
if(!$_G['setting']['relatedlinkstatus']) {
|
||||
$_G['relatedlinks'] = get_related_link('blog');
|
||||
} else {
|
||||
$blog['message'] = parse_related_link($blog['message'], 'blog');
|
||||
}
|
||||
|
||||
include_once template("diy:home/space_blog_view");
|
||||
|
||||
} else {
|
||||
|
||||
loadcache('blogcategory');
|
||||
$category = $_G['cache']['blogcategory'];
|
||||
|
||||
$_GET['view'] = in_array($_GET['view'], array('we', 'me', 'all')) ? $_GET['view'] : 'we';
|
||||
$_GET['order'] = in_array($_GET['order'], array('hot', 'dateline')) ? $_GET['order'] : 'dateline';
|
||||
|
||||
$perpage = 10;
|
||||
$perpage = mob_perpage($perpage);
|
||||
$start = ($page-1)*$perpage;
|
||||
ckstart($start, $perpage);
|
||||
|
||||
$summarylen = 300;
|
||||
|
||||
$classarr = array();
|
||||
$list = array();
|
||||
$userlist = array();
|
||||
$stickblogs = array();
|
||||
$count = $pricount = 0;
|
||||
|
||||
$gets = array(
|
||||
'mod' => 'space',
|
||||
'uid' => $space['uid'],
|
||||
'do' => 'blog',
|
||||
'view' => $_GET['view'],
|
||||
'order' => $_GET['order'],
|
||||
'classid' => $_GET['classid'],
|
||||
'catid' => $_GET['catid'],
|
||||
'clickid' => $_GET['clickid'],
|
||||
'fuid' => $_GET['fuid'],
|
||||
'searchkey' => $_GET['searchkey'],
|
||||
'from' => $_GET['from'],
|
||||
'friend' => $_GET['friend']
|
||||
);
|
||||
$theurl = 'home.php?'.url_implode($gets);
|
||||
$multi = '';
|
||||
|
||||
$f_index = $searchsubject = '';
|
||||
$uids = array();
|
||||
$need_count = true;
|
||||
$status = null;
|
||||
if($_GET['view'] == 'all') {
|
||||
if($_GET['order'] == 'hot') {
|
||||
$gthot = $minhot;
|
||||
|
||||
$orderactives = array('hot' => ' class="a"');
|
||||
} else {
|
||||
$orderactives = array('dateline' => ' class="a"');
|
||||
}
|
||||
|
||||
$status = 0;
|
||||
} elseif($_GET['view'] == 'me') {
|
||||
|
||||
space_merge($space, 'field_home');
|
||||
$stickblogs = explode(',', $space['stickblogs']);
|
||||
$stickblogs = array_filter($stickblogs);
|
||||
$uids[] = $space['uid'];
|
||||
|
||||
$classid = empty($_GET['classid'])?0:intval($_GET['classid']);
|
||||
|
||||
$privacyfriend = empty($_GET['friend'])?0:intval($_GET['friend']);
|
||||
$query = C::t('home_class')->fetch_all_by_uid($space['uid']);
|
||||
foreach($query as $value) {
|
||||
$classarr[$value['classid']] = $value['classname'];
|
||||
}
|
||||
|
||||
if($_GET['from'] == 'space') $diymode = 1;
|
||||
$status = array(0, 1);
|
||||
} else {
|
||||
|
||||
space_merge($space, 'field_home');
|
||||
|
||||
if($space['feedfriend']) {
|
||||
|
||||
$fuid_actives = array();
|
||||
|
||||
require_once libfile('function/friend');
|
||||
$fuid = intval($_GET['fuid']);
|
||||
if($fuid && friend_check($fuid, $space['uid'])) {
|
||||
$uids[] = $fuid;
|
||||
$fuid_actives = array($fuid=>' selected');
|
||||
} else {
|
||||
$uids = explode(',', $space['feedfriend']);
|
||||
$theurl = "home.php?mod=space&uid={$space['uid']}&do=$do&view=we";
|
||||
$f_index = 'dateline';
|
||||
}
|
||||
|
||||
$query = C::t('home_friend')->fetch_all_by_uid($space['uid'], 0, 100, true);
|
||||
foreach($query as $value) {
|
||||
$userlist[] = $value;
|
||||
}
|
||||
$status = 0;
|
||||
} else {
|
||||
$need_count = false;
|
||||
}
|
||||
}
|
||||
|
||||
$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 {
|
||||
$pricount++;
|
||||
}
|
||||
}
|
||||
|
||||
$multi = multi($count, $perpage, $page, $theurl);
|
||||
if(!empty($stickblogs)) {
|
||||
$list = array_merge(blog_get_stick($space['uid'], $stickblogs, $summarylen), $list);
|
||||
}
|
||||
}
|
||||
|
||||
dsetcookie('home_diymode', $diymode);
|
||||
|
||||
if($_G['uid']) {
|
||||
if($_GET['view'] == 'all') {
|
||||
$navtitle = lang('core', 'title_view_all').lang('core', 'title_blog');
|
||||
} elseif($_GET['view'] == 'me') {
|
||||
$navtitle = lang('core', 'title_my_blog');
|
||||
} else {
|
||||
$navtitle = lang('core', 'title_friend_blog');
|
||||
|
||||
}
|
||||
} else {
|
||||
if($_GET['order'] == 'hot') {
|
||||
$navtitle = lang('core', 'title_recommend_blog');
|
||||
} else {
|
||||
$navtitle = lang('core', 'title_newest_blog');
|
||||
}
|
||||
}
|
||||
if($space['username']) {
|
||||
$navtitle = lang('space', 'sb_blog', array('who' => $space['username']));
|
||||
}
|
||||
$metakeywords = $navtitle;
|
||||
$metadescription = $navtitle;
|
||||
$navtitle = helper_seo::get_title_page($navtitle, $_G['page']);
|
||||
|
||||
space_merge($space, 'field_home');
|
||||
include_once template("diy:home/space_blog_list");
|
||||
|
||||
}
|
||||
|
||||
function blog_get_stick($uid, $stickblogs, $summarylen) {
|
||||
$list = $stickids = array();
|
||||
if($stickblogs) {
|
||||
$data_blog = C::t('home_blog')->fetch_all_blog($stickblogs);
|
||||
$data_blogfield = C::t('home_blogfield')->fetch_all($stickblogs);
|
||||
foreach ($stickblogs as $blogid) {
|
||||
if(!empty($data_blog[$blogid]) && !empty($data_blogfield[$blogid])) {
|
||||
$value = array_merge($data_blog[$blogid], $data_blogfield[$blogid]);
|
||||
if(ckfriend($value['uid'], $value['friend'], $value['target_ids']) && ($value['status'] == 0 || $value['uid'] == $_G['uid'] || $_G['adminid'] == 1)) {
|
||||
$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']);
|
||||
$value['stickflag'] = true;
|
||||
$list[$value['blogid']] = $value;
|
||||
$stickids[] = $value['blogid'];
|
||||
}
|
||||
}
|
||||
}
|
||||
if(count($stickids) != count($stickblogs)) {
|
||||
C::t('common_member_field_home')->update($uid, array('stickblogs' => implode(',', $stickids)));
|
||||
}
|
||||
}
|
||||
return $list;
|
||||
}
|
||||
?>
|
173
source/include/space/space_debate.php
Normal file
173
source/include/space/space_debate.php
Normal file
@@ -0,0 +1,173 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: space_debate.php 28220 2012-02-24 07:52:50Z zhengqingpeng $
|
||||
*/
|
||||
|
||||
if(!defined('IN_DISCUZ')) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
|
||||
if (!$_G['setting']['forumstatus']) {
|
||||
showmessage('forum_status_off');
|
||||
}
|
||||
|
||||
$minhot = $_G['setting']['feedhotmin']<1?3:$_G['setting']['feedhotmin'];
|
||||
$page = empty($_GET['page'])?1:intval($_GET['page']);
|
||||
if($page<1) $page=1;
|
||||
$id = empty($_GET['id'])?0:intval($_GET['id']);
|
||||
$opactives['debate'] = 'class="a"';
|
||||
|
||||
$_GET['view'] = in_array($_GET['view'], array('we', 'me', 'all')) ? $_GET['view'] : 'we';
|
||||
$_GET['order'] = in_array($_GET['order'], array('hot', 'dateline')) ? $_GET['order'] : 'dateline';
|
||||
$perpage = 20;
|
||||
$perpage = mob_perpage($perpage);
|
||||
$start = ($page-1)*$perpage;
|
||||
ckstart($start, $perpage);
|
||||
|
||||
$list = $userlist = array();
|
||||
$count = $pricount = 0;
|
||||
|
||||
$gets = array(
|
||||
'mod' => 'space',
|
||||
'uid' => $space['uid'],
|
||||
'do' => 'debate',
|
||||
'view' => $_GET['view'],
|
||||
'order' => $_GET['order'],
|
||||
'type' => $_GET['type'],
|
||||
'fuid' => $_GET['fuid'],
|
||||
'searchkey' => $_GET['searchkey']
|
||||
);
|
||||
$theurl = 'home.php?'.url_implode($gets);
|
||||
$multi = '';
|
||||
|
||||
|
||||
$f_index = '';
|
||||
$ordersql = 't.dateline DESC';
|
||||
$need_count = true;
|
||||
$join = $authorid = $replies = 0;
|
||||
$displayorder = null;
|
||||
$subject = '';
|
||||
|
||||
if($_GET['view'] == 'me') {
|
||||
|
||||
if($_GET['type'] == 'reply') {
|
||||
$authorid = $space['uid'];
|
||||
$join = true;
|
||||
} else {
|
||||
$authorid = $space['uid'];
|
||||
}
|
||||
$viewtype = in_array($_GET['type'], array('orig', 'reply')) ? $_GET['type'] : 'orig';
|
||||
$typeactives = array($viewtype => ' class="a"');
|
||||
|
||||
} else {
|
||||
|
||||
space_merge($space, 'field_home');
|
||||
|
||||
if($space['feedfriend']) {
|
||||
|
||||
$fuid_actives = array();
|
||||
|
||||
require_once libfile('function/friend');
|
||||
$fuid = intval($_GET['fuid']);
|
||||
if($fuid && friend_check($fuid, $space['uid'])) {
|
||||
$authorid = $fuid;
|
||||
$fuid_actives = array($fuid=>' selected');
|
||||
} else {
|
||||
$authorid = explode(',', $space['feedfriend']);
|
||||
$theurl = "home.php?mod=space&uid={$space['uid']}&do=$do&view=we";
|
||||
}
|
||||
|
||||
$query = C::t('home_friend')->fetch_all_by_uid($space['uid'], 0, 100, true);
|
||||
foreach($query as $value) {
|
||||
$userlist[] = $value;
|
||||
}
|
||||
} else {
|
||||
$need_count = false;
|
||||
}
|
||||
}
|
||||
|
||||
$actives = array($_GET['view'] =>' class="a"');
|
||||
|
||||
if($need_count) {
|
||||
|
||||
if($_GET['view'] != 'me') {
|
||||
$displayorder = 0;
|
||||
}
|
||||
if($searchkey = stripsearchkey($_GET['searchkey'])) {
|
||||
$subject = $searchkey;
|
||||
$searchkey = dhtmlspecialchars($searchkey);
|
||||
}
|
||||
|
||||
$count = C::t('forum_thread')->count_by_special(5, $authorid, $replies, $displayorder, $subject, $join);
|
||||
if($count) {
|
||||
|
||||
$dids = $special = $multitable = $tids = array();
|
||||
require_once libfile('function/post');
|
||||
foreach(C::t('forum_thread')->fetch_all_by_special(5, $authorid, $replies, $displayorder, $subject, $join, $start, $perpage) as $value) {
|
||||
$value['dateline'] = dgmdate($value['dateline']);
|
||||
if($_GET['view'] == 'me' && $_GET['type'] == 'reply' && $page == 1 && count($special) < 2) {
|
||||
$value['message'] = messagecutstr($value['message'], 200);
|
||||
$special[$value['tid']] = $value;
|
||||
} else {
|
||||
if($page == 1 && count($special) < 2) {
|
||||
$tids[$value['posttableid']][$value['tid']] = $value['tid'];
|
||||
$special[$value['tid']] = $value;
|
||||
} else {
|
||||
$list[$value['tid']] = $value;
|
||||
}
|
||||
}
|
||||
$dids[$value['tid']] = $value['tid'];
|
||||
}
|
||||
if($tids) {
|
||||
foreach($tids as $postid => $tid) {
|
||||
foreach(C::t('forum_post')->fetch_all_by_tid(0, $tid) as $value) {
|
||||
$special[$value['tid']]['message'] = messagecutstr($value['message'], 200);
|
||||
}
|
||||
}
|
||||
}
|
||||
if($dids) {
|
||||
foreach(C::t('forum_debate')->fetch_all($dids) as $value) {
|
||||
$value['negavotesheight'] = $value['affirmvotesheight'] = '8px';
|
||||
if($value['affirmvotes'] || $value['negavotes']) {
|
||||
$allvotes = $value['affirmvotes'] + $value['negavotes'];
|
||||
$value['negavotesheight'] = round($value['negavotes']/$allvotes * 100, 2).'%';
|
||||
$value['affirmvotesheight'] = round($value['affirmvotes']/$allvotes * 100, 2).'%';
|
||||
}
|
||||
if($list[$value['tid']]) {
|
||||
$list[$value['tid']] = array_merge($value, $list[$value['tid']]);
|
||||
} elseif($special[$value['tid']]) {
|
||||
$special[$value['tid']] = array_merge($value, $special[$value['tid']]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$multi = multi($count, $perpage, $page, $theurl);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
if($_G['uid']) {
|
||||
if($_GET['view'] == 'all') {
|
||||
$navtitle = lang('core', 'title_view_all').lang('core', 'title_debate');
|
||||
} elseif($_GET['view'] == 'me') {
|
||||
$navtitle = lang('core', 'title_my_debate');
|
||||
} else {
|
||||
$navtitle = lang('core', 'title_friend_debate');
|
||||
}
|
||||
} else {
|
||||
if($_GET['order'] == 'hot') {
|
||||
$navtitle = lang('core', 'title_top_debate');
|
||||
} else {
|
||||
$navtitle = lang('core', 'title_newest_debate');
|
||||
}
|
||||
}
|
||||
|
||||
include_once template("diy:home/space_debate");
|
||||
|
||||
?>
|
176
source/include/space/space_doing.php
Normal file
176
source/include/space/space_doing.php
Normal file
@@ -0,0 +1,176 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: space_doing.php 29155 2012-03-27 10:39:12Z zhengqingpeng $
|
||||
*/
|
||||
|
||||
if(!defined('IN_DISCUZ')) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
|
||||
if (!$_G['setting']['doingstatus']) {
|
||||
showmessage('doing_status_off');
|
||||
}
|
||||
|
||||
$perpage = 20;
|
||||
$perpage = mob_perpage($perpage);
|
||||
|
||||
$page = empty($_GET['page'])?0:intval($_GET['page']);
|
||||
if($page<1) $page=1;
|
||||
$start = ($page-1)*$perpage;
|
||||
|
||||
ckstart($start, $perpage);
|
||||
|
||||
$dolist = array();
|
||||
$count = 0;
|
||||
|
||||
$_GET['view'] = in_array($_GET['view'], array('we', 'me', 'all')) ? $_GET['view'] : 'we';
|
||||
|
||||
$gets = array(
|
||||
'mod' => 'space',
|
||||
'uid' => $space['uid'],
|
||||
'do' => 'doing',
|
||||
'view' => $_GET['view'],
|
||||
'searchkey' => $_GET['searchkey'],
|
||||
'from' => $_GET['from']
|
||||
);
|
||||
$theurl = 'home.php?'.url_implode($gets);
|
||||
|
||||
$f_index = '';
|
||||
$diymode = 0;
|
||||
if($_GET['view'] == 'all') {
|
||||
|
||||
$f_index = 'dateline';
|
||||
|
||||
} elseif($_GET['view'] == 'we') {
|
||||
|
||||
space_merge($space, 'field_home');
|
||||
if($space['feedfriend']) {
|
||||
$uids = array_merge(explode(',', $space['feedfriend']), array($space['uid']));
|
||||
$f_index = 'dateline';
|
||||
} else {
|
||||
$uids = array($space['uid']);
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
if($_GET['from'] == 'space') $diymode = 1;
|
||||
|
||||
$uids = $_GET['highlight'] ? array() : array($space['uid']);
|
||||
}
|
||||
$actives = array($_GET['view'] =>' class="a"');
|
||||
|
||||
$doid = empty($_GET['doid'])?0:intval($_GET['doid']);
|
||||
$doids = $clist = $newdoids = array();
|
||||
$pricount = 0;
|
||||
|
||||
if($doid) {
|
||||
$count = 1;
|
||||
$f_index = '';
|
||||
$theurl .= "&doid=$doid";
|
||||
}
|
||||
|
||||
if($searchkey = stripsearchkey($_GET['searchkey'])) {
|
||||
$searchkey = dhtmlspecialchars($searchkey);
|
||||
}
|
||||
|
||||
if(empty($count)) {
|
||||
$count = C::t('home_doing')->fetch_all_search($start, $perpage, 3, $uids, '', $searchkey, '', '' ,'', 1, $doid, $f_index);
|
||||
}
|
||||
if($count) {
|
||||
$query = C::t('home_doing')->fetch_all_search($start, $perpage, 1, $uids, '', $searchkey, '', '' ,'', 1, $doid, $f_index);
|
||||
foreach($query as $value) {
|
||||
if(!empty($value['ip'])) {
|
||||
$value['ip'] = ip::to_display($value['ip']);
|
||||
}
|
||||
if($value['status'] == 0 || $value['uid'] == $_G['uid'] || $_G['adminid'] == 1) {
|
||||
$doids[] = $value['doid'];
|
||||
$dolist[] = $value;
|
||||
} else {
|
||||
$pricount ++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($doid) {
|
||||
$dovalue = empty($dolist)?array():$dolist[0];
|
||||
if($dovalue) {
|
||||
if($dovalue['uid'] == $_G['uid']) {
|
||||
$actives = array('me'=>' class="a"');
|
||||
} else {
|
||||
$actives = array('all'=>' class="a"');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if($doids) {
|
||||
|
||||
$tree = new lib_tree();
|
||||
|
||||
$values = array();
|
||||
foreach(C::t('home_docomment')->fetch_all_by_doid($doids) as $value) {
|
||||
$newdoids[$value['doid']] = $value['doid'];
|
||||
if(empty($value['upid'])) {
|
||||
$value['upid'] = "do{$value['doid']}";
|
||||
}
|
||||
if(!empty($value['ip'])) {
|
||||
$value['ip'] = ip::to_display($value['ip']);
|
||||
}
|
||||
$tree->setNode($value['id'], $value['upid'], $value);
|
||||
}
|
||||
}
|
||||
|
||||
$showdoinglist = array();
|
||||
foreach ($newdoids as $cdoid) {
|
||||
$values = $tree->getChilds("do$cdoid");
|
||||
$show = false;
|
||||
foreach ($values as $key => $id) {
|
||||
$one = $tree->getValue($id);
|
||||
$one['layer'] = $tree->getLayer($id) * 2 - 2;
|
||||
$one['style'] = "padding-left:{$one['layer']}em;";
|
||||
if($_GET['highlight'] && $one['id'] == $_GET['highlight']) {
|
||||
$one['style'] .= 'color:#F60;';
|
||||
}
|
||||
if($one['layer'] > 0){
|
||||
if($one['layer']%3 == 2) {
|
||||
$one['class'] = ' dtls';
|
||||
} else {
|
||||
$one['class'] = ' dtll';
|
||||
}
|
||||
}
|
||||
if(!$show && $one['uid']) {
|
||||
$show = true;
|
||||
}
|
||||
$clist[$cdoid][] = $one;
|
||||
}
|
||||
$showdoinglist[$cdoid] = $show;
|
||||
}
|
||||
|
||||
$multi = multi($count, $perpage, $page, $theurl);
|
||||
|
||||
dsetcookie('home_diymode', $diymode);
|
||||
if($_G['uid']) {
|
||||
if($_GET['view'] == 'all') {
|
||||
$navtitle = lang('core', 'title_view_all').lang('core', 'title_doing');
|
||||
} elseif($_GET['view'] == 'me') {
|
||||
$navtitle = lang('core', 'title_doing_view_me');
|
||||
} else {
|
||||
$navtitle = lang('core', 'title_me_friend_doing');
|
||||
}
|
||||
$defaultstr = getdefaultdoing();
|
||||
} else {
|
||||
$navtitle = lang('core', 'title_newest_doing');
|
||||
}
|
||||
|
||||
if($space['username']) {
|
||||
$navtitle = lang('space', 'sb_doing', array('who' => $space['username']));
|
||||
}
|
||||
$metakeywords = $navtitle;
|
||||
$metadescription = $navtitle;
|
||||
include_once template('diy:home/space_doing');
|
||||
|
||||
?>
|
124
source/include/space/space_favorite.php
Normal file
124
source/include/space/space_favorite.php
Normal file
@@ -0,0 +1,124 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: space_favorite.php 33832 2013-08-20 03:32:32Z nemohou $
|
||||
*/
|
||||
|
||||
if(!defined('IN_DISCUZ')) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
|
||||
if (!$_G['setting']['favoritestatus']) {
|
||||
showmessage('favorite_status_off');
|
||||
}
|
||||
|
||||
$space = getuserbyuid($_G['uid']);
|
||||
|
||||
$page = empty($_GET['page'])?1:intval($_GET['page']);
|
||||
if($page<1) $page=1;
|
||||
$id = empty($_GET['id'])?0:intval($_GET['id']);
|
||||
|
||||
$perpage = 20;
|
||||
|
||||
$_G['disabledwidthauto'] = 0;
|
||||
|
||||
$start = ($page-1)*$perpage;
|
||||
ckstart($start, $perpage);
|
||||
|
||||
$idtypes = array('thread'=>'tid', 'forum'=>'fid', 'blog'=>'blogid', 'group'=>'gid', 'album'=>'albumid', 'space'=>'uid', 'article'=>'aid');
|
||||
$_GET['type'] = isset($idtypes[$_GET['type']]) ? $_GET['type'] : 'all';
|
||||
$actives[$_GET['type']] = ' class="a"';
|
||||
|
||||
$gets = array(
|
||||
'mod' => 'space',
|
||||
'uid' => $space['uid'],
|
||||
'do' => 'favorite',
|
||||
'type' => $_GET['type'],
|
||||
'from' => $_GET['from']
|
||||
);
|
||||
$theurl = 'home.php?'.url_implode($gets);
|
||||
|
||||
$wherearr = $list = array();
|
||||
$favid = empty($_GET['favid'])?0:intval($_GET['favid']);
|
||||
$idtype = isset($idtypes[$_GET['type']]) ? $idtypes[$_GET['type']] : '';
|
||||
|
||||
$count = C::t('home_favorite')->count_by_uid_idtype($_G['uid'], $idtype, $favid);
|
||||
if($count) {
|
||||
$icons = array(
|
||||
'tid'=>'<img src="'.STATICURL.'image/feed/thread.gif" alt="thread" class="t" /> ',
|
||||
'fid'=>'<img src="'.STATICURL.'image/feed/discuz.gif" alt="forum" class="t" /> ',
|
||||
'blogid'=>'<img src="'.STATICURL.'image/feed/blog.gif" alt="blog" class="t" /> ',
|
||||
'gid'=>'<img src="'.STATICURL.'image/feed/group.gif" alt="group" class="t" /> ',
|
||||
'uid'=>'<img src="'.STATICURL.'image/feed/profile.gif" alt="space" class="t" /> ',
|
||||
'albumid'=>'<img src="'.STATICURL.'image/feed/album.gif" alt="album" class="t" /> ',
|
||||
'aid'=>'<img src="'.STATICURL.'image/feed/article.gif" alt="article" class="t" /> ',
|
||||
);
|
||||
$articles = array();
|
||||
foreach(C::t('home_favorite')->fetch_all_by_uid_idtype($_G['uid'], $idtype, $favid, $start,$perpage) as $value) {
|
||||
$value['icon'] = isset($icons[$value['idtype']]) ? $icons[$value['idtype']] : '';
|
||||
$value['url'] = makeurl($value['id'], $value['idtype'], $value['spaceuid']);
|
||||
$value['description'] = !empty($value['description']) ? nl2br($value['description']) : '';
|
||||
$list[$value['favid']] = $value;
|
||||
if($value['idtype'] == 'aid') {
|
||||
$articles[$value['favid']] = $value['id'];
|
||||
}
|
||||
}
|
||||
if(!empty($articles)) {
|
||||
include_once libfile('function/portal');
|
||||
$_urls = array();
|
||||
foreach(C::t('portal_article_title')->fetch_all($articles) as $aid => $article) {
|
||||
$_urls[$aid] = fetch_article_url($article);
|
||||
}
|
||||
foreach ($articles as $favid => $aid) {
|
||||
$list[$favid]['url'] = $_urls[$aid];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$multi = multi($count, $perpage, $page, $theurl);
|
||||
|
||||
dsetcookie('home_diymode', $diymode);
|
||||
|
||||
if(!$_GET['type']) {
|
||||
$_GET['type'] = 'all';
|
||||
}
|
||||
if($_GET['type'] == 'group') {
|
||||
$navtitle = lang('core', 'title_group_favorite', array('gorup' => $_G['setting']['navs'][3]['navname']));
|
||||
} else {
|
||||
$navtitle = lang('core', 'title_'.$_GET['type'].'_favorite');
|
||||
}
|
||||
|
||||
include_once template("diy:home/space_favorite");
|
||||
|
||||
function makeurl($id, $idtype, $spaceuid=0) {
|
||||
$url = '';
|
||||
switch($idtype) {
|
||||
case 'tid':
|
||||
$url = 'forum.php?mod=viewthread&tid='.$id;
|
||||
break;
|
||||
case 'fid':
|
||||
$url = 'forum.php?mod=forumdisplay&fid='.$id;
|
||||
break;
|
||||
case 'blogid':
|
||||
$url = 'home.php?mod=space&uid='.$spaceuid.'&do=blog&id='.$id;
|
||||
break;
|
||||
case 'gid':
|
||||
$url = 'forum.php?mod=group&fid='.$id;
|
||||
break;
|
||||
case 'uid':
|
||||
$url = 'home.php?mod=space&uid='.$id;
|
||||
break;
|
||||
case 'albumid':
|
||||
$url = 'home.php?mod=space&uid='.$spaceuid.'&do=album&id='.$id;
|
||||
break;
|
||||
case 'aid':
|
||||
$url = 'portal.php?mod=view&aid='.$id;
|
||||
break;
|
||||
}
|
||||
return $url;
|
||||
}
|
||||
|
||||
?>
|
272
source/include/space/space_friend.php
Normal file
272
source/include/space/space_friend.php
Normal file
@@ -0,0 +1,272 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: space_friend.php 32006 2012-10-30 09:51:28Z zhengqingpeng $
|
||||
*/
|
||||
|
||||
if(!defined('IN_DISCUZ')) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
|
||||
if (!$_G['setting']['friendstatus']) {
|
||||
showmessage('friend_status_off');
|
||||
}
|
||||
|
||||
$perpage = 24;
|
||||
$perpage = mob_perpage($perpage);
|
||||
|
||||
$list = $ols = $fuids = array();
|
||||
$count = 0;
|
||||
$page = empty($_GET['page'])?0:intval($_GET['page']);
|
||||
if($page<1) $page = 1;
|
||||
$start = ($page-1)*$perpage;
|
||||
|
||||
$_GET['view'] = in_array($_GET['view'], array('online', 'visitor', 'trace', 'blacklist', 'me')) ? $_GET['view'] : 'me';
|
||||
$_GET['order'] = in_array($_GET['order'], array('hot', 'dateline')) ? $_GET['order'] : 'dateline';
|
||||
|
||||
ckstart($start, $perpage);
|
||||
|
||||
if($_GET['view'] == 'online') {
|
||||
$theurl = "home.php?mod=space&uid={$space['uid']}&do=friend&view=online";
|
||||
$actives = array('me'=>' class="a"');
|
||||
|
||||
space_merge($space, 'field_home');
|
||||
$onlinedata = array();
|
||||
$wheresql = '';
|
||||
if($_GET['type']=='near') {
|
||||
$theurl = "home.php?mod=space&uid={$space['uid']}&do=friend&view=online&type=near";
|
||||
if(($count = C::app()->session->count_by_ip($_G['clientip']))) {
|
||||
$onlinedata = C::app()->session->fetch_all_by_ip($_G['clientip'], $start, $perpage);
|
||||
}
|
||||
} elseif($_GET['type']=='friend') {
|
||||
$theurl = "home.php?mod=space&uid={$space['uid']}&do=friend&view=online&type=friend";
|
||||
if(!empty($space['feedfriend'])) {
|
||||
$onlinedata = C::app()->session->fetch_all_by_uid(explode(',', $space['feedfriend']), $start, $perpage);
|
||||
}
|
||||
$count = count($onlinedata);
|
||||
} elseif($_GET['type']=='member') {
|
||||
$theurl = "home.php?mod=space&uid={$space['uid']}&do=friend&view=online&type=member";
|
||||
$wheresql = " WHERE uid>0";
|
||||
if(($count = C::app()->session->count(1))) {
|
||||
$onlinedata = C::app()->session->fetch_member(1, 2, $start, $perpage);
|
||||
}
|
||||
} else {
|
||||
$_GET['type']='all';
|
||||
$theurl = "home.php?mod=space&uid={$space['uid']}&do=friend&view=online&type=all";
|
||||
if(($count = C::app()->session->count_invisible(0))) {
|
||||
$onlinedata = C::app()->session->fetch_member(0, 2, $start, $perpage);
|
||||
}
|
||||
}
|
||||
|
||||
if($count) {
|
||||
|
||||
foreach($onlinedata as $value) {
|
||||
if($_GET['type']=='near') {
|
||||
if($value['uid'] == $space['uid']) {
|
||||
$count = $count-1;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if(!$value['invisible']) $ols[$value['uid']] = $value['lastactivity'];
|
||||
$list[$value['uid']] = $value;
|
||||
$fuids[$value['uid']] = $value['uid'];
|
||||
}
|
||||
|
||||
if($fuids) {
|
||||
require_once libfile('function/friend');
|
||||
friend_check($space['uid'], $fuids);
|
||||
|
||||
$fieldhome = C::t('common_member_field_home')->fetch_all($fuids);
|
||||
foreach(C::t('common_member')->fetch_all($fuids) as $uid => $value) {
|
||||
$value = array_merge($value, $fieldhome[$uid]);
|
||||
$value['isfriend'] = $uid==$space['uid'] || $_G["home_friend_".$space['uid'].'_'.$uid] ? 1 : 0;
|
||||
$list[$uid] = array_merge($list[$uid], $value);
|
||||
}
|
||||
}
|
||||
}
|
||||
$multi = multi($count, $perpage, $page, $theurl);
|
||||
|
||||
} elseif($_GET['view'] == 'visitor' || $_GET['view'] == 'trace') {
|
||||
|
||||
$theurl = "home.php?mod=space&uid={$space['uid']}&do=friend&view={$_GET['view']}";
|
||||
$actives = array('me'=>' class="a"');
|
||||
|
||||
if($_GET['view'] == 'visitor') {
|
||||
$count = C::t('home_visitor')->count_by_uid($space['uid']);
|
||||
} else {
|
||||
$count = C::t('home_visitor')->count_by_vuid($space['uid']);
|
||||
}
|
||||
if($count) {
|
||||
if($_GET['view'] == 'visitor') {
|
||||
$visitors = C::t('home_visitor')->fetch_all_by_uid($space['uid'], $start, $perpage);
|
||||
} else {
|
||||
$visitors = C::t('home_visitor')->fetch_all_by_vuid($space['uid'], $start, $perpage);
|
||||
}
|
||||
foreach($visitors as $value) {
|
||||
if($_GET['view'] == 'visitor') {
|
||||
$value['uid'] = $value['vuid'];
|
||||
$value['username'] = $value['vusername'];
|
||||
}
|
||||
$fuids[] = $value['uid'];
|
||||
$list[$value['uid']] = $value;
|
||||
}
|
||||
}
|
||||
$multi = multi($count, $perpage, $page, $theurl);
|
||||
|
||||
} elseif($_GET['view'] == 'blacklist') {
|
||||
|
||||
$theurl = "home.php?mod=space&uid={$space['uid']}&do=friend&view={$_GET['view']}";
|
||||
$actives = array('me'=>' class="a"');
|
||||
|
||||
$count = C::t('home_blacklist')->count_by_uid_buid($space['uid']);
|
||||
if($count) {
|
||||
$backlist = C::t('home_blacklist')->fetch_all_by_uid($space['uid'], $start,$perpage);
|
||||
$members = C::t('common_member')->fetch_all(array_keys($backlist));
|
||||
foreach($backlist as $buid => $value) {
|
||||
$value = array_merge($value, $members[$buid]);
|
||||
$value['isfriend'] = 0;
|
||||
$fuids[] = $value['uid'];
|
||||
$list[$value['uid']] = $value;
|
||||
}
|
||||
}
|
||||
$multi = multi($count, $perpage, $page, $theurl);
|
||||
|
||||
} else {
|
||||
|
||||
$theurl = "home.php?mod=space&uid={$space['uid']}&do=$do";
|
||||
$actives = array('me'=>' class="a"');
|
||||
|
||||
$_GET['view'] = 'me';
|
||||
|
||||
$querydata = array();
|
||||
if($space['self']) {
|
||||
require_once libfile('function/friend');
|
||||
$groups = friend_group_list();
|
||||
$group = !isset($_GET['group'])?'-1':intval($_GET['group']);
|
||||
if($group > -1) {
|
||||
$querydata['gid'] = $group;
|
||||
$theurl .= "&group=$group";
|
||||
}
|
||||
}
|
||||
if($_GET['searchkey']) {
|
||||
require_once libfile('function/search');
|
||||
$querydata['searchkey'] = $_GET['searchkey'];
|
||||
$theurl .= "&searchkey={$_GET['searchkey']}";
|
||||
}
|
||||
|
||||
$count = C::t('home_friend')->fetch_all_search($space['uid'], $querydata['gid'], $querydata['searchkey'], true);
|
||||
$membercount = C::t('common_member_count')->fetch($_G['uid']);
|
||||
$friendnum = $membercount['friends'];
|
||||
unset($membercount);
|
||||
if($count) {
|
||||
|
||||
$query = C::t('home_friend')->fetch_all_search($space['uid'], $querydata['gid'], $querydata['searchkey'], false, $start, $perpage, $_GET['order'] ? true : false);
|
||||
foreach($query as $value) {
|
||||
$value['uid'] = $value['fuid'];
|
||||
$_G["home_friend_".$space['uid'].'_'.$value['uid']] = $value['isfriend'] = 1;
|
||||
$fuids[$value['uid']] = $value['uid'];
|
||||
$list[$value['uid']] = $value;
|
||||
}
|
||||
} elseif(!$friendnum) {
|
||||
if(($specialuser_count = C::t('home_specialuser')->count_by_status(1))) {
|
||||
foreach(C::t('home_specialuser')->fetch_all_by_status(1, 7) as $value) {
|
||||
if($_G['uid'] !== $value['uid']) {
|
||||
$fuids[$value['uid']] = $value['uid'];
|
||||
$specialuser_list[$value['uid']] = $value;
|
||||
}
|
||||
if(count($fuids) >= 6) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
$specialuser_list = getfollowflag($specialuser_list);
|
||||
|
||||
}
|
||||
if(($online_count = C::app()->session->count(1)) > 1) {
|
||||
$oluids = $online_list = array();
|
||||
foreach(C::app()->session->fetch_member(1, 2, 7) as $value) {
|
||||
if($value['uid'] != $_G['uid'] && count($oluids) <= 6) {
|
||||
$fuids[$value['uid']] = $value['uid'];
|
||||
$oluids[$value['uid']] = $value['uid'];
|
||||
$online_list[$value['uid']] = $value;
|
||||
}
|
||||
}
|
||||
$online_list = getfollowflag($online_list);
|
||||
|
||||
$fieldhome = C::t('common_member_field_home')->fetch_all($oluids, false, 0);
|
||||
foreach(C::t('common_member')->fetch_all($oluids, false, 0) as $uid => $value) {
|
||||
$value = array_merge($value, $fieldhome[$uid]);
|
||||
$online_list[$uid] = array_merge($online_list[$uid], $value);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$diymode = 1;
|
||||
if($space['self'] && ($_GET['from'] != 'space' || !$_G['setting']['homepagestyle'])) $diymode = 0;
|
||||
if($diymode) {
|
||||
$theurl .= "&from=space";
|
||||
}
|
||||
|
||||
$multi = multi($count, $perpage, $page, $theurl);
|
||||
|
||||
if($space['self']) {
|
||||
$groupselect = array($group => ' class="a"');
|
||||
|
||||
$maxfriendnum = checkperm('maxfriendnum');
|
||||
if($maxfriendnum) {
|
||||
$maxfriendnum = checkperm('maxfriendnum') + $space['addfriend'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($fuids) {
|
||||
foreach(C::app()->session->fetch_all_by_uid($fuids) as $value) {
|
||||
if(!$value['invisible']) {
|
||||
$ols[$value['uid']] = $value['lastactivity'];
|
||||
} elseif($list[$value['uid']] && !in_array($_GET['view'], array('me', 'trace', 'blacklist'))) {
|
||||
unset($list[$value['uid']]);
|
||||
$count = $count - 1;
|
||||
}
|
||||
}
|
||||
if($_GET['view'] != 'me') {
|
||||
require_once libfile('function/friend');
|
||||
friend_check($fuids);
|
||||
}
|
||||
if($list) {
|
||||
$fieldhome = C::t('common_member_field_home')->fetch_all($fuids);
|
||||
foreach(C::t('common_member')->fetch_all($fuids) as $uid => $value) {
|
||||
$fieldhome_value = is_array($fieldhome[$uid]) ? $fieldhome[$uid] : array();
|
||||
$value = array_merge($value, $fieldhome_value);
|
||||
$value['isfriend'] = $uid==$space['uid'] || $_G["home_friend_".$space['uid'].'_'.$uid] ? 1 : 0;
|
||||
if(empty($list[$uid])) $list[$uid] = array();
|
||||
$list[$uid] = array_merge($list[$uid], $value);
|
||||
}
|
||||
}
|
||||
}
|
||||
if($list) {
|
||||
$list = getfollowflag($list);
|
||||
}
|
||||
$navtitle = lang('core', 'title_friend_list');
|
||||
|
||||
$navtitle = lang('space', 'sb_friend', array('who' => $space['username']));
|
||||
$metakeywords = lang('space', 'sb_friend', array('who' => $space['username']));
|
||||
$metadescription = lang('space', 'sb_share', array('who' => $space['username']));
|
||||
|
||||
$a_actives = array($_GET['view'].$_GET['type'] => ' class="a"');
|
||||
include_once template("diy:home/space_friend");
|
||||
|
||||
function getfollowflag($data) {
|
||||
global $_G;
|
||||
if($data) {
|
||||
$follows = C::t('home_follow')->fetch_all_by_uid_followuid($_G['uid'], array_keys($data));
|
||||
foreach($data as $uid => $value) {
|
||||
$data[$uid]['follow'] = isset($follows[$uid]) ? 1 : 0;
|
||||
}
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
?>
|
412
source/include/space/space_home.php
Normal file
412
source/include/space/space_home.php
Normal file
@@ -0,0 +1,412 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: space_home.php 30780 2012-06-19 06:01:52Z zhengqingpeng $
|
||||
*/
|
||||
|
||||
if(!defined('IN_DISCUZ')) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
|
||||
if(!$_G['uid'] && $_G['setting']['privacy']['view']['home']) {
|
||||
showmessage('home_no_privilege', '', array(), array('login' => true));
|
||||
}
|
||||
require_once libfile('function/feed');
|
||||
|
||||
if(empty($_G['setting']['feedhotday'])) {
|
||||
$_G['setting']['feedhotday'] = 2;
|
||||
}
|
||||
|
||||
$minhot = $_G['setting']['feedhotmin']<1?3:$_G['setting']['feedhotmin'];
|
||||
|
||||
space_merge($space, 'count');
|
||||
|
||||
if($_G['uid'] != $space['uid'] && !$_G['group']['allowviewprofile']) {
|
||||
if(!$_G['uid']) {
|
||||
showmessage('home_no_privilege', '', array(), array('login' => true));
|
||||
} else {
|
||||
showmessage('no_privilege_profile');
|
||||
}
|
||||
}
|
||||
|
||||
if(empty($_GET['view'])) {
|
||||
if($space['self']) {
|
||||
if($_G['setting']['showallfriendnum'] && $space['friends'] < $_G['setting']['showallfriendnum']) {
|
||||
$_GET['view'] = 'all';
|
||||
} else {
|
||||
$_GET['view'] = 'we';
|
||||
}
|
||||
} else {
|
||||
$_GET['view'] = 'all';
|
||||
}
|
||||
} elseif(!in_array($_GET['view'], array('we', 'me', 'all', 'app'))) {
|
||||
$_GET['view'] = 'all';
|
||||
}
|
||||
|
||||
$_GET['order'] = in_array($_GET['order'], array('hot', 'dateline')) ? $_GET['order'] : 'dateline';
|
||||
|
||||
$perpage = $_G['setting']['feedmaxnum']<20?20:$_G['setting']['feedmaxnum'];
|
||||
$perpage = mob_perpage($perpage);
|
||||
|
||||
if($_GET['view'] == 'all' && $_GET['order'] == 'hot') {
|
||||
$perpage = 50;
|
||||
}
|
||||
|
||||
$page = intval($_GET['page']);
|
||||
if($page < 1) $page = 1;
|
||||
$start = ($page-1)*$perpage;
|
||||
|
||||
ckstart($start, $perpage);
|
||||
|
||||
$_G['home_today'] = $_G['timestamp'] - ($_G['timestamp'] + $_G['setting']['timeoffset'] * 3600) % 86400;
|
||||
|
||||
$gets = array(
|
||||
'mod' => 'space',
|
||||
'uid' => $space['uid'],
|
||||
'do' => 'home',
|
||||
'view' => $_GET['view'],
|
||||
'order' => $_GET['order'],
|
||||
'type' => $_GET['type'],
|
||||
'icon' => $_GET['icon']
|
||||
);
|
||||
$theurl = 'home.php?'.url_implode($gets);
|
||||
$hotlist = array();
|
||||
if(!IS_ROBOT) {
|
||||
$feed_users = $feed_list = $user_list = $filter_list = $list = $magic = array();
|
||||
if($_GET['view'] != 'app') {
|
||||
if($space['self'] && empty($start) && $_G['setting']['feedhotnum'] > 0 && ($_GET['view'] == 'we' || $_GET['view'] == 'all')) {
|
||||
$hotlist_all = array();
|
||||
$hotstarttime = $_G['timestamp'] - $_G['setting']['feedhotday']*3600*24;
|
||||
$query = C::t('home_feed')->fetch_all_by_hot($hotstarttime);
|
||||
foreach ($query as $value) {
|
||||
if($value['hot']>0 && ckfriend($value['uid'], $value['friend'], $value['target_ids'])) {
|
||||
if(empty($hotlist)) {
|
||||
$hotlist[$value['feedid']] = $value;
|
||||
} else {
|
||||
$hotlist_all[$value['feedid']] = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
$nexthotnum = $_G['setting']['feedhotnum'] - 1;
|
||||
if($nexthotnum > 0) {
|
||||
if(count($hotlist_all)> $nexthotnum) {
|
||||
$hotlist_key = array_rand($hotlist_all, $nexthotnum);
|
||||
if($nexthotnum == 1) {
|
||||
$hotlist[$hotlist_key] = $hotlist_all[$hotlist_key];
|
||||
} else {
|
||||
foreach ($hotlist_key as $key) {
|
||||
$hotlist[$key] = $hotlist_all[$key];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$hotlist = array_merge($hotlist, $hotlist_all);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$need_count = true;
|
||||
$uids = array();
|
||||
$multi = $hot = '';
|
||||
|
||||
if($_GET['view'] == 'all') {
|
||||
|
||||
if($_GET['order'] == 'dateline') {
|
||||
$ordersql = "dateline DESC";
|
||||
$f_index = '';
|
||||
$findex = '';
|
||||
$orderactives = array('dateline' => ' class="a"');
|
||||
} else {
|
||||
$hot = $minhot;
|
||||
$ordersql = "dateline DESC";
|
||||
$f_index = '';
|
||||
$findex = '';
|
||||
$orderactives = array('hot' => ' class="a"');
|
||||
}
|
||||
|
||||
} elseif($_GET['view'] == 'me') {
|
||||
|
||||
$uids = array($space['uid']);
|
||||
$ordersql = "dateline DESC";
|
||||
$f_index = '';
|
||||
$findex = '';
|
||||
|
||||
$diymode = 1;
|
||||
if($space['self'] && $_GET['from'] != 'space') $diymode = 0;
|
||||
|
||||
} else {
|
||||
|
||||
space_merge($space, 'field_home');
|
||||
|
||||
if(empty($space['feedfriend'])) {
|
||||
$need_count = false;
|
||||
} else {
|
||||
$uids = array_merge(explode(',', $space['feedfriend']), array(0));
|
||||
$ordersql = "dateline DESC";
|
||||
$f_index = 'USE INDEX(dateline)';
|
||||
$findex = 'dateline';
|
||||
}
|
||||
}
|
||||
|
||||
$icon = empty($_GET['icon'])?'':trim($_GET['icon']);
|
||||
$gid = !isset($_GET['gid'])?'-1':intval($_GET['gid']);
|
||||
if($gid>=0) {
|
||||
$fuids = array();
|
||||
$query = C::t('home_friend')->fetch_all_by_uid_gid($_G['uid'], $gid);
|
||||
foreach($query as $value) {
|
||||
$fuids[] = $value['fuid'];
|
||||
}
|
||||
if(empty($fuids)) {
|
||||
$need_count = false;
|
||||
} else {
|
||||
$uids = $fuids;
|
||||
}
|
||||
}
|
||||
$gidactives[$gid] = ' class="a"';
|
||||
|
||||
$count = $filtercount = 0;
|
||||
|
||||
if($need_count) {
|
||||
|
||||
$query = C::t('home_feed')->fetch_all_by_search(1, $uids, $icon, '', '', '', $hot, '', $start, $perpage, $findex);
|
||||
|
||||
if($_GET['view'] == 'me') {
|
||||
foreach ($query as $value) {
|
||||
if(!isset($hotlist[$value['feedid']]) && !isset($hotlist_all[$value['feedid']]) && ckfriend($value['uid'], $value['friend'], $value['target_ids'])) {
|
||||
$value = mkfeed($value);
|
||||
|
||||
if($value['dateline']>=$_G['home_today']) {
|
||||
$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();
|
||||
|
||||
foreach($query as $value) {
|
||||
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']])) $feed_users[$dkey][$value['uid']] = $value;
|
||||
if(empty($uid_feedcount[$dkey][$value['uid']])) $uid_feedcount[$dkey][$value['uid']] = 0;
|
||||
|
||||
$uid_feedcount[$dkey][$value['uid']]++;
|
||||
|
||||
if($uid_feedcount[$dkey][$value['uid']]>$maxshownum) {
|
||||
$more_list[$dkey][$value['uid']][] = $value;
|
||||
} else {
|
||||
$feed_list[$dkey][$value['uid']][] = $value;
|
||||
}
|
||||
|
||||
} elseif(empty($hash_datas[$value['hash_data']])) {
|
||||
$hash_datas[$value['hash_data']] = 1;
|
||||
if(empty($feed_users[$dkey][$value['uid']])) $feed_users[$dkey][$value['uid']] = $value;
|
||||
if(empty($uid_feedcount[$dkey][$value['uid']])) $uid_feedcount[$dkey][$value['uid']] = 0;
|
||||
|
||||
|
||||
$uid_feedcount[$dkey][$value['uid']] ++;
|
||||
|
||||
if($uid_feedcount[$dkey][$value['uid']]>$maxshownum) {
|
||||
$more_list[$dkey][$value['uid']][] = $value;
|
||||
} else {
|
||||
$feed_list[$dkey][$value['uid']][$value['hash_data']] = $value;
|
||||
}
|
||||
|
||||
} else {
|
||||
$user_list[$value['hash_data']][] = "<a href=\"home.php?mod=space&uid={$value['uid']}\">{$value['username']}</a>";
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
$filtercount++;
|
||||
$filter_list[] = $value;
|
||||
}
|
||||
}
|
||||
$count++;
|
||||
}
|
||||
}
|
||||
|
||||
$multi = simplepage($count, $perpage, $page, $theurl);
|
||||
}
|
||||
}
|
||||
|
||||
$olfriendlist = $visitorlist = $task = $ols = $birthlist = $guidelist = array();
|
||||
$oluids = array();
|
||||
$groups = array();
|
||||
$defaultusers = $newusers = $showusers = array();
|
||||
|
||||
if($space['self'] && empty($start)) {
|
||||
|
||||
space_merge($space, 'field_home');
|
||||
if($_GET['view'] == 'we') {
|
||||
require_once libfile('function/friend');
|
||||
$groups = friend_group_list();
|
||||
}
|
||||
|
||||
$isnewer = ($_G['timestamp']-$space['regdate'] > 3600*24*7) ?0:1;
|
||||
if($isnewer && $_G['setting']['homestyle']) {
|
||||
|
||||
$friendlist = array();
|
||||
$query = C::t('home_friend')->fetch_all($space['uid']);
|
||||
foreach($query as $value) {
|
||||
$friendlist[$value['fuid']] = 1;
|
||||
}
|
||||
|
||||
foreach(C::t('home_specialuser')->fetch_all_by_status(1) as $value) {
|
||||
if(empty($friendlist[$value['uid']])) {
|
||||
$defaultusers[] = $value;
|
||||
$oluids[] = $value['uid'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($space['newprompt']) {
|
||||
space_merge($space, 'status');
|
||||
}
|
||||
|
||||
if($_G['setting']['homestyle']) {
|
||||
foreach(C::t('home_visitor')->fetch_all_by_uid($space['uid'], 12) as $value) {
|
||||
$visitorlist[$value['vuid']] = $value;
|
||||
$oluids[] = $value['vuid'];
|
||||
}
|
||||
|
||||
if($oluids) {
|
||||
foreach(C::app()->session->fetch_all_by_uid($oluids) as $value) {
|
||||
if(!$value['invisible']) {
|
||||
$ols[$value['uid']] = 1;
|
||||
} elseif ($visitorlist[$value['uid']]) {
|
||||
unset($visitorlist[$value['uid']]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$oluids = array();
|
||||
$olfcount = 0;
|
||||
if($space['feedfriend']) {
|
||||
foreach(C::app()->session->fetch_all_by_uid(explode(',', $space['feedfriend']), 15) as $value) {
|
||||
if($olfcount < 15 && !$value['invisible']) {
|
||||
$olfriendlist[$value['uid']] = $value;
|
||||
$ols[$value['uid']] = 1;
|
||||
$oluids[$value['uid']] = $value['uid'];
|
||||
$olfcount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
if($olfcount < 15) {
|
||||
$query = C::t('home_friend')->fetch_all_by_uid($space['uid'], 0, 32, true);
|
||||
foreach($query as $value) {
|
||||
$value['uid'] = $value['fuid'];
|
||||
$value['username'] = $value['fusername'];
|
||||
if(empty($oluids[$value['uid']])) {
|
||||
$olfriendlist[$value['uid']] = $value;
|
||||
$olfcount++;
|
||||
if($olfcount == 15) break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($space['feedfriend']) {
|
||||
$birthdaycache = C::t('forum_spacecache')->fetch_spacecache($_G['uid'], 'birthday');
|
||||
if(empty($birthdaycache) || TIMESTAMP > $birthdaycache['expiration']) {
|
||||
$birthlist = C::t('common_member_profile')->fetch_all_will_birthday_by_uid($space['feedfriend']);
|
||||
|
||||
C::t('forum_spacecache')->insert(array(
|
||||
'uid' => $_G['uid'],
|
||||
'variable' => 'birthday',
|
||||
'value' => serialize($birthlist),
|
||||
'expiration' => getexpiration(),
|
||||
), false, true);
|
||||
} else {
|
||||
$birthlist = dunserialize($birthdaycache['value']);
|
||||
}
|
||||
}
|
||||
|
||||
if($_G['setting']['taskstatus']) {
|
||||
require_once libfile('class/task');
|
||||
$tasklib = & task::instance();
|
||||
$taskarr = $tasklib->tasklist('canapply');
|
||||
$task = count($taskarr) ? $taskarr[array_rand($taskarr)] : array();
|
||||
}
|
||||
if($_G['setting']['magicstatus']) {
|
||||
loadcache('magics');
|
||||
if(!empty($_G['cache']['magics'])) {
|
||||
$magic = $_G['cache']['magics'][array_rand($_G['cache']['magics'])];
|
||||
$magic['description'] = cutstr($magic['description'], 34, '');
|
||||
$magic['pic'] = strtolower($magic['identifier']).'.gif';
|
||||
}
|
||||
}
|
||||
}
|
||||
} elseif(empty($_G['uid'])) {
|
||||
$defaultusers = C::t('home_specialuser')->fetch_all_by_status(1, 12);
|
||||
|
||||
$query = C::t('home_show')->fetch_all_by_credit(0, 12); //DB::query("SELECT * FROM ".DB::table('home_show')." ORDER BY credit DESC LIMIT 0,12");
|
||||
foreach($query as $value) {
|
||||
$showusers[] = $value;
|
||||
}
|
||||
|
||||
foreach(C::t('common_member')->range(0, 12,'DESC') as $uid => $value) {
|
||||
$value['regdate'] = dgmdate($value['regdate'], 'u', 9999, 'm-d');
|
||||
$newusers[$uid] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
dsetcookie('home_readfeed', $_G['timestamp'], 365*24*3600);
|
||||
if($_G['uid']) {
|
||||
$defaultstr = getdefaultdoing();
|
||||
space_merge($space, 'status');
|
||||
if(!$space['profileprogress']) {
|
||||
include_once libfile('function/profile');
|
||||
$space['profileprogress'] = countprofileprogress();
|
||||
}
|
||||
}
|
||||
$actives = array($_GET['view'] => ' class="a"');
|
||||
if($_GET['from'] == 'space') {
|
||||
if($_GET['do'] == 'home') {
|
||||
$navtitle = lang('space', 'sb_feed', array('who' => $space['username']));
|
||||
$metakeywords = lang('space', 'sb_feed', array('who' => $space['username']));
|
||||
$metadescription = lang('space', 'sb_feed', array('who' => $space['username']));
|
||||
}
|
||||
} else {
|
||||
list($navtitle, $metadescription, $metakeywords) = get_seosetting('home');
|
||||
if(!$navtitle) {
|
||||
$navtitle = $_G['setting']['navs'][4]['navname'];
|
||||
$nobbname = false;
|
||||
} else {
|
||||
$nobbname = true;
|
||||
}
|
||||
|
||||
if(!$metakeywords) {
|
||||
$metakeywords = $_G['setting']['navs'][4]['navname'];
|
||||
}
|
||||
|
||||
if(!$metadescription) {
|
||||
$metadescription = $_G['setting']['navs'][4]['navname'];
|
||||
}
|
||||
}
|
||||
if(empty($cp_mode)) include_once template("diy:home/space_home");
|
||||
|
||||
?>
|
93
source/include/space/space_index.php
Normal file
93
source/include/space/space_index.php
Normal file
@@ -0,0 +1,93 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: space_index.php 31354 2012-08-16 03:03:08Z chenmengshu $
|
||||
*/
|
||||
|
||||
if(!defined('IN_DISCUZ')) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
|
||||
if(($_G['adminid'] == 1 && $_G['setting']['allowquickviewprofile'] && $_GET['view'] != 'admin' && $_GET['diy'] != 'yes') || defined('IN_MOBILE')) {
|
||||
dheader("Location:home.php?mod=space&uid={$space['uid']}&do=profile");
|
||||
}
|
||||
|
||||
require_once libfile('function/space');
|
||||
|
||||
space_merge($space, 'field_home');
|
||||
$userdiy = getuserdiydata($space);
|
||||
|
||||
if ($_GET['op'] == 'getmusiclist') {
|
||||
if(empty($space['uid'])) {
|
||||
exit();
|
||||
}
|
||||
$reauthcode = substr(md5($_G['authkey'].$space['uid']), 6, 16);
|
||||
if($reauthcode == $_GET['hash']) {
|
||||
space_merge($space,'field_home');
|
||||
$userdiy = getuserdiydata($space);
|
||||
helper_output::json($userdiy['parameters']['music']);
|
||||
}
|
||||
exit();
|
||||
|
||||
}else{
|
||||
|
||||
if(!$_G['setting']['preventrefresh'] || $_G['uid'] && !$space['self'] && $_G['cookie']['viewid'] != 'uid_'.$space['uid']) {
|
||||
member_count_update($space['uid'], array('views' => 1));
|
||||
$viewuids[$space['uid']] = $space['uid'];
|
||||
dsetcookie('viewid', 'uid_'.$space['uid']);
|
||||
}
|
||||
|
||||
show_view();
|
||||
|
||||
if($_GET['additional'] == 'removevlog') {
|
||||
C::t('home_visitor')->delete_by_uid_vuid($space['uid'], $_G['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');
|
||||
if($space['medals']) {
|
||||
loadcache('medals');
|
||||
foreach($space['medals'] = explode("\t", $space['medals']) as $key => $medalid) {
|
||||
list($medalid, $medalexpiration) = explode("|", $medalid);
|
||||
if(isset($_G['cache']['medals'][$medalid]) && (!$medalexpiration || $medalexpiration > TIMESTAMP)) {
|
||||
$space['medals'][$key] = $_G['cache']['medals'][$medalid];
|
||||
} else {
|
||||
unset($space['medals'][$key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
include_once(template('home/space_index'));
|
||||
|
||||
function formatdata($data, $position, $space) {
|
||||
$list = array();
|
||||
foreach ((array)$data['block']['frame`frame1']['column`frame1_'.$position] as $blockname => $blockdata) {
|
||||
if (strpos($blockname, 'block`') === false || empty($blockdata) || !isset($blockdata['attr']['name'])) continue;
|
||||
$name = $blockdata['attr']['name'];
|
||||
if(check_ban_block($name, $space)) {
|
||||
$list[$name] = getblockhtml($name, $data['parameters'][$name]);
|
||||
}
|
||||
}
|
||||
return $list;
|
||||
}
|
||||
|
||||
?>
|
118
source/include/space/space_notice.php
Normal file
118
source/include/space/space_notice.php
Normal file
@@ -0,0 +1,118 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: space_notice.php 34047 2013-09-25 04:41:45Z nemohou $
|
||||
*/
|
||||
|
||||
if(!defined('IN_DISCUZ')) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
|
||||
$perpage = 30;
|
||||
$perpage = mob_perpage($perpage);
|
||||
|
||||
$page = empty($_GET['page'])?0:intval($_GET['page']);
|
||||
if($page<1) $page = 1;
|
||||
$start = ($page-1)*$perpage;
|
||||
|
||||
ckstart($start, $perpage);
|
||||
|
||||
$list = array();
|
||||
$mynotice = $count = 0;
|
||||
$multi = '';
|
||||
|
||||
if(empty($_G['member']['category_num']['manage']) && !in_array($_G['adminid'], array(1,2,3))) {
|
||||
unset($_G['notice_structure']['manage']);
|
||||
}
|
||||
$view = (!empty($_GET['view']) && (isset($_G['notice_structure'][$_GET['view']]))) ? $_GET['view'] : 'all';
|
||||
$actives = array($view=>' class="a"');
|
||||
$opactives[$view] = 'class="a"';
|
||||
$categorynum = $newprompt = array();
|
||||
if($view) {
|
||||
|
||||
if(!empty($_GET['ignore'])) {
|
||||
C::t('home_notification')->ignore($_G['uid']);
|
||||
}
|
||||
|
||||
foreach (array('wall', 'piccomment', 'blogcomment', 'clickblog', 'clickpic', 'sharecomment', 'doing', 'friend', 'credit', 'bbs', 'system', 'thread', 'task', 'group') as $key) {
|
||||
$noticetypes[$key] = lang('notification', "type_$key");
|
||||
}
|
||||
|
||||
$isread = in_array($_GET['isread'], array(0, 1)) ? intval($_GET['isread']) : 0;
|
||||
$category = $type = '';
|
||||
if(isset($_G['notice_structure'][$view])) {
|
||||
if(!in_array($view, array('mypost', 'interactive'))) {
|
||||
$category = $view;
|
||||
} else {
|
||||
$deftype = $_G['notice_structure'][$view][0];
|
||||
if($_G['member']['newprompt_num']) {
|
||||
foreach($_G['notice_structure'][$view] as $subtype) {
|
||||
if($_G['member']['newprompt_num'][$subtype]) {
|
||||
$deftype = $subtype;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
$type = in_array($_GET['type'], $_G['notice_structure'][$view]) ? trim($_GET['type']) : $deftype;
|
||||
}
|
||||
}
|
||||
$wherearr = array();
|
||||
$new = -1;
|
||||
if(!empty($type)) {
|
||||
$wherearr[] = "`type`='$type'";
|
||||
}
|
||||
|
||||
$sql = ' AND '.implode(' AND ', $wherearr);
|
||||
|
||||
|
||||
$newnotify = false;
|
||||
$count = C::t('home_notification')->count_by_uid($_G['uid'], $new, $type, $category);
|
||||
if($count) {
|
||||
if($new == 1 && $perpage == 30) {
|
||||
$perpage = 200;
|
||||
}
|
||||
foreach(C::t('home_notification')->fetch_all_by_uid($_G['uid'], $new, $type, $start, $perpage, $category) as $value) {
|
||||
if($value['new']) {
|
||||
$newnotify = true;
|
||||
$value['style'] = 'color:#000;font-weight:bold;';
|
||||
} else {
|
||||
$value['style'] = '';
|
||||
}
|
||||
$value['rowid'] = '';
|
||||
if(in_array($value['type'], array('friend', 'poke'))) {
|
||||
$value['rowid'] = ' id="'.($value['type'] == 'friend' ? 'pendingFriend_' : 'pokeQuery_').$value['authorid'].'" ';
|
||||
}
|
||||
if($value['from_num'] > 0) $value['from_num'] = $value['from_num'] - 1;
|
||||
$list[$value['id']] = $value;
|
||||
}
|
||||
|
||||
$multi = '';
|
||||
$multi = multi($count, $perpage, $page, "home.php?mod=space&do=$do&view=$view&type=$type&isread=1");
|
||||
}
|
||||
|
||||
if($newnotify) {
|
||||
C::t('home_notification')->ignore($_G['uid'], $type, $category, true, true);
|
||||
}
|
||||
helper_notification::update_newprompt($_G['uid'], ($type ? $type : $category));
|
||||
if($_G['member']['newprompt']) {
|
||||
$recountprompt = 0;
|
||||
foreach($_G['member']['category_num'] as $promptnum) {
|
||||
$recountprompt += $promptnum;
|
||||
}
|
||||
$recountprompt += $mynotice;
|
||||
if($recountprompt == 0) {
|
||||
C::t('common_member')->update($_G['uid'], array('newprompt' => 0));
|
||||
}
|
||||
}
|
||||
|
||||
$readtag = array($type => ' class="a"');
|
||||
|
||||
|
||||
}
|
||||
dsetcookie('promptstate_'.$_G['uid'], '', 31536000);
|
||||
include_once template("diy:home/space_notice");
|
||||
|
||||
?>
|
21
source/include/space/space_plugin.php
Normal file
21
source/include/space/space_plugin.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: space_plugin.php 33362 2013-05-31 09:31:22Z andyzheng $
|
||||
*/
|
||||
|
||||
if(!defined('IN_DISCUZ')) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
|
||||
$pluginkey = 'space_'.$_GET['op'];
|
||||
$_GET['id'] = $_GET['id'] ? preg_replace("/[^A-Za-z0-9_:]/", '', $_GET['id']) : '';
|
||||
$navtitle = $_G['setting']['plugins'][$pluginkey][$_GET['id']]['name'];
|
||||
|
||||
include pluginmodule($_GET['id'], $pluginkey);
|
||||
include template('home/space_plugin');
|
||||
|
||||
?>
|
213
source/include/space/space_pm.php
Normal file
213
source/include/space/space_pm.php
Normal file
@@ -0,0 +1,213 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: space_pm.php 33421 2013-06-09 03:30:16Z jeffjzhang $
|
||||
*/
|
||||
|
||||
if(!defined('IN_DISCUZ')) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
|
||||
loaducenter();
|
||||
|
||||
$list = array();
|
||||
|
||||
$plid = empty($_GET['plid'])?0:intval($_GET['plid']);
|
||||
$daterange = empty($_GET['daterange'])?0:intval($_GET['daterange']);
|
||||
$touid = empty($_GET['touid'])?0:intval($_GET['touid']);
|
||||
$opactives['pm'] = 'class="a"';
|
||||
|
||||
if(empty($_G['member']['category_num']['manage']) && !in_array($_G['adminid'], array(1,2,3))) {
|
||||
unset($_G['notice_structure']['manage']);
|
||||
}
|
||||
|
||||
if($_GET['subop'] == 'view') {
|
||||
$type = $_GET['type'];
|
||||
$page = empty($_GET['page']) ? 0 : intval($_GET['page']);
|
||||
|
||||
$chatpmmember = intval($_GET['chatpmmember']);
|
||||
$chatpmmemberlist = array();
|
||||
if($chatpmmember) {
|
||||
$chatpmmember = uc_pm_chatpmmemberlist($_G['uid'], $plid);
|
||||
if(!empty($chatpmmember)) {
|
||||
$authorid = $founderuid = $chatpmmember['author'];
|
||||
$chatpmmemberlist = C::t('common_member')->fetch_all($chatpmmember['member']);
|
||||
foreach(C::t('common_member_field_home')->fetch_all($chatpmmember['member']) as $uid => $member) {
|
||||
$chatpmmemberlist[$uid] = array_merge($member, $chatpmmemberlist[$uid]);
|
||||
}
|
||||
}
|
||||
require_once libfile('function/friend');
|
||||
$friendgrouplist = friend_group_list();
|
||||
$actives = array('chatpmmember'=>' class="a"');
|
||||
} else {
|
||||
if($touid) {
|
||||
$ols = array();
|
||||
if(defined('IN_MOBILE')) {
|
||||
$perpage = 5;
|
||||
} else {
|
||||
$perpage = 10;
|
||||
}
|
||||
$perpage = mob_perpage($perpage);
|
||||
if(!$daterange) {
|
||||
$member = getuserbyuid($touid);
|
||||
$tousername = $member['username'];
|
||||
unset($member);
|
||||
$count = uc_pm_view_num($_G['uid'], $touid, 0);
|
||||
if(!$page) {
|
||||
$page = ceil($count/$perpage);
|
||||
}
|
||||
$list = uc_pm_view($_G['uid'], 0, $touid, 5, ceil($count/$perpage)-$page+1, $perpage, 0, 0);
|
||||
$multi = pmmulti($count, $perpage, $page, "home.php?mod=space&do=pm&subop=view&touid=$touid");
|
||||
} else {
|
||||
showmessage('parameters_error');
|
||||
}
|
||||
} else {
|
||||
if(defined('IN_MOBILE')) {
|
||||
$perpage = 10;
|
||||
} else {
|
||||
$perpage = 50;
|
||||
}
|
||||
$perpage = mob_perpage($perpage);
|
||||
$count = uc_pm_view_num($_G['uid'], $plid, 1);
|
||||
if(!$daterange) {
|
||||
if(!$page) {
|
||||
$page = ceil($count/$perpage);
|
||||
}
|
||||
$list = uc_pm_view($_G['uid'], 0, $plid, 5, ceil($count/$perpage)-$page+1, $perpage, $type, 1);
|
||||
$multi = pmmulti($count, $perpage, $page, "home.php?mod=space&do=pm&subop=view&plid=$plid&type=$type");
|
||||
} else {
|
||||
$list = uc_pm_view($_G['uid'], 0, $plid, 5, ceil($count/$perpage)-$page+1, $perpage, $type, 1);
|
||||
$chatpmmember = uc_pm_chatpmmemberlist($_G['uid'], $plid);
|
||||
if(!empty($chatpmmember)) {
|
||||
$authorid = $founderuid = $chatpmmember['author'];
|
||||
$chatpmmemberlist = C::t('common_member')->fetch_all($chatpmmember['member']);
|
||||
foreach(C::t('common_member_field_home')->fetch_all($chatpmmember['member']) as $uid => $member) {
|
||||
$chatpmmemberlist[$uid] = array_merge($member, $chatpmmemberlist[$uid]);
|
||||
}
|
||||
foreach(C::app()->session->fetch_all_by_uid($chatpmmember['member']) as $value) {
|
||||
if(!$value['invisible']) {
|
||||
$ols[$value['uid']] = $value['lastactivity'];
|
||||
}
|
||||
}
|
||||
}
|
||||
$membernum = count($chatpmmemberlist);
|
||||
$subject = $list[0]['subject'];
|
||||
$refreshtime = $_G['setting']['chatpmrefreshtime'];
|
||||
|
||||
}
|
||||
}
|
||||
$founderuid = empty($list)?0:$list[0]['founderuid'];
|
||||
$pmid = empty($list)?0:$list[0]['pmid'];
|
||||
}
|
||||
$actives['privatepm'] = ' class="a"';
|
||||
|
||||
} elseif($_GET['subop'] == 'viewg') {
|
||||
|
||||
$grouppm = C::t('common_grouppm')->fetch($_GET['pmid']);
|
||||
if(!$grouppm) {
|
||||
$grouppm = array_merge((array)C::t('common_member_grouppm')->fetch_gpm($_G['uid'], $_GET['pmid']), $grouppm);
|
||||
}
|
||||
if($grouppm) {
|
||||
$grouppm['numbers'] = $grouppm['numbers'] - 1;
|
||||
}
|
||||
if(!$grouppm['status']) {
|
||||
C::t('common_member_grouppm')->update($_G['uid'], $_GET['pmid'], array('status' => 1, 'dateline' => TIMESTAMP));
|
||||
}
|
||||
$actives['announcepm'] = ' class="a"';
|
||||
|
||||
} elseif($_GET['subop'] == 'ignore') {
|
||||
|
||||
$ignorelist = uc_pm_blackls_get($_G['uid']);
|
||||
$actives = array('ignore'=>' class="a"');
|
||||
|
||||
} elseif($_GET['subop'] == 'setting') {
|
||||
|
||||
$actives = array('setting'=>' class="a"');
|
||||
$acceptfriendpmstatus = $_G['member']['onlyacceptfriendpm'] ? $_G['member']['onlyacceptfriendpm'] : ($_G['setting']['onlyacceptfriendpm'] ? 1 : 2);
|
||||
$ignorelist = uc_pm_blackls_get($_G['uid']);
|
||||
|
||||
} else {
|
||||
|
||||
$filter = in_array($_GET['filter'], array('newpm', 'privatepm', 'announcepm')) ? $_GET['filter'] : 'privatepm';
|
||||
|
||||
$perpage = 15;
|
||||
$perpage = mob_perpage($perpage);
|
||||
|
||||
$page = empty($_GET['page'])?0:intval($_GET['page']);
|
||||
if($page<1) $page = 1;
|
||||
|
||||
$grouppms = $gpmids = $gpmstatus = array();
|
||||
$newpm = $newpmcount = 0;
|
||||
|
||||
if($filter == 'privatepm' && $page == 1 || $filter == 'announcepm' || $filter == 'newpm') {
|
||||
$announcepm = 0;
|
||||
foreach(C::t('common_member_grouppm')->fetch_all_by_uid($_G['uid'], $filter == 'announcepm' ? 1 : 0) as $gpmid => $gpuser) {
|
||||
$gpmstatus[$gpmid] = $gpuser['status'];
|
||||
if($gpuser['status'] == 0) {
|
||||
$announcepm ++;
|
||||
}
|
||||
}
|
||||
$gpmids = array_keys($gpmstatus);
|
||||
if($gpmids) {
|
||||
foreach(C::t('common_grouppm')->fetch_all_by_id_authorid($gpmids) as $grouppm) {
|
||||
$grouppm['message'] = cutstr(strip_tags($grouppm['message']), 100, '');
|
||||
$grouppms[] = $grouppm;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($filter == 'privatepm' || $filter == 'newpm') {
|
||||
$result = uc_pm_list($_G['uid'], $page, $perpage, 'inbox', $filter, 200);
|
||||
$count = $result['count'];
|
||||
$list = $result['data'];
|
||||
}
|
||||
|
||||
if($filter == 'privatepm' && $page == 1 || $filter == 'newpm') {
|
||||
$newpmarr = uc_pm_checknew($_G['uid'], 1);
|
||||
$newpm = $newpmarr['newpm'];
|
||||
}
|
||||
$newpmcount = $newpm + $announcepm;
|
||||
if($_G['member']['newpm']) {
|
||||
C::t('common_member')->update($_G['uid'], array('newpm' => 0));
|
||||
uc_pm_ignore($_G['uid']);
|
||||
}
|
||||
$multi = multi($count, $perpage, $page, "home.php?mod=space&do=pm&filter=$filter", 0, 5);
|
||||
$actives = array($filter=>' class="a"');
|
||||
}
|
||||
|
||||
if(!empty($list)) {
|
||||
$today = $_G['timestamp'] - ($_G['timestamp'] + $_G['setting']['timeoffset'] * 3600) % 86400;
|
||||
foreach ($list as $key => $value) {
|
||||
$value['lastsummary'] = str_replace('&', '&', $value['lastsummary']);
|
||||
$value['lastsummary'] = preg_replace("/&[a-z]+\;/i", '', $value['lastsummary']);
|
||||
$value['daterange'] = 5;
|
||||
if($value['lastdateline'] >= $today) {
|
||||
$value['daterange'] = 1;
|
||||
} elseif($value['lastdateline'] >= $today - 86400) {
|
||||
$value['daterange'] = 2;
|
||||
} elseif($value['lastdateline'] >= $today - 172800) {
|
||||
$value['daterange'] = 3;
|
||||
} elseif($value['lastdateline'] >= $today - 604800) {
|
||||
$value['daterange'] = 4;
|
||||
}
|
||||
$list[$key] = $value;
|
||||
}
|
||||
}
|
||||
include_once template("diy:home/space_pm");
|
||||
|
||||
function pmmulti($count, $perpage, $curpage, $mpurl) {
|
||||
$return = '';
|
||||
$lang['next'] = lang('core', 'nextpage');
|
||||
$lang['prev'] = lang('core', 'prevpage');
|
||||
$next = $curpage < ceil($count/$perpage) ? '<a href="'.$mpurl.'&page='.($curpage + 1).'#last" class="nxt">'.$lang['next'].'</a>' : '';
|
||||
$prev = $curpage > 1 ? '<span class="pgb"><a href="'.$mpurl.'&page='.($curpage - 1).'#last">'.$lang['prev'].'</a></span>' : '';
|
||||
if($next || $prev) {
|
||||
$return = '<div class="pg">'.$prev.$next.'</div>';
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
?>
|
146
source/include/space/space_poll.php
Normal file
146
source/include/space/space_poll.php
Normal file
@@ -0,0 +1,146 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: space_poll.php 28220 2012-02-24 07:52:50Z zhengqingpeng $
|
||||
*/
|
||||
|
||||
if(!defined('IN_DISCUZ')) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
|
||||
if (!$_G['setting']['forumstatus']) {
|
||||
showmessage('forum_status_off');
|
||||
}
|
||||
|
||||
$minhot = $_G['setting']['feedhotmin']<1?3:$_G['setting']['feedhotmin'];
|
||||
$page = empty($_GET['page'])?1:intval($_GET['page']);
|
||||
if($page<1) $page=1;
|
||||
$id = empty($_GET['id'])?0:intval($_GET['id']);
|
||||
$_GET['order'] = in_array($_GET['order'], array('hot', 'dateline')) ? $_GET['order'] : 'dateline';
|
||||
$opactives['poll'] = 'class="a"';
|
||||
|
||||
$_GET['view'] = in_array($_GET['view'], array('we', 'me', 'all')) ? $_GET['view'] : 'we';
|
||||
|
||||
$perpage = 20;
|
||||
$perpage = mob_perpage($perpage);
|
||||
$start = ($page-1)*$perpage;
|
||||
ckstart($start, $perpage);
|
||||
|
||||
$list = array();
|
||||
$userlist = array();
|
||||
$count = $pricount = 0;
|
||||
|
||||
$gets = array(
|
||||
'mod' => 'space',
|
||||
'uid' => $space['uid'],
|
||||
'do' => 'poll',
|
||||
'view' => $_GET['view'],
|
||||
'order' => $_GET['order'],
|
||||
'fuid' => $_GET['fuid'],
|
||||
'filter' => $_GET['filter'],
|
||||
'searchkey' => $_GET['searchkey']
|
||||
);
|
||||
$theurl = 'home.php?'.url_implode($gets);
|
||||
$multi = '';
|
||||
|
||||
$f_index = '';
|
||||
$ordersql = 't.dateline DESC';
|
||||
$need_count = true;
|
||||
$join = $authorid = $replies = 0;
|
||||
$displayorder = null;
|
||||
$subject = '';
|
||||
|
||||
if($_GET['view'] == 'me') {
|
||||
|
||||
$filter = in_array($_GET['filter'], array('publish', 'join')) ? $_GET['filter'] : 'publish';
|
||||
if($filter == 'join') {
|
||||
$join = true;
|
||||
$authorid = $space['uid'];
|
||||
} else {
|
||||
$authorid = $space['uid'];
|
||||
}
|
||||
$filteractives = array($filter => ' class="a"');
|
||||
|
||||
} else {
|
||||
|
||||
space_merge($space, 'field_home');
|
||||
|
||||
if($space['feedfriend']) {
|
||||
|
||||
$fuid_actives = array();
|
||||
|
||||
require_once libfile('function/friend');
|
||||
$fuid = intval($_GET['fuid']);
|
||||
if($fuid && friend_check($fuid, $space['uid'])) {
|
||||
$authorid = $fuid;
|
||||
$fuid_actives = array($fuid=>' selected');
|
||||
} else {
|
||||
$authorid = explode(',', $space['feedfriend']);
|
||||
$theurl = "home.php?mod=space&uid={$space['uid']}&do=$do&view=we";
|
||||
}
|
||||
|
||||
$query = C::t('home_friend')->fetch_all_by_uid($space['uid'], 0, 100, true);
|
||||
foreach($query as $value) {
|
||||
$userlist[] = $value;
|
||||
}
|
||||
} else {
|
||||
$need_count = false;
|
||||
}
|
||||
}
|
||||
|
||||
$actives = array($_GET['view'] =>' class="a"');
|
||||
|
||||
if($need_count) {
|
||||
|
||||
|
||||
if($_GET['view'] != 'me') {
|
||||
$displayorder = 0;
|
||||
}
|
||||
if($searchkey = stripsearchkey($_GET['searchkey'])) {
|
||||
$subject = $searchkey;
|
||||
$searchkey = dhtmlspecialchars($searchkey);
|
||||
}
|
||||
|
||||
$count = C::t('forum_thread')->count_by_special(1, $authorid, $replies, $displayorder, $subject, $join);
|
||||
if($count) {
|
||||
|
||||
loadcache('forums');
|
||||
$tids = array();
|
||||
require_once libfile('function/misc');
|
||||
foreach(C::t('forum_thread')->fetch_all_by_special(1, $authorid, $replies, $displayorder, $subject, $join, $start, $perpage) as $value) {
|
||||
if(empty($value['author']) && $value['authorid'] != $_G['uid']) {
|
||||
$hiddennum++;
|
||||
continue;
|
||||
}
|
||||
$tids[$value['tid']] = $value['tid'];
|
||||
$list[$value['tid']] = procthread($value);
|
||||
}
|
||||
if($tids) {
|
||||
$query = C::t('forum_poll')->fetch_all($tids);
|
||||
foreach($query as $value) {
|
||||
$value['pollpreview'] = explode("\t", trim($value['pollpreview']));
|
||||
$list[$value['tid']]['poll'] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
$multi = multi($count, $perpage, $page, $theurl);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
if($_G['uid']) {
|
||||
$_GET['view'] = !$_GET['view'] ? 'we' : $_GET['view'];
|
||||
$navtitle = lang('core', 'title_'.$_GET['view'].'_poll');
|
||||
} else {
|
||||
$_GET['order'] = !$_GET['order'] ? 'dateline' : $_GET['order'];
|
||||
$navtitle = lang('core', 'title_'.$_GET['order'].'_poll');
|
||||
}
|
||||
|
||||
$actives = array($_GET['view'] => ' class="a"');
|
||||
include_once template("diy:home/space_poll");
|
||||
|
||||
?>
|
198
source/include/space/space_profile.php
Normal file
198
source/include/space/space_profile.php
Normal file
@@ -0,0 +1,198 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: space_profile.php 29279 2012-03-31 09:06:19Z monkey $
|
||||
*/
|
||||
|
||||
if(!defined('IN_DISCUZ')) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
if(!$_G['uid'] && getglobal('setting/privacy/view/profile')) {
|
||||
showmessage('home_no_privilege', '', array(), array('login' => true));
|
||||
}
|
||||
|
||||
require_once libfile('function/spacecp');
|
||||
|
||||
$inarchive = isset($space['_inarchive']) && $space['_inarchive'];
|
||||
space_merge($space, 'count', $inarchive);
|
||||
space_merge($space, 'field_home', $inarchive);
|
||||
space_merge($space, 'field_forum', $inarchive);
|
||||
space_merge($space, 'profile', $inarchive);
|
||||
space_merge($space, 'status', $inarchive);
|
||||
getonlinemember(array($space['uid']));
|
||||
|
||||
if($_G['uid'] != $space['uid'] && !$_G['group']['allowviewprofile']) {
|
||||
if(!$_G['uid']) {
|
||||
showmessage('home_no_privilege', '', array(), array('login' => true));
|
||||
} else {
|
||||
showmessage('no_privilege_profile');
|
||||
}
|
||||
}
|
||||
|
||||
$space['admingroup'] = $_G['cache']['usergroups'][$space['adminid']];
|
||||
$space['admingroup']['icon'] = g_icon($space['adminid'], 1);
|
||||
|
||||
$space['group'] = $_G['cache']['usergroups'][$space['groupid']];
|
||||
$space['group']['icon'] = g_icon($space['groupid'], 1);
|
||||
$encodeusername = rawurlencode($space['username']);
|
||||
|
||||
if($space['extgroupids']) {
|
||||
$newgroup = array();
|
||||
$e_ids = explode("\t", $space['extgroupids']);
|
||||
foreach ($e_ids as $e_id) {
|
||||
$newgroup[] = $_G['cache']['usergroups'][$e_id]['grouptitle'];
|
||||
}
|
||||
$space['extgroupids'] = implode(',', $newgroup);
|
||||
}
|
||||
|
||||
$space['regdate'] = dgmdate($space['regdate']);
|
||||
if($space['lastvisit']) $space['lastvisit'] = dgmdate($space['lastvisit']);
|
||||
if($space['lastactivity']) {
|
||||
$space['lastactivitydb'] = $space['lastactivity'];
|
||||
$space['lastactivity'] = dgmdate($space['lastactivity']);
|
||||
}
|
||||
if($space['lastpost']) $space['lastpost'] = dgmdate($space['lastpost']);
|
||||
if($space['lastsendmail']) $space['lastsendmail'] = dgmdate($space['lastsendmail']);
|
||||
|
||||
|
||||
if($_G['uid'] == $space['uid'] || getglobal('group/allowviewip')) {
|
||||
$space['regip_loc'] = ip::convert($space['regip']);
|
||||
$space['lastip_loc'] = ip::convert($space['lastip']);
|
||||
$space['regip'] = ip::to_display($space['regip']);
|
||||
$space['lastip'] = ip::to_display($space['lastip']);
|
||||
}
|
||||
|
||||
$space['buyerrank'] = 0;
|
||||
if($space['buyercredit']){
|
||||
foreach($_G['setting']['ec_credit']['rank'] AS $level => $credit) {
|
||||
if($space['buyercredit'] <= $credit) {
|
||||
$space['buyerrank'] = $level;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$space['sellerrank'] = 0;
|
||||
if($space['sellercredit']){
|
||||
foreach($_G['setting']['ec_credit']['rank'] AS $level => $credit) {
|
||||
if($space['sellercredit'] <= $credit) {
|
||||
$space['sellerrank'] = $level;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$space['attachsize'] = formatsize($space['attachsize']);
|
||||
|
||||
$space['timeoffset'] = empty($space['timeoffset']) ? '9999' : $space['timeoffset'];
|
||||
if(strtotime($space['regdate']) + $space['oltime'] * 3600 > TIMESTAMP) {
|
||||
$space['oltime'] = 0;
|
||||
}
|
||||
require_once libfile('function/friend');
|
||||
$isfriend = friend_check($space['uid'], 1);
|
||||
if(!$_G['adminid']){
|
||||
if(getglobal('setting/privacy/view/profile') == 1 && !$isfriend && !$space['self']) {
|
||||
showmessage('specified_user_is_not_your_friend', '', array(), array());
|
||||
}
|
||||
if(getglobal('setting/privacy/view/profile') == 2 && !$space['self']) {
|
||||
showmessage('is_blacklist', '', array(), array());
|
||||
}
|
||||
}
|
||||
loadcache('profilesetting');
|
||||
include_once libfile('function/profile');
|
||||
$profiles = array();
|
||||
$privacy = $space['privacy']['profile'] ? $space['privacy']['profile'] : array();
|
||||
|
||||
if($_G['setting']['verify']['enabled']) {
|
||||
space_merge($space, 'verify');
|
||||
}
|
||||
foreach($_G['cache']['profilesetting'] as $fieldid => $field) {
|
||||
if($_G['setting']['nsprofiles']) {
|
||||
break;
|
||||
}
|
||||
if(!$field['available'] || in_array($fieldid, array('birthcountry', 'birthprovince', 'birthdist', 'birthcommunity', 'residecountry', 'resideprovince', 'residedist', 'residecommunity'))) {
|
||||
continue;
|
||||
}
|
||||
if(
|
||||
$field['available'] && (strlen($space[$fieldid]) > 0 || ($fieldid == 'birthcity' && strlen($space['birthcountry']) && strlen($space['birthprovince']) || $fieldid == 'residecity' && strlen($space['residecountry']) && strlen($space['resideprovince']))) &&
|
||||
($space['self'] || empty($privacy[$fieldid]) || ($isfriend && $privacy[$fieldid] == 1)) &&
|
||||
(!$_G['inajax'] && !$field['invisible'] || $_G['inajax'] && $field['showincard'])
|
||||
) {
|
||||
$val = profile_show($fieldid, $space);
|
||||
if($val !== false) {
|
||||
if($fieldid == 'realname' && $_G['uid'] != $space['uid'] && !ckrealname(1)) {
|
||||
continue;
|
||||
}
|
||||
if($field['formtype'] == 'file' && $val) {
|
||||
$imgurl = getglobal('setting/attachurl').'./profile/'.$val;
|
||||
$val = '<span><a href="'.$imgurl.'" target="_blank"><img src="'.$imgurl.'" style="max-width: 500px;" /></a></span>';
|
||||
}
|
||||
if($val == '') $val = '-';
|
||||
$profiles[$fieldid] = array('title'=>$field['title'], 'value'=>$val);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$count = C::t('forum_moderator')->count_by_uid($space['uid']);
|
||||
if($count) {
|
||||
foreach(C::t('forum_moderator')->fetch_all_by_uid($space['uid']) as $result) {
|
||||
$moderatefids[] = $result['fid'];
|
||||
}
|
||||
$query = C::t('forum_forum')->fetch_all_info_by_fids($moderatefids);
|
||||
foreach($query as $result) {
|
||||
$manage_forum[$result['fid']] = $result['name'];
|
||||
}
|
||||
}
|
||||
|
||||
if(!$_G['inajax'] && $_G['setting']['groupstatus']) {
|
||||
$groupcount = C::t('forum_groupuser')->fetch_all_group_for_user($space['uid'], 1);
|
||||
if($groupcount > 0) {
|
||||
$fids = C::t('forum_groupuser')->fetch_all_fid_by_uids($space['uid']);
|
||||
$usergrouplist = C::t('forum_forum')->fetch_all_info_by_fids($fids);
|
||||
}
|
||||
}
|
||||
|
||||
if($space['medals']) {
|
||||
loadcache('medals');
|
||||
foreach($space['medals'] = explode("\t", $space['medals']) as $key => $medalid) {
|
||||
list($medalid, $medalexpiration) = explode("|", $medalid);
|
||||
if(isset($_G['cache']['medals'][$medalid]) && (!$medalexpiration || $medalexpiration > TIMESTAMP)) {
|
||||
$space['medals'][$key] = $_G['cache']['medals'][$medalid];
|
||||
$space['medals'][$key]['medalid'] = $medalid;
|
||||
} else {
|
||||
unset($space['medals'][$key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
$upgradecredit = $space['uid'] && $space['group']['type'] == 'member' && $space['group']['creditslower'] != 9999999 ? $space['group']['creditslower'] - $space['credits'] : false;
|
||||
$allowupdatedoing = $space['uid'] == $_G['uid'] && checkperm('allowdoing');
|
||||
|
||||
dsetcookie('home_diymode', 1);
|
||||
|
||||
$navtitle = lang('space', 'sb_profile', array('who' => $space['username']));
|
||||
$metakeywords = lang('space', 'sb_profile', array('who' => $space['username']));
|
||||
$metadescription = lang('space', 'sb_profile', array('who' => $space['username']));
|
||||
|
||||
$clist = array();
|
||||
if(in_array($_G['adminid'], array(1, 2, 3))) {
|
||||
include_once libfile('function/member');
|
||||
$clist = crime('getactionlist', $space['uid']);
|
||||
}
|
||||
|
||||
show_view();
|
||||
|
||||
if(!getglobal('privacy')) {
|
||||
if(!$_G['inajax']) {
|
||||
include_once template("home/space_profile");
|
||||
} else {
|
||||
$_GET['do'] = 'card';
|
||||
if(helper_access::check_module('follow')) {
|
||||
$follow = C::t('home_follow')->fetch_by_uid_followuid($_G['uid'], $space['uid']);
|
||||
}
|
||||
include_once template("home/space_card");
|
||||
}
|
||||
}
|
||||
?>
|
140
source/include/space/space_reward.php
Normal file
140
source/include/space/space_reward.php
Normal file
@@ -0,0 +1,140 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: space_reward.php 33848 2013-08-21 06:24:53Z hypowang $
|
||||
*/
|
||||
|
||||
if(!defined('IN_DISCUZ')) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
|
||||
if (!$_G['setting']['forumstatus']) {
|
||||
showmessage('forum_status_off');
|
||||
}
|
||||
|
||||
$minhot = $_G['setting']['feedhotmin']<1?3:$_G['setting']['feedhotmin'];
|
||||
$page = empty($_GET['page'])?1:intval($_GET['page']);
|
||||
if($page<1) $page=1;
|
||||
$id = empty($_GET['id'])?0:intval($_GET['id']);
|
||||
$_GET['flag'] = empty($_GET['flag']) ? 0 : intval($_GET['flag']);
|
||||
$_GET['fuid'] = empty($_GET['fuid']) ? 0 : intval($_GET['fuid']);
|
||||
$opactives['reward'] = 'class="a"';
|
||||
|
||||
$_GET['view'] = in_array($_GET['view'], array('we', 'me', 'all')) ? $_GET['view'] : 'we';
|
||||
|
||||
$_GET['order'] = preg_replace("/[^\[A-Za-z0-9_\]]/", '', $_GET['order']);
|
||||
|
||||
$perpage = 20;
|
||||
$perpage = mob_perpage($perpage);
|
||||
$start = ($page-1)*$perpage;
|
||||
ckstart($start, $perpage);
|
||||
|
||||
$list = $userlist = array();
|
||||
$hiddennum = $count = $pricount = 0;
|
||||
|
||||
$gets = array(
|
||||
'mod' => 'space',
|
||||
'uid' => $space['uid'],
|
||||
'do' => 'reward',
|
||||
'view' => $_GET['view'],
|
||||
'order' => $_GET['order'],
|
||||
'flag' => $_GET['flag'],
|
||||
'type' => $_GET['type'],
|
||||
'fuid' => $_GET['fuid'],
|
||||
'searchkey' => $_GET['searchkey']
|
||||
);
|
||||
$theurl = 'home.php?'.url_implode($gets);
|
||||
$multi = '';
|
||||
|
||||
$conditions['special'] = 3;
|
||||
$conditions['specialthread'] = 1;
|
||||
|
||||
$f_index = '';
|
||||
$ordersql = 't.dateline DESC';
|
||||
$need_count = true;
|
||||
require_once libfile('function/misc');
|
||||
if($_GET['view'] == 'me') {
|
||||
$conditions = array('authorid' => $space['uid'], 'special' => 3, 'specialthread' => 1);
|
||||
} else {
|
||||
|
||||
space_merge($space, 'field_home');
|
||||
if($space['feedfriend']) {
|
||||
$fuid_actives = array();
|
||||
require_once libfile('function/friend');
|
||||
$fuid = intval($_GET['fuid']);
|
||||
if($fuid && friend_check($fuid, $space['uid'])) {
|
||||
$conditions = array('authorid' => $fuid, 'special' => 3, 'specialthread' => 1);
|
||||
$fuid_actives = array($fuid=>' selected');
|
||||
} else {
|
||||
$conditions['authorid'] = explode(',', $space['feedfriend']);
|
||||
}
|
||||
|
||||
$query = C::t('home_friend')->fetch_all_by_uid($space['uid'], 0, 100, true);
|
||||
foreach($query as $value) {
|
||||
$userlist[] = $value;
|
||||
}
|
||||
} else {
|
||||
$need_count = false;
|
||||
}
|
||||
}
|
||||
|
||||
$actives = array($_GET['view'] =>' class="a"');
|
||||
|
||||
if($need_count) {
|
||||
|
||||
if($_GET['view'] != 'me') {
|
||||
$conditions['sticky'] = 0;
|
||||
}
|
||||
if($searchkey = stripsearchkey($_GET['searchkey'])) {
|
||||
$conditions['keywords'] = $searchkey;
|
||||
$searchkey = dhtmlspecialchars($searchkey);
|
||||
}
|
||||
|
||||
if($_GET['flag'] < 0) {
|
||||
$wheresql .= " AND t.price < '0'";
|
||||
$conditions['pricesless'] = 0;
|
||||
$alltype .= '1';
|
||||
} elseif($_GET['flag'] > 0) {
|
||||
$wheresql .= " AND t.price > '0'";
|
||||
$conditions['pricemore'] = 0;
|
||||
$alltype .= '0';
|
||||
}
|
||||
|
||||
|
||||
$count = C::t('forum_thread')->count_search($conditions);
|
||||
if($count) {
|
||||
|
||||
foreach(C::t('forum_thread')->fetch_all_search($conditions, 0, $start, $perpage, 'dateline') as $value) {
|
||||
if(empty($value['author']) && $value['authorid'] != $_G['uid']) {
|
||||
$hiddennum++;
|
||||
continue;
|
||||
}
|
||||
$list[] = procthread($value);
|
||||
}
|
||||
$multi = multi($count, $perpage, $page, $theurl);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$creditid = 0;
|
||||
if($_G['setting']['creditstransextra'][2]) {
|
||||
$creditid = intval($_G['setting']['creditstransextra'][2]);
|
||||
} elseif ($_G['setting']['creditstrans']) {
|
||||
$creditid = intval($_G['setting']['creditstrans']);
|
||||
}
|
||||
|
||||
if($_G['uid']) {
|
||||
$_GET['view'] = !$_GET['view'] ? 'we' : $_GET['view'];
|
||||
$navtitle = lang('core', 'title_'.$_GET['view'].'_reward');
|
||||
} else {
|
||||
$_GET['order'] = !$_GET['order'] ? 'dateline' : $_GET['order'];
|
||||
$navtitle = lang('core', 'title_'.$_GET['order'].'_reward');
|
||||
}
|
||||
|
||||
include_once template("diy:home/space_reward");
|
||||
|
||||
?>
|
142
source/include/space/space_share.php
Normal file
142
source/include/space/space_share.php
Normal file
@@ -0,0 +1,142 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: space_share.php 28049 2012-02-21 09:30:06Z zhengqingpeng $
|
||||
*/
|
||||
|
||||
if(!defined('IN_DISCUZ')) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
|
||||
if (!$_G['setting']['sharestatus']) {
|
||||
showmessage('share_status_off');
|
||||
}
|
||||
|
||||
$page = empty($_GET['page'])?1:intval($_GET['page']);
|
||||
if($page<1) $page=1;
|
||||
$id = empty($_GET['id'])?0:intval($_GET['id']);
|
||||
$_GET['type'] = in_array($_GET['type'], array('all', 'link', 'video', 'music', 'flash', 'blog', 'album', 'pic', 'poll', 'space', 'thread', 'article'))? $_GET['type'] : 'all';
|
||||
$_GET['view'] = in_array($_GET['view'], array('we', 'me', 'all')) ? $_GET['view'] : 'we';
|
||||
if($id) {
|
||||
|
||||
if(!IS_ROBOT) {
|
||||
$share = C::t('home_share')->fetch_by_sid_uid($id, $space['uid']);
|
||||
if(empty($share)) {
|
||||
showmessage('share_does_not_exist');
|
||||
}
|
||||
|
||||
require_once libfile('function/share');
|
||||
$share = mkshare($share);
|
||||
|
||||
$perpage = 50;
|
||||
$start = ($page-1)*$perpage;
|
||||
|
||||
ckstart($start, $perpage);
|
||||
|
||||
$list = array();
|
||||
$cid = empty($_GET['cid'])?0:intval($_GET['cid']);
|
||||
$csql = $cid?"cid='$cid' AND":'';
|
||||
|
||||
$count = C::t('home_comment')->count_by_id_idtype($id, 'sid', $cid);
|
||||
|
||||
if($count) {
|
||||
$query = C::t('home_comment')->fetch_all_by_id_idtype($id, 'sid', $start, $perpage, $cid);
|
||||
foreach($query as $value) {
|
||||
$list[] = $value;
|
||||
}
|
||||
$multi = multi($count, $perpage, $page, "home.php?mod=space&uid={$share['uid']}&do=share&id=$id", '', 'comment_ul');
|
||||
}
|
||||
$diymode = intval($_G['cookie']['home_diymode']);
|
||||
}
|
||||
include_once template("diy:home/space_share_view");
|
||||
|
||||
} else {
|
||||
|
||||
$perpage = 20;
|
||||
|
||||
$start = ($page-1)*$perpage;
|
||||
ckstart($start, $perpage);
|
||||
|
||||
$gets = array(
|
||||
'mod' => 'space',
|
||||
'uid' => $space['uid'],
|
||||
'do' => 'share',
|
||||
'view' => $_GET['view'],
|
||||
'from' => $_GET['from']
|
||||
);
|
||||
$navtheurl = $theurl = 'home.php?'.url_implode($gets);
|
||||
$theurl .= '&type='.$_GET['type'];
|
||||
if(!IS_ROBOT) {
|
||||
$f_index = '';
|
||||
$need_count = true;
|
||||
|
||||
if(empty($_GET['view'])) $_GET['view'] = 'we';
|
||||
$uids = 0;
|
||||
$type = '';
|
||||
if($_GET['view'] == 'all') {
|
||||
$wheresql = "1";
|
||||
|
||||
} elseif($_GET['view'] == 'we') {
|
||||
|
||||
space_merge($space, 'field_home');
|
||||
|
||||
if($space['feedfriend']) {
|
||||
$uids = explode(',', $space['feedfriend']);
|
||||
$f_index = 'USE INDEX(dateline)';
|
||||
} else {
|
||||
$need_count = false;
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
if($_GET['from'] == 'space') $diymode = 1;
|
||||
|
||||
$uids = $space['uid'];
|
||||
|
||||
}
|
||||
$actives = array($_GET['view'] => ' class="a"');
|
||||
|
||||
if($_GET['type'] && $_GET['type'] != 'all') {
|
||||
$sub_actives = array('type_'.$_GET['type'] => ' class="a"');
|
||||
$type = $_GET['type'];
|
||||
} else {
|
||||
$sub_actives = array('type_all' => ' class="a"');
|
||||
}
|
||||
|
||||
$list = array();
|
||||
$pricount = 0;
|
||||
|
||||
$sid = empty($_GET['sid'])?0:intval($_GET['sid']);
|
||||
|
||||
if($need_count) {
|
||||
$count = C::t('home_share')->count_by_sid_uid_type($sid, $uids, $type);
|
||||
if($count) {
|
||||
require_once libfile('function/share');
|
||||
foreach(C::t('home_share')->fetch_all_by_sid_uid_type($sid, $uids, $type, $start, $perpage) as $value) {
|
||||
$value = mkshare($value);
|
||||
if($value['status'] == 0 || $value['uid'] == $_G['uid'] || $_G['adminid'] == 1) {
|
||||
$list[] = $value;
|
||||
} else {
|
||||
$pricount ++;
|
||||
}
|
||||
}
|
||||
$multi = multi($count, $perpage, $page, $theurl);
|
||||
}
|
||||
}
|
||||
}
|
||||
dsetcookie('home_diymode', $diymode);
|
||||
$navtitle = lang('core', 'title_share_'.$_GET['type']);
|
||||
$navtitle .= lang('core', 'title_share');
|
||||
if($space['username']) {
|
||||
$navtitle = lang('space', 'sb_sharing', array('who' => $space['username']));
|
||||
}
|
||||
$metakeywords = $navtitle;
|
||||
$metadescription = $navtitle;
|
||||
|
||||
include_once template("diy:home/space_share_list");
|
||||
}
|
||||
|
||||
?>
|
370
source/include/space/space_thread.php
Normal file
370
source/include/space/space_thread.php
Normal file
@@ -0,0 +1,370 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: space_thread.php 31365 2012-08-20 03:19:33Z zhengqingpeng $
|
||||
*/
|
||||
|
||||
if(!defined('IN_DISCUZ')) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
|
||||
if (!$_G['setting']['forumstatus']) {
|
||||
showmessage('forum_status_off');
|
||||
}
|
||||
|
||||
$minhot = $_G['setting']['feedhotmin']<1?3:$_G['setting']['feedhotmin'];
|
||||
$page = empty($_GET['page'])?1:intval($_GET['page']);
|
||||
if($page<1) $page=1;
|
||||
$id = empty($_GET['id'])?0:intval($_GET['id']);
|
||||
$opactives['thread'] = 'class="a"';
|
||||
|
||||
$_GET['view'] = in_array($_GET['view'], array('we', 'me', 'all')) ? $_GET['view'] : 'we';
|
||||
$_GET['order'] = in_array(getgpc('order'), array('hot', 'dateline')) ? $_GET['order'] : 'dateline';
|
||||
|
||||
$allowviewuserthread = $_G['setting']['allowviewuserthread'];
|
||||
|
||||
$perpage = 20;
|
||||
$start = ($page-1)*$perpage;
|
||||
ckstart($start, $perpage);
|
||||
|
||||
$list = array();
|
||||
$userlist = array();
|
||||
$hiddennum = $count = $pricount = 0;
|
||||
$_GET['from'] = dhtmlspecialchars(preg_replace("/[^\[A-Za-z0-9_\]]/", '', getgpc('from')));
|
||||
$gets = array(
|
||||
'mod' => 'space',
|
||||
'uid' => $space['uid'],
|
||||
'do' => 'thread',
|
||||
'fid' => getgpc('fid'),
|
||||
'view' => $_GET['view'],
|
||||
'type' => getgpc('type'),
|
||||
'order' => $_GET['order'],
|
||||
'fuid' => getgpc('fuid'),
|
||||
'searchkey' => getgpc('searchkey'),
|
||||
'from' => $_GET['from'],
|
||||
'filter' => getgpc('filter')
|
||||
);
|
||||
$theurl = 'home.php?'.url_implode($gets);
|
||||
unset($gets['fid']);
|
||||
$forumurl = 'home.php?'.url_implode($gets);
|
||||
$multi = '';
|
||||
$authorid = 0;
|
||||
$replies = $closed = $displayorder = null;
|
||||
$dglue = '=';
|
||||
$vfid = getgpc('fid') ? intval($_GET['fid']) : null;
|
||||
|
||||
require_once libfile('function/misc');
|
||||
require_once libfile('function/forum');
|
||||
loadcache(array('forums'));
|
||||
$fids = $comma = '';
|
||||
if($_GET['view'] != 'me') {
|
||||
$displayorder = 0;
|
||||
$dglue = '>=';
|
||||
}
|
||||
$f_index = '';
|
||||
$ordersql = 't.dateline DESC';
|
||||
$need_count = true;
|
||||
$viewuserthread = false;
|
||||
$listcount = 0;
|
||||
|
||||
if($_GET['view'] == 'me') {
|
||||
|
||||
if($_GET['from'] == 'space') $diymode = 1;
|
||||
$allowview = true;
|
||||
$viewtype = in_array(getgpc('type'), array('reply', 'thread', 'postcomment')) ? $_GET['type'] : 'thread';
|
||||
$filter = in_array(getgpc('filter'), array('recyclebin', 'ignored', 'save', 'aduit', 'close', 'common')) ? $_GET['filter'] : '';
|
||||
if($space['uid'] != $_G['uid'] && in_array($viewtype, array('reply', 'thread'))) {
|
||||
if($allowviewuserthread === -1 && $_G['adminid'] != 1) {
|
||||
$allowview = false;
|
||||
}
|
||||
if($allowview) {
|
||||
$viewuserthread = true;
|
||||
$viewfids = str_replace("'", '', $allowviewuserthread);
|
||||
if(!empty($viewfids)) {
|
||||
$viewfids = explode(',', $viewfids);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($viewtype == 'thread' && $allowview) {
|
||||
$authorid = $space['uid'];
|
||||
|
||||
|
||||
|
||||
|
||||
if($filter == 'recyclebin') {
|
||||
$displayorder = -1;
|
||||
} elseif($filter == 'aduit') {
|
||||
$displayorder = -2;
|
||||
} elseif($filter == 'ignored') {
|
||||
$displayorder = -3;
|
||||
} elseif($filter == 'save') {
|
||||
$displayorder = -4;
|
||||
} elseif($filter == 'close') {
|
||||
$closed = 1;
|
||||
} elseif($filter == 'common') {
|
||||
$closed = 0;
|
||||
$displayorder = 0;
|
||||
$dglue = '>=';
|
||||
}
|
||||
|
||||
$ordersql = 't.tid DESC';
|
||||
} elseif($viewtype == 'postcomment') {
|
||||
$posttable = getposttable();
|
||||
require_once libfile('function/post');
|
||||
$pids = $tids = array();
|
||||
$postcommentarr = C::t('forum_postcomment')->fetch_all_by_authorid($_G['uid'], $start, $perpage);
|
||||
foreach($postcommentarr as $value) {
|
||||
$pids[] = $value['pid'];
|
||||
$tids[] = $value['tid'];
|
||||
}
|
||||
$pids = C::t('forum_post')->fetch_all_post(0, $pids);
|
||||
$tids = C::t('forum_thread')->fetch_all($tids);
|
||||
|
||||
$list = $fids = array();
|
||||
foreach($postcommentarr as $value) {
|
||||
$value['authorid'] = $pids[$value['pid']]['authorid'];
|
||||
$value['fid'] = $pids[$value['pid']]['fid'];
|
||||
$value['invisible'] = $pids[$value['pid']]['invisible'];
|
||||
$value['dateline'] = $pids[$value['pid']]['dateline'];
|
||||
$value['message'] = $pids[$value['pid']]['message'];
|
||||
$value['special'] = $tids[$value['tid']]['special'];
|
||||
$value['status'] = $tids[$value['tid']]['status'];
|
||||
$value['subject'] = $tids[$value['tid']]['subject'];
|
||||
$value['digest'] = $tids[$value['tid']]['digest'];
|
||||
$value['attachment'] = $tids[$value['tid']]['attachment'];
|
||||
$value['replies'] = $tids[$value['tid']]['replies'];
|
||||
$value['views'] = $tids[$value['tid']]['views'];
|
||||
$value['lastposter'] = $tids[$value['tid']]['lastposter'];
|
||||
$value['lastpost'] = $tids[$value['tid']]['lastpost'];
|
||||
$value['tid'] = $pids[$value['pid']]['tid'];
|
||||
|
||||
$fids[] = $value['fid'];
|
||||
$value['comment'] = messagecutstr($value['comment'], 100);
|
||||
$list[] = procthread($value);
|
||||
}
|
||||
unset($pids, $tids, $postcommentarr);
|
||||
if($fids) {
|
||||
$fids = array_unique($fids);
|
||||
$query = C::t('forum_forum')->fetch_all($fids);
|
||||
foreach($query as $forum) {
|
||||
$forums[$forum['fid']] = $forum['name'];
|
||||
}
|
||||
}
|
||||
|
||||
$multi = simplepage(count($list), $perpage, $page, $theurl);
|
||||
$need_count = false;
|
||||
|
||||
} elseif($allowview) {
|
||||
$invisible = null;
|
||||
|
||||
$postsql = $threadsql = '';
|
||||
if($filter == 'recyclebin') {
|
||||
$invisible = -5;
|
||||
} elseif($filter == 'aduit') {
|
||||
$invisible = -2;
|
||||
} elseif($filter == 'save' || $filter == 'ignored') {
|
||||
$invisible = -3;
|
||||
$displayorder = -4;
|
||||
} elseif($filter == 'close') {
|
||||
$closed = 1;
|
||||
} elseif($filter == 'common') {
|
||||
$invisible = 0;
|
||||
$displayorder = 0;
|
||||
$dglue = '>=';
|
||||
$closed = 0;
|
||||
} else {
|
||||
if($space['uid'] != $_G['uid']) {
|
||||
$invisible = 0;
|
||||
}
|
||||
}
|
||||
require_once libfile('function/post');
|
||||
$posts = C::t('forum_post')->fetch_all_by_authorid(0, $space['uid'], true, 'DESC', $start, $perpage, 0, $invisible, $vfid);
|
||||
$listcount = count($posts);
|
||||
foreach($posts as $pid => $post) {
|
||||
$delrow = false;
|
||||
if($post['anonymous'] && $post['authorid'] != $_G['uid']) {
|
||||
$delrow = true;
|
||||
} elseif($viewuserthread && $post['authorid'] != $_G['uid']) {
|
||||
if(($_G['adminid'] != 1 && !empty($viewfids) && !in_array($post['fid'], $viewfids))) {
|
||||
$delrow = true;
|
||||
}
|
||||
}
|
||||
if($delrow) {
|
||||
unset($posts[$pid]);
|
||||
$hiddennum++;
|
||||
continue;
|
||||
} else {
|
||||
$tids[$post['tid']][] = $pid;
|
||||
$post['message'] = $post['status'] & 1 && $_G['adminid'] != 1 ? '' : (!getstatus($post['status'], 2) || $post['authorid'] == $_G['uid'] ? messagecutstr($post['message'], 100) : '');
|
||||
$posts[$pid] = $post;
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($tids)) {
|
||||
|
||||
$threads = C::t('forum_thread')->fetch_all_by_tid_displayorder(array_keys($tids), $displayorder, $dglue, array(), $closed);
|
||||
|
||||
foreach($threads as $tid => $thread) {
|
||||
$delrow = false;
|
||||
if($_G['adminid'] != 1 && $thread['displayorder'] < 0) {
|
||||
$delrow = true;
|
||||
} elseif($_G['adminid'] != 1 && $_G['uid'] != $thread['authorid'] && getstatus($thread['status'], 2)) {
|
||||
$delrow = true;
|
||||
} elseif(!isset($_G['cache']['forums'][$thread['fid']])) {
|
||||
if(!$_G['setting']['groupstatus']) {
|
||||
$delrow = true;
|
||||
} else {
|
||||
$gids[$thread['fid']] = $thread['tid'];
|
||||
}
|
||||
}
|
||||
if($delrow) {
|
||||
foreach($tids[$tid] as $pid) {
|
||||
unset($posts[$pid]);
|
||||
$hiddennum++;
|
||||
}
|
||||
unset($tids[$tid]);
|
||||
unset($threads[$tid]);
|
||||
continue;
|
||||
} else {
|
||||
$threads[$tid] = procthread($thread);
|
||||
$forums[$thread['fid']] = $threads[$tid]['forumname'];
|
||||
}
|
||||
|
||||
}
|
||||
if(!empty($gids)) {
|
||||
$groupforums = C::t('forum_forum')->fetch_all_name_by_fid(array_keys($gids));
|
||||
foreach($gids as $fid => $tid) {
|
||||
$threads[$tid]['forumname'] = $groupforums[$fid]['name'];
|
||||
$forums[$fid] = $groupforums[$fid]['name'];
|
||||
}
|
||||
}
|
||||
if(!empty($tids)) {
|
||||
foreach($tids as $tid => $pids) {
|
||||
foreach($pids as $pid) {
|
||||
if(!isset($threads[$tid])) {
|
||||
unset($posts[$pid]);
|
||||
unset($tids[$tid]);
|
||||
$hiddennum++;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$list = &$threads;
|
||||
}
|
||||
|
||||
|
||||
$multi = simplepage($listcount, $perpage, $page, $theurl);
|
||||
|
||||
$need_count = false;
|
||||
}
|
||||
if(!$allowview) {
|
||||
$need_count = false;
|
||||
}
|
||||
$orderactives = array($viewtype => ' class="a"');
|
||||
|
||||
} else {
|
||||
|
||||
if(!$_G['setting']['friendstatus']) {
|
||||
showmessage('friend_status_off');
|
||||
}
|
||||
|
||||
space_merge($space, 'field_home');
|
||||
|
||||
if($space['feedfriend']) {
|
||||
|
||||
$fuid_actives = array();
|
||||
|
||||
require_once libfile('function/friend');
|
||||
$fuid = intval($_GET['fuid']);
|
||||
if($fuid && friend_check($fuid, $space['uid'])) {
|
||||
$authorid = $fuid;
|
||||
$fuid_actives = array($fuid=>' selected');
|
||||
} else {
|
||||
$authorid = explode(',', $space['feedfriend']);
|
||||
}
|
||||
|
||||
$query = C::t('home_friend')->fetch_all_by_uid($_G['uid'], 0, 100, true);
|
||||
foreach($query as $value) {
|
||||
$userlist[] = $value;
|
||||
}
|
||||
} else {
|
||||
$need_count = false;
|
||||
}
|
||||
}
|
||||
|
||||
$actives = array($_GET['view'] =>' class="a"');
|
||||
|
||||
if($need_count) {
|
||||
|
||||
if($searchkey = stripsearchkey(getgpc('searchkey'))) {
|
||||
$searchkey = dhtmlspecialchars($searchkey);
|
||||
}
|
||||
|
||||
|
||||
loadcache('forums');
|
||||
$gids = $fids = $forums = array();
|
||||
|
||||
foreach(C::t('forum_thread')->fetch_all_by_authorid_displayorder($authorid, $displayorder, $dglue, $closed, $searchkey, $start, $perpage, $replies, $vfid) as $tid => $value) {
|
||||
if(empty($value['author']) && $value['authorid'] != $_G['uid']) {
|
||||
$hiddennum++;
|
||||
continue;
|
||||
} elseif($viewuserthread && $value['authorid'] != $_G['uid']) {
|
||||
if(($_G['adminid'] != 1 && !empty($viewfids) && !in_array($value['fid'], $viewfids)) || $value['displayorder'] < 0) {
|
||||
$hiddennum++;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if(!isset($_G['cache']['forums'][$value['fid']])) {
|
||||
if(!$_G['setting']['groupstatus']) {
|
||||
$hiddennum++;
|
||||
continue;
|
||||
} else {
|
||||
$gids[$value['fid']] = $value['tid'];
|
||||
}
|
||||
}
|
||||
$list[$value['tid']] = procthread($value);
|
||||
$forums[$value['fid']] = $list[$value['tid']]['forumname'];
|
||||
}
|
||||
|
||||
if(!empty($gids)) {
|
||||
$gforumnames = C::t('forum_forum')->fetch_all_name_by_fid(array_keys($gids));
|
||||
foreach($gids as $fid => $tid) {
|
||||
$list[$tid]['forumname'] = $gforumnames[$fid]['name'];
|
||||
$forums[$fid] = $gforumnames[$fid]['name'];
|
||||
}
|
||||
}
|
||||
|
||||
$threads = &$list;
|
||||
|
||||
|
||||
if($_GET['view'] != 'all') {
|
||||
$listcount = count($list)+$hiddennum;
|
||||
$multi = simplepage($listcount, $perpage, $page, $theurl);
|
||||
}
|
||||
}
|
||||
|
||||
require_once libfile('function/forumlist');
|
||||
$forumlist = forumselect(FALSE, 0, intval(getgpc('fid')));
|
||||
dsetcookie('home_diymode', $diymode);
|
||||
|
||||
if($_G['uid']) {
|
||||
$_GET['view'] = !$_GET['view'] ? 'we' : $_GET['view'];
|
||||
$navtitle = lang('core', 'title_'.$_GET['view'].'_thread');
|
||||
} else {
|
||||
$navtitle = lang('core', 'title_thread');
|
||||
}
|
||||
|
||||
if($space['username']) {
|
||||
$navtitle = lang('space', 'sb_thread', array('who' => $space['username']));
|
||||
}
|
||||
$metakeywords = $navtitle;
|
||||
$metadescription = $navtitle;
|
||||
if(!getglobal('follow')) {
|
||||
include_once template("diy:home/space_thread");
|
||||
}
|
||||
?>
|
258
source/include/space/space_trade.php
Normal file
258
source/include/space/space_trade.php
Normal file
@@ -0,0 +1,258 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: space_trade.php 28290 2012-02-27 07:15:44Z monkey $
|
||||
*/
|
||||
|
||||
if(!defined('IN_DISCUZ')) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
|
||||
if (!$_G['setting']['forumstatus']) {
|
||||
showmessage('forum_status_off');
|
||||
}
|
||||
|
||||
$minhot = $_G['setting']['feedhotmin']<1?3:$_G['setting']['feedhotmin'];
|
||||
$page = empty($_GET['page'])?1:intval($_GET['page']);
|
||||
if($page<1) $page=1;
|
||||
$id = empty($_GET['id'])?0:intval($_GET['id']);
|
||||
$opactives['trade'] = 'class="a"';
|
||||
|
||||
$_GET['view'] = in_array($_GET['view'], array('we', 'me', 'tradelog', 'eccredit', 'onlyuser')) ? $_GET['view'] : 'we';
|
||||
$_GET['order'] = in_array($_GET['order'], array('hot', 'dateline')) ? $_GET['order'] : 'dateline';
|
||||
|
||||
$perpage = 20;
|
||||
$perpage = mob_perpage($perpage);
|
||||
$start = ($page-1)*$perpage;
|
||||
ckstart($start, $perpage);
|
||||
|
||||
$list = array();
|
||||
$userlist = array();
|
||||
$count = 0;
|
||||
|
||||
$gets = array(
|
||||
'mod' => 'space',
|
||||
'uid' => $space['uid'],
|
||||
'do' => 'trade',
|
||||
'view' => $_GET['view'],
|
||||
'order' => $_GET['order'],
|
||||
'type' => $_GET['type'],
|
||||
'status' => $_GET['status'],
|
||||
'fuid' => $_GET['fuid'],
|
||||
'searchkey' => $_GET['searchkey']
|
||||
);
|
||||
$theurl = 'home.php?'.url_implode($gets);
|
||||
$multi = '';
|
||||
|
||||
$wheresql = '1';
|
||||
$apply_sql = '';
|
||||
|
||||
$f_index = '';
|
||||
$ordersql = 't.dateline DESC';
|
||||
$need_count = true;
|
||||
|
||||
if($_GET['view'] == 'me') {
|
||||
|
||||
$wheresql = "t.sellerid = '{$space['uid']}'";
|
||||
|
||||
} elseif($_GET['view'] == 'tradelog') {
|
||||
|
||||
$viewtype = in_array($_GET['type'], array('sell', 'buy')) ? $_GET['type'] : 'sell';
|
||||
$filter = $_GET['filter'] ? $_GET['filter'] : 'all';
|
||||
$sqlfield = $viewtype == 'sell' ? 'sellerid' : 'buyerid';
|
||||
$sqlfilter = '';
|
||||
$ratestatus = 0;
|
||||
$item = $viewtype == 'sell' ? 'selltrades' : 'buytrades';
|
||||
|
||||
switch($filter) {
|
||||
case 'attention':
|
||||
$typestatus = $item; break;
|
||||
case 'eccredit' :
|
||||
$typestatus = 'eccredittrades';
|
||||
$ratestatus = $item == 'selltrades' ? 1 : 2;
|
||||
break;
|
||||
case 'all':
|
||||
$typestatus = ''; break;
|
||||
case 'success':
|
||||
$typestatus = 'successtrades'; break;
|
||||
case 'closed' :
|
||||
$typestatus = 'closedtrades'; break;
|
||||
case 'refund' :
|
||||
$typestatus = 'refundtrades'; break;
|
||||
case 'unstart' :
|
||||
$typestatus = 'unstarttrades'; break;
|
||||
default:
|
||||
$typestatus = 'tradingtrades';
|
||||
break;
|
||||
}
|
||||
require_once libfile('function/trade');
|
||||
|
||||
$typestatus = $typestatus ? trade_typestatus($typestatus) : array();
|
||||
|
||||
$srchkey = stripsearchkey($_GET['searchkey']);
|
||||
|
||||
|
||||
$tid = intval($_GET['tid']);
|
||||
$pid = intval($_GET['pid']);
|
||||
$sqltid = $tid ? 'tl.tid=\''.$tid.'\' AND '.($pid ? 'tl.pid=\''.$pid.'\' AND ' : '') : '';
|
||||
$extra .= $srchfid ? '&filter='.$filter : '';
|
||||
$extratid = $tid ? "&tid=$tid".($pid ? "&pid=$pid" : '') : '';
|
||||
$num = C::t('forum_tradelog')->count_log($viewtype, $_G['uid'], $tid, $pid, $ratestatus, $typestatus);
|
||||
|
||||
$multi = multi($num, $perpage, $page, $theurl);
|
||||
$tradeloglist = array();
|
||||
foreach(C::t('forum_tradelog')->fetch_all_log($viewtype, $_G['uid'], $tid, $pid, $ratestatus, $typestatus, $start, $perpage) as $tradelog) {
|
||||
$tradelog['lastupdate'] = dgmdate($tradelog['lastupdate'], 'u', 1);
|
||||
$tradelog['attend'] = trade_typestatus($item, $tradelog['status']);
|
||||
$tradelog['status'] = trade_getstatus($tradelog['status']);
|
||||
$tradeloglist[] = $tradelog;
|
||||
}
|
||||
$creditid = 0;
|
||||
if($_G['setting']['creditstransextra'][5]) {
|
||||
$creditid = intval($_G['setting']['creditstransextra'][5]);
|
||||
} elseif ($_G['setting']['creditstrans']) {
|
||||
$creditid = intval($_G['setting']['creditstrans']);
|
||||
}
|
||||
$extcredits = $_G['setting']['extcredits'];
|
||||
$orderactives = array($viewtype => ' class="a"');
|
||||
$need_count = false;
|
||||
|
||||
} elseif($_GET['view'] == 'eccredit') {
|
||||
|
||||
require_once libfile('function/ec_credit');
|
||||
$uid = !empty($_GET['uid']) ? intval($_GET['uid']) : $_G['uid'];
|
||||
|
||||
loadcache('usergroups');
|
||||
|
||||
$member = getuserbyuid($uid);
|
||||
if(!$member) {
|
||||
showmessage('member_nonexistence', NULL, array(), array('login' => 1));
|
||||
}
|
||||
$member = array_merge($member, C::t('common_member_profile')->fetch($uid), C::t('common_member_status')->fetch($uid), C::t('common_member_field_forum')->fetch($uid));
|
||||
$member['avatar'] = '<div class="avatar">'.avatar($member['uid']);
|
||||
if($_G['cache']['usergroups'][$member['groupid']]['groupavatar']) {
|
||||
$member['avatar'] .= '<br /><img src="'.$_G['cache']['usergroups'][$member['groupid']]['groupavatar'].'" border="0" alt="" />';
|
||||
}
|
||||
$member['avatar'] .= '</div>';
|
||||
|
||||
$member['taobaoas'] = str_replace("'", '', addslashes($member['taobao']));
|
||||
$member['regdate'] = dgmdate($member['regdate'], 'd');
|
||||
$member['usernameenc'] = rawurlencode($member['username']);
|
||||
$member['buyerrank'] = 0;
|
||||
if($member['buyercredit']){
|
||||
foreach($_G['setting']['ec_credit']['rank'] AS $level => $credit) {
|
||||
if($member['buyercredit'] <= $credit) {
|
||||
$member['buyerrank'] = $level;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
$member['sellerrank'] = 0;
|
||||
if($member['sellercredit']){
|
||||
foreach($_G['setting']['ec_credit']['rank'] AS $level => $credit) {
|
||||
if($member['sellercredit'] <= $credit) {
|
||||
$member['sellerrank'] = $level;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$caches = array();
|
||||
foreach(C::t('forum_spacecache')->fetch_all_spacecache($uid, array('buyercredit', 'sellercredit')) as $cache) {
|
||||
$caches[$cache['variable']] = dunserialize($cache['value']);
|
||||
$caches[$cache['variable']]['expiration'] = $cache['expiration'];
|
||||
}
|
||||
|
||||
foreach(array('buyercredit', 'sellercredit') AS $type) {
|
||||
if(!isset($caches[$type]) || TIMESTAMP > $caches[$type]['expiration']) {
|
||||
$caches[$type] = updatecreditcache($uid, $type, 1);
|
||||
}
|
||||
}
|
||||
@$buyerpercent = $caches['buyercredit']['all']['total'] ? sprintf('%0.2f', $caches['buyercredit']['all']['good'] * 100 / $caches['buyercredit']['all']['total']) : 0;
|
||||
@$sellerpercent = $caches['sellercredit']['all']['total'] ? sprintf('%0.2f', $caches['sellercredit']['all']['good'] * 100 / $caches['sellercredit']['all']['total']) : 0;
|
||||
$need_count = false;
|
||||
|
||||
include template('home/space_eccredit');
|
||||
exit;
|
||||
|
||||
} elseif($_GET['view'] == 'onlyuser') {
|
||||
$uid = !empty($_GET['uid']) ? intval($_GET['uid']) : $_G['uid'];
|
||||
$wheresql = "t.sellerid = '$uid'";
|
||||
} else {
|
||||
|
||||
space_merge($space, 'field_home');
|
||||
|
||||
if($space['feedfriend']) {
|
||||
|
||||
$fuid_actives = array();
|
||||
|
||||
require_once libfile('function/friend');
|
||||
$fuid = intval($_GET['fuid']);
|
||||
if($fuid && friend_check($fuid, $space['uid'])) {
|
||||
$wheresql = 't.'.DB::field('sellerid', $fuid);
|
||||
$fuid_actives = array($fuid=>' selected');
|
||||
} else {
|
||||
$wheresql = 't.'.DB::field('sellerid', $space['feedfriend']);
|
||||
$theurl = "home.php?mod=space&uid={$space['uid']}&do=$do&view=we";
|
||||
}
|
||||
|
||||
$query = C::t('home_friend')->fetch_all_by_uid($space['uid'], 0, 100, true);
|
||||
foreach($query as $value) {
|
||||
$userlist[] = $value;
|
||||
}
|
||||
|
||||
} else {
|
||||
$need_count = false;
|
||||
}
|
||||
}
|
||||
|
||||
$actives = array($_GET['view'] =>' class="a"');
|
||||
|
||||
if($need_count) {
|
||||
if($searchkey = stripsearchkey($_GET['searchkey'])) {
|
||||
$wheresql .= ' AND t.'.DB::field('subject', '%'.$searchkey.'%', 'like');
|
||||
}
|
||||
$havecache = false;
|
||||
|
||||
$count = C::t('forum_trade')->fetch_all_for_space($wheresql, '', 1);
|
||||
if($count) {
|
||||
$query = C::t('forum_trade')->fetch_all_for_space($wheresql, $ordersql, 0, $start, $perpage);
|
||||
$pids = $aids = $thidden = array();
|
||||
foreach($query as $value) {
|
||||
$aids[$value['aid']] = $value['aid'];
|
||||
$value['dateline'] = dgmdate($value['dateline']);
|
||||
$pids[] = (float)$value['pid'];
|
||||
$list[$value['pid']] = $value;
|
||||
}
|
||||
|
||||
|
||||
$multi = multi($count, $perpage, $page, $theurl);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if($count) {
|
||||
$emptyli = array();
|
||||
if(count($list) % 5 != 0) {
|
||||
for($i = 0; $i < 5 - count($list) % 5; $i++) {
|
||||
$emptyli[] = $i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($_G['uid']) {
|
||||
$_GET['view'] = !$_GET['view'] ? 'we' : $_GET['view'];
|
||||
$navtitle = lang('core', 'title_'.$_GET['view'].'_trade');
|
||||
if($navtitle == 'title_'.$_GET['view'].'_trade') {
|
||||
$navtitle = lang('core', 'title_trade');
|
||||
}
|
||||
} else {
|
||||
$navtitle = lang('core', 'title_trade');
|
||||
}
|
||||
|
||||
include_once template("diy:home/space_trade");
|
||||
|
||||
?>
|
52
source/include/space/space_wall.php
Normal file
52
source/include/space/space_wall.php
Normal file
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: space_wall.php 29522 2012-04-17 09:39:32Z chenmengshu $
|
||||
*/
|
||||
|
||||
if(!defined('IN_DISCUZ')) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
|
||||
if (!$_G['setting']['wallstatus']) {
|
||||
showmessage('wall_status_off');
|
||||
}
|
||||
|
||||
$perpage = 20;
|
||||
$perpage = mob_perpage($perpage);
|
||||
|
||||
$page = empty($_GET['page'])?1:intval($_GET['page']);
|
||||
if($page<1) $page=1;
|
||||
$start = ($page-1)*$perpage;
|
||||
|
||||
ckstart($start, $perpage);
|
||||
|
||||
$theurl = "home.php?mod=space&uid={$space['uid']}&do=$do";
|
||||
|
||||
$diymode = 1;
|
||||
|
||||
$cid = empty($_GET['cid'])?0:intval($_GET['cid']);
|
||||
|
||||
$list = array();
|
||||
$count = C::t('home_comment')->count_by_id_idtype($space['uid'], 'uid', $cid);
|
||||
if($count) {
|
||||
$query = C::t('home_comment')->fetch_all_by_id_idtype($space['uid'], 'uid', $start, $perpage, $cid, 'DESC');
|
||||
foreach($query as $value) {
|
||||
$list[] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
$multi = multi($count, $perpage, $page, $theurl);
|
||||
|
||||
$navtitle = lang('space', 'sb_wall', array('who' => $space['username']));
|
||||
$metakeywords = lang('space', 'sb_wall', array('who' => $space['username']));
|
||||
$metadescription = lang('space', 'sb_wall', array('who' => $space['username']));
|
||||
|
||||
dsetcookie('home_diymode', 1);
|
||||
|
||||
include_once template("home/space_wall");
|
||||
|
||||
?>
|
Reference in New Issue
Block a user