示例#1
0
if ($page < 1) {
    $page = 1;
}
$content = $contents = array();
$multi = '';
$content = C::t('portal_article_content')->fetch_by_aid_page($aid, $page);
if ($article['contents'] && $article['showinnernav']) {
    foreach (C::t('portal_article_content')->fetch_all($aid) as $value) {
        $contents[] = $value;
    }
    if (empty($contents)) {
        C::t('portal_article_content')->update($aid, array('showinnernav' => '0'));
    }
}
require_once libfile('function/blog');
$content['content'] = blog_bbcode($content['content']);
if (!empty($_G['setting']['makehtml']['flag']) && $article['htmlmade']) {
    $_caturl = $_G['cache']['portalcategory'][$cat['topid']]['domain'] ? $_G['cache']['portalcategory'][$cat['topid']]['caturl'] : '';
    $viewurl = $_caturl . $article['htmldir'] . $article['htmlname'] . '{page}.' . $_G['setting']['makehtml']['extendname'];
    unset($_caturl);
} else {
    $viewurl = "portal.php?mod=view&aid={$aid}";
}
$multi = multi($article['contents'], 1, $page, $viewurl);
$org = array();
if ($article['idtype'] == 'tid' || $content['idtype'] == 'pid') {
    $thread = $firstpost = array();
    require_once libfile('function/discuzcode');
    require_once libfile('function/forum');
    $thread = get_thread_by_tid($article[id]);
    if (!empty($thread)) {
		if($count) {
			$query = $_SGLOBAL['db']->query("SELECT * FROM ".tname('comment')." WHERE $csql id='$eventid' AND idtype='eventid' ORDER BY dateline DESC LIMIT $start,$perpage");
			while ($value = $_SGLOBAL['db']->fetch_array($query)) {
				realname_set($value['authorid'], $value['author']);
				$comments[] = $value;
			}
		}

		//分页
		$multi = multi($count, $perpage, $page, $theurl, '', 'comment_ul');

	} else {
		// 查看活动综合
		// 处理活动介绍
		include_once(S_ROOT.'./source/function_blog.php');
		$event['detail'] = blog_bbcode($event['detail']);

		// 海报
		if($event['poster']){
			$event['pic'] = pic_get($event['poster'], $event['thumb'], $event['remote'], 0);
		} else {
			$event['pic'] = $_SGLOBAL['eventclass'][$event['classid']]['poster'];
		}

		// 活动组织者
		$relateduids = array();//查找参加此活动的成员也参加的活动用
		$admins = array();
		$query = $_SGLOBAL['db']->query("SELECT * FROM ".tname("userevent")." WHERE eventid = '$eventid' AND status IN ('3', '4') ORDER BY status DESC");
		while($value = $_SGLOBAL['db']->fetch_array($query)){
			realname_set($value['uid'], $value['username']);
			$admins[] = $value;
示例#3
0
}
$id = empty($_GET['id']) ? 0 : intval($_GET['id']);
$classid = empty($_GET['classid']) ? 0 : intval($_GET['classid']);
@(include_once S_ROOT . './data/data_click.php');
$clicks = empty($_SGLOBAL['click']['blogid']) ? array() : $_SGLOBAL['click']['blogid'];
if ($id) {
    //读取校园日历
    $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('unCheckArrangement') . " WHERE arrangementid='{$id}'" . " UNION " . "SELECT * FROM " . tname('arrangement') . " WHERE arrangementid='{$id}'");
    $arrangement = $_SGLOBAL['db']->fetch_array($query);
    //校园日历不存在
    if (empty($arrangement)) {
        showmessage('view_to_info_did_not_exist');
    }
    //处理视频标签
    include_once S_ROOT . './source/function_blog.php';
    $arrangement['message'] = blog_bbcode($arrangement['message']);
    $otherlist = $hotlist = array();
    //作者的其他最新校园日历
    $otherlist = array();
    $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('arrangement') . " WHERE uid='{$space['uid']}' ORDER BY starttime DESC LIMIT 0,6");
    while ($value = $_SGLOBAL['db']->fetch_array($query)) {
        if ($value['arrangementid'] != $arrangement['arrangementid']) {
            $otherlist[] = $value;
        }
    }
    //最新的校园日历
    $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('arrangement') . " ORDER BY replynum DESC LIMIT 0,6");
    while ($value = $_SGLOBAL['db']->fetch_array($query)) {
        if ($value['arrangementid'] != $arrangement['arrangementid']) {
            realname_set($value['uid']);
            $hotlist[] = $value;
示例#4
0
     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']) && $blog['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']) && $blog['status'] == 0) {
         $newlist[] = $value;
     }
 }
示例#5
0
 /**
  * 获取文章内容
  *
  * @param int|array $aid
  * @param int $page
  * @return array
  */
 public static function getNewsContent($aid, $page = 1)
 {
     global $_G;
     $article = $aid;
     !is_array($aid) && ($article = PortalUtils::getNewsInfo($aid));
     $content = C::t('portal_article_content')->fetch_by_aid_page($article['aid'], $page);
     if (empty($content)) {
         return $content;
     }
     $content['content'] = PortalUtils::preParseArticleContent($content['content']);
     require_once libfile('function/blog');
     $content['content'] = blog_bbcode($content['content']);
     if ($article['idtype'] == 'tid' || $content['idtype'] == 'pid') {
         $thread = $firstpost = array();
         require_once libfile('function/discuzcode');
         require_once libfile('function/forum');
         $thread = get_thread_by_tid($article['id']);
         if (!empty($thread)) {
             if ($content['idtype'] == 'pid') {
                 $firstpost = C::t('forum_post')->fetch($thread['posttableid'], $content['id']);
             } else {
                 $firstpost = C::t('forum_post')->fetch_threadpost_by_tid_invisible($article['id']);
             }
             if ($firstpost && $firstpost['tid'] == $article['id']) {
                 $firstpost['uid'] = $firstpost['authorid'];
                 $firstpost['username'] = $firstpost['author'];
             }
         }
         if (!empty($firstpost) && !empty($thread) && $thread['displayorder'] != -1) {
             $_G['tid'] = $article['id'];
             $aids = array();
             $firstpost['message'] = $content['content'];
             if ($thread['attachment']) {
                 $_G['group']['allowgetimage'] = 1;
                 if (preg_match_all("/\\[attach\\](\\d+)\\[\\/attach\\]/i", $firstpost['message'], $matchaids)) {
                     $aids = $matchaids[1];
                 }
             }
             if ($aids) {
                 parseforumattach($firstpost, $aids);
             }
             $content['content'] = $firstpost['message'];
             $content['pid'] = $firstpost['pid'];
         } else {
             C::t('portal_article_title')->update($aid, array('id' => 0, 'idtype' => ''));
             C::t('portal_article_content')->update_by_aid($aid, array('id' => 0, 'idtype' => ''));
         }
     } elseif ($article['idtype'] == 'blogid') {
         $content['content'] = '';
     }
     return PortalUtils::transArticleContent($content['content']);
 }
示例#6
0
 $pid = empty($_GET['pid']) ? 0 : intval($_GET['pid']);
 $psql = $pid ? "(isthread='1' OR pid='{$pid}') AND" : '';
 $list = array();
 $postnum = $start;
 $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('post') . " WHERE {$psql} tid='{$thread['tid']}' ORDER BY dateline LIMIT {$start},{$perpage}");
 while ($value = $_SGLOBAL['db']->fetch_array($query)) {
     realname_set($value['uid'], $value['username']);
     $value['num'] = $postnum;
     $list[] = $value;
     $postnum++;
 }
 //取得内容
 if ($list[0]['isthread']) {
     $thread['content'] = $list[0];
     include_once S_ROOT . './source/function_blog.php';
     $thread['content']['message'] = blog_bbcode($thread['content']['message']);
     unset($list[0]);
 } else {
     $thread['content'] = array();
 }
 //分页
 $multi = multi($count, $perpage, $page, "space.php?uid={$thread['uid']}&do={$do}&id={$id}");
 //访问统计
 if (!$space['self']) {
     $_SGLOBAL['db']->query("UPDATE " . tname('thread') . " SET viewnum=viewnum+1 WHERE tid='{$id}'");
     inserttable('log', array('id' => $space['uid'], 'idtype' => 'uid'));
     //延迟更新
 }
 //实名
 realname_get();
 include_once template("space_thread_view");