<?php

if (!defined('IN_HANFOX')) exit('Access Denied');



$pagename = '文章资讯';

$pageurl = '?mod=author';

$tempfile = 'author.html';
$mode = 'author';
$table = $DB->table('users');



$pagesize = 60;

$curpage = intval($_GET['page']);

if ($curpage > 1) {

	$start = ($curpage - 1) * $pagesize;

} else {

	$start = 0;

	$curpage = 1;

}



$cache_id = $curpage;






if (!$smarty->isCached($tempfile, $cache_id)) {

	$smarty->assign('site_title', $pagename.' - '.$options['site_name']);

	$smarty->assign('site_keywords', $options['site_keywords']);

	$smarty->assign('site_description', $options['site_description']);

	$smarty->assign('site_path', get_sitepath('article'));

	$smarty->assign('site_rss', get_rssfeed('article'));

	

	$where = "user_status=3";

	if ($user_id > 0) {

		$user = get_one_user($user_id);

		if (!$user) {

			unset($user);

			redirect('./?mod=index');

		}

		

		$smarty->assign('site_title', $user['user_name'].' - '.$options['site_name']);

		$smarty->assign('site_keywords', !empty($user['user_keywords']) ? $user['user_keywords'] : $options['site_keywords']);

		$smarty->assign('site_description', !empty($user['user_description']) ? $user['user_description'] : $options['site_description']);

		$smarty->assign('site_path', get_sitepath($user['user_mod'], $user['user_id']));
$smarty->assign('site_cate', get_sitecate($user['user_mod'], $user['user_id']));
		$smarty->assign('site_rss', get_rssfeed($user['user_mod'], $user['user_id']));

	

		if ($user['user_childcount'] > 0) {

			$where .= " AND a.user_id IN (".$user['user_arrchildid'].")";

			$usergories = get_categories($user['user_id']);

		} else {

			$where .= " AND a.user_id=$user_id";

			$usergories = get_categories($user['root_id']);

		}

	} else {

		$usergories = get_categories();

	}

	

	$articles = get_article_list($where, 'ctime', 'DESC', $start, $pagesize);

	$total = $DB->get_count($table.' a', $where);

	$showpage = showpage($pageurl, $total, $curpage, $pagesize);

	$user_tags = get_format_tags($art['user_tags']);

	$smarty->assign('user_tags', $user_tags);

	$smarty->assign('pagename', $pagename);
	$smarty->assign('mode', $mode);

	$smarty->assign('user_id', $user['user_id']);

	$smarty->assign('user_name', isset($user['user_name']) ? $user['user_name'] : $pagename);

	$smarty->assign('categories', $usergories);

	$smarty->assign('total', $total);

	$smarty->assign('articles', $articles);

	$smarty->assign('showpage', $showpage);

	unset($usergories, $articles);

}



smarty_output($tempfile, $cache_id);

?>