misc_userstatus.php
1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
/**
 *      [Discuz!] (C)2001-2099 Comsenz Inc.
 *      This is NOT a freeware, use is subject to license terms
 *
 *      $Id: misc_userstatus.php 32720 2013-03-04 10:21:58Z zhangguosheng $
 */
if(!defined('IN_DISCUZ')) {
	exit('Access Denied');
}
$output = array();
$output['uid'] = $_G['uid'];
$tablename = '';
if($_GET['type'] === 'topic' && $typeid = intval($_GET['typeid'])) {
	$tablename = 'portal_topic';
	C::t('portal_topic')->increase($typeid, array('viewnum' => 1));
} elseif($_GET['type'] === 'article' && $typeid = intval($_GET['typeid'])) {
	C::t('portal_article_count')->increase($typeid, array('viewnum' => 1));
	$tablename = 'portal_article_count';
}
if($tablename) {
	$dynamicdata = C::t($tablename)->fetch($typeid);
	$output['viewnum'] = $dynamicdata['viewnum'];
	$output['commentnum'] = $dynamicdata['commentnum'];
}
if($output['uid']) {
	$_G['style']['tplfile'] = 'misc/userstatus';
	if(check_diy_perm($topic)){
		require template('common/header_diynav');
		echo $diynav;
	}
	$output['diynav'] = str_replace(array("\r", "\n"), '' ,ob_get_contents());
	ob_end_clean();
	$_G['gzipcompress'] ? ob_start('ob_gzhandler') : ob_start();
	require template('common/header_userstatus');
	$output['userstatus'] = str_replace(array("\r", "\n"), '' ,ob_get_contents());
	ob_end_clean();
	$_G['gzipcompress'] ? ob_start('ob_gzhandler') : ob_start();
	require template('common/header_qmenu');
	$output['qmenu'] = str_replace(array("\r", "\n"), '' ,ob_get_contents());
	ob_end_clean();
	$_G['gzipcompress'] ? ob_start('ob_gzhandler') : ob_start();
}
echo helper_json::encode($output);
?>