Пример #1
0
    ckstart($start, $perpage);
    $list = array();
    $cid = empty($_GET['cid']) ? 0 : intval($_GET['cid']);
    $csql = $cid ? "cid='{$cid}' AND" : '';
    $count = $_SGLOBAL['db']->result($_SGLOBAL['db']->query("SELECT COUNT(*) FROM " . tname('comment') . " WHERE {$csql} id='{$id}' AND idtype='sid'"), 0);
    if ($count) {
        $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('comment') . " WHERE {$csql} id='{$id}' AND idtype='sid' ORDER BY dateline LIMIT {$start},{$perpage}");
        while ($value = $_SGLOBAL['db']->fetch_array($query)) {
            realname_set($value['authorid'], $value['author']);
            $list[] = $value;
        }
    }
    // pagination
    $multi = multi($count, $perpage, $page, "space.php?uid={$share['uid']}&do=share&id={$id}", '', 'comment_ul');
    //相关 hot value
    $topic = topic_get($share['topicid']);
    realname_get();
    $tpl_title = getstr($share['title_template'], 0, 0, 0, 0, 0, -1);
    include_once template("space_share_view");
} else {
    if (empty($_GET['view']) && $space['friendnum'] < $_SCONFIG['showallfriendnum']) {
        $_GET['view'] = 'all';
        //默认显示
    }
    $perpage = 20;
    //Check start number
    $start = ($page - 1) * $perpage;
    ckstart($start, $perpage);
    //处理查询
    $f_index = '';
    if ($_GET['view'] == 'all') {
Пример #2
0
		// 活动查看数加 1
		if($event['uid'] != $_SGLOBAL['supe_uid']){
			$_SGLOBAL['db']->query("UPDATE ".tname("event")." SET viewnum=viewnum+1 WHERE eventid='$eventid'");
			$event['viewnum'] += 1;
		}

		//活动开始倒计时
		if($event['starttime'] > $_SGLOBAL['timestamp']) {
			$countdown = intval((mktime(0,0,0,gmdate('m',$event['starttime']),gmdate('d',$event['starttime']),gmdate('Y',$event['starttime'])) -
						mktime(0,0,0,gmdate('m',$_SGLOBAL['timestamp']),gmdate('d',$_SGLOBAL['timestamp']),gmdate('Y',$_SGLOBAL['timestamp']))) / 86400);
		}
	}


	//相关热点
	$topic = topic_get($event['topicid']);

	realname_get();

	$menu = array($view => ' class="active"');

	$_TPL['css'] = 'event';
	include template("space_event_view");

} else {// 活动列表

	if(!in_array($view, array("friend","me","all","recommend","city"))){
		$view = "all";
	}
	if($view == "friend" && !$space['friendnum']) {
		$view = "me";
Пример #3
0
function topic_check($topicid, $type) {
	global $_SGLOBAL, $space;
	
	$topicid = intval($topicid);
	$newtopcid = $topicid;
	if($topic = topic_get($topicid)) {
		if($topic['joingid']) {
			if(!in_array($space['groupid'], $topic['joingid'])) $newtopcid = 0;
		}
		if($topic['jointype']) {
			if(!in_array($type, $topic['jointype'])) $newtopcid = 0;
		}
	} else {
		$newtopcid = 0;
	}
	return $newtopcid;
}
Пример #4
0
        while ($value = $_SGLOBAL['db']->fetch_array($query)) {
            $value['pic'] = pic_get($value['pic'], $value['thumb'], $value['remote']);
            $value['lastpost'] = sgmdate('m-d H:i', $value['lastpost']);
            $value['dateline'] = sgmdate('m-d H:i', $value['dateline']);
            $value['endtime'] = $value['endtime'] ? sgmdate('m-d H:i', $value['endtime']) : '';
            $value['message'] = getstr($value['message'], 200, 0, 0, 0, 0, -1);
            realname_set($value['uid'], $value['username']);
            $list[] = $value;
        }
        $multi = multi($count, $perpage, $page, 'space.php?do=topic');
    }
    realname_get();
    $_TPL['css'] = 'event';
    include_once template('space_topic_list');
} else {
    if (!($topic = topic_get($topicid))) {
        showmessage('topic_no_found');
    }
    if ($topic['uid'] == $_SGLOBAL['supe_uid']) {
        $managetopic = 1;
    }
    $page = intval($_GET['page']);
    if ($page < 1) {
        $page = 1;
    }
    realname_set($topic['uid'], $topic['username']);
    $bloglist = $piclist = $threadlist = $polllist = $eventlist = $sharelist = $spacelist = array();
    $perpages = array();
    $start = 0;
    if ($_GET['view'] && in_array($_GET['view'], $topic['jointype'])) {
        $perpages[$_GET['view']] = 30;
Пример #5
0
    if ($blog['friend'] == 4) {
        $passwordstyle = '';
    } elseif ($blog['friend'] == 2) {
        $selectgroupstyle = '';
        if ($blog['target_ids']) {
            $names = array();
            $query = $_SGLOBAL['db']->query("SELECT username FROM " . tname('space') . " WHERE uid IN ({$blog['target_ids']})");
            while ($value = $_SGLOBAL['db']->fetch_array($query)) {
                $names[] = $value['username'];
            }
            $blog['target_names'] = implode(' ', $names);
        }
    }
    $blog['message'] = str_replace('&amp;', '&amp;amp;', $blog['message']);
    $blog['message'] = shtmlspecialchars($blog['message']);
    $allowhtml = checkperm('allowhtml');
    //好友组
    $groups = getfriendgroup();
    //参与热点
    $topic = array();
    $topicid = $_GET['topicid'] = intval($_GET['topicid']);
    if ($topicid) {
        $topic = topic_get($topicid);
    }
    if ($topic) {
        $actives = array('blog' => ' class="active"');
    }
    //菜单激活
    $menuactives = array('space' => ' class="active"');
}
include_once template("cp_blog");
Пример #6
0
        if ($value['clicknum'] > $maxclicknum) {
            $maxclicknum = $value['clicknum'];
        }
        $clicks[$key] = $value;
    }
    //点评
    $clickuserlist = array();
    $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('clickuser') . "\n\t\tWHERE id='{$id}' AND idtype='{$idtype}'\n\t\tORDER BY dateline DESC\n\t\tLIMIT 0,18");
    while ($value = $_SGLOBAL['db']->fetch_array($query)) {
        realname_set($value['uid'], $value['username']);
        //实名
        $value['clickname'] = $clicks[$value['clickid']]['name'];
        $clickuserlist[] = $value;
    }
    //热点
    $topic = topic_get($bwzt['topicid']);
    //实名
    realname_get();
    $_TPL['css'] = 'bwzt';
    //include_once template("space_bwzt_view");
    $commenttip = array("commentsubmit" => true, "formhash" => formhash(), "id" => $bwzt[bwztid], "idtype" => "bwztid", "message" => "", "refer" => "");
    $bwzt["replylist"] = $list;
    $bwzt["comment"] = $commenttip;
    //增加发布者头像地址
    $bwzt['avatar_url'] = avatar($bwzt['uid'], 'middle', TRUE);
    $bwzt['message'] = strip_tags($bwzt['message']);
    //剥去字符串中的 HTML 标签
    capi_showmessage_by_data("do_success", 0, array('bwzt' => $bwzt));
} else {
    //分页
    $perpage = 10;
Пример #7
0
        if ($value['clicknum'] > $maxclicknum) {
            $maxclicknum = $value['clicknum'];
        }
        $clicks[$key] = $value;
    }
    //点评
    $clickuserlist = array();
    $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('clickuser') . "\r\n\t\tWHERE id='{$id}' AND idtype='{$idtype}'\r\n\t\tORDER BY dateline DESC\r\n\t\tLIMIT 0,18");
    while ($value = $_SGLOBAL['db']->fetch_array($query)) {
        realname_set($value['uid'], $value['username']);
        //实名
        $value['clickname'] = $clicks[$value['clickid']]['name'];
        $clickuserlist[] = $value;
    }
    //热点
    $topic = topic_get($blog['topicid']);
    //实名
    realname_get();
    //获取标签
    $ntags = getntags($blog['uid'], $_GET['do'], $id);
    $_TPL['css'] = 'blog';
    include_once template("space_blog_view");
} else {
    //分页
    $perpage = 10;
    $perpage = mob_perpage($perpage);
    $start = ($page - 1) * $perpage;
    //检查开始数
    ckstart($start, $perpage);
    //摘要截取
    $summarylen = 300;
Пример #8
0
        if ($value['clicknum'] > $maxclicknum) {
            $maxclicknum = $value['clicknum'];
        }
        $clicks[$key] = $value;
    }
    //点评
    $clickuserlist = array();
    $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('clickuser') . "\r\n\t\tWHERE id='{$id}' AND idtype='{$idtype}'\r\n\t\tORDER BY dateline DESC\r\n\t\tLIMIT 0,18");
    while ($value = $_SGLOBAL['db']->fetch_array($query)) {
        realname_set($value['uid'], $value['username']);
        //实名
        $value['clickname'] = $clicks[$value['clickid']]['name'];
        $clickuserlist[] = $value;
    }
    //热闹
    $topic = topic_get($pic['topicid']);
    if (empty($eventid)) {
        //实名
        realname_get();
        $ntags = getntags($pic['uid'], $_GET['do'], $picid);
        $_TPL['css'] = 'album';
        include_once template("space_album_pic");
    }
} else {
    //相册列表
    $perpage = 12;
    $perpage = mob_perpage($perpage);
    $start = ($page - 1) * $perpage;
    //检查开始数
    ckstart($start, $perpage);
    //权限过滤
Пример #9
0
    $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('poll') . " ORDER BY dateline DESC LIMIT 0, 10");
    while ($value = $_SGLOBAL['db']->fetch_array($query)) {
        realname_set($value['uid'], $value['username']);
        //实名
        $newpoll[] = $value;
    }
    //取出最热的投票
    $timerange = $_SGLOBAL['timestamp'] - 2592000;
    $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('poll') . " WHERE lastvote >= '{$timerange}' ORDER BY voternum DESC LIMIT 0, 10");
    while ($value = $_SGLOBAL['db']->fetch_array($query)) {
        realname_set($value['uid'], $value['username']);
        //实名
        $hotpoll[] = $value;
    }
    //相关热点
    $topic = topic_get($poll['topicid']);
    //实名
    realname_get();
    //获取标签
    $ntags = getntags($poll['uid'], $_GET['do'], $pid);
    $_TPL['css'] = 'poll';
    include_once template("space_poll_view");
} else {
    $_GET['view'] = $_GET['view'] ? trim($_GET['view']) : 'new';
    if ($_GET['view'] == 'all') {
        $_GET['view'] = 'new';
    }
    //分页
    $perpage = 10;
    $start = ($page - 1) * $perpage;
    //检查开始数
Пример #10
0
        if ($value['clicknum'] > $maxclicknum) {
            $maxclicknum = $value['clicknum'];
        }
        $clicks[$key] = $value;
    }
    //点评
    $clickuserlist = array();
    $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('clickuser') . "\n\t\tWHERE id='{$id}' AND idtype='{$idtype}'\n\t\tORDER BY dateline DESC\n\t\tLIMIT 0,18");
    while ($value = $_SGLOBAL['db']->fetch_array($query)) {
        realname_set($value['uid'], $value['username']);
        //实名
        $value['clickname'] = $clicks[$value['clickid']]['name'];
        $clickuserlist[] = $value;
    }
    //热闹
    $topic = topic_get($thread['topicid']);
    //实名
    realname_get();
    $_TPL['css'] = 'thread';
    include_once template("space_thread_view");
} else {
    $perpage = 30;
    $start = ($page - 1) * $perpage;
    //检查开始数
    ckstart($start, $perpage);
    if (!in_array($_GET['view'], array('hot', 'new', 'me', 'all'))) {
        $_GET['view'] = 'hot';
    }
    //话题列表
    $wheresql = $f_index = '';
    if ($_GET['view'] == 'hot') {