Example #1
0
function v_style($a)
{
    global $style;
    $style->assign_vars(_style_uv($a));
    return true;
}
Example #2
0
	public function object() {
		global $user, $config, $comments;

		$offset = request_var('ps', 0);

		if ($this->data['poster_id'] != $user->d('user_id') && !$offset) {
			$sql = 'UPDATE _news SET post_views = post_views + 1
				WHERE news_id = ?';
			sql_query(sql_filter($sql, $this->data['news_id']));
		}

		$news_main = array(
			'MESSAGE' => $comments->parse_message($this->data['post_text']),
			'POST_TIME' => $user->format_date($this->data['post_time'])
		);

		$sql = 'SELECT user_id, username, username_base, user_avatar, user_posts, user_gender, user_rank
			FROM _members
			WHERE user_id = ?';
		$result = sql_fieldrow(sql_filter($sql, $this->data['poster_id']));

		$user_profile = $comments->user_profile($result);
		$news_main = array_merge($news_main, _style_uv($user_profile));

		_style('mainpost', $news_main);

		$comments_ref = s_link('news', $this->data['news_alias']);

		if ($this->data['post_replies']) {
			$comments->reset();
			$comments->ref = $comments_ref;

			$sql = 'SELECT p.*, m.user_id, m.username, m.username_base, m.user_avatar, m.user_rank, m.user_posts, m.user_gender, m.user_sig
				FROM _news_posts p, _members m
				WHERE p.news_id = ?
					AND p.post_active = 1
					AND p.poster_id = m.user_id
				ORDER BY p.post_time DESC
				LIMIT ??, ??';

			$comments->data = array(
				'SQL' => sql_filter($sql, $this->data['news_id'], $offset, $config['posts_per_page'])
			);

			$comments->view($offset, 'ps', $this->data['post_replies'], $config['posts_per_page'], '', '', 'TOPIC_');
		}

		v_style(array(
			'CAT_URL' => s_link('news', $this->data['cat_url']),
			'CAT_NAME' => $this->data['cat_name'],
			'POST_SUBJECT' => $this->data['post_subject'],
			'POST_REPLIES' => number_format($this->data['post_replies']))
		);

		//
		// Posting box
		//
		if ($user->is('member')) {
			_style('publish', array(
				'REF' => $comments_ref)
			);
		}

		$this->_template = 'news.view';
		$this->_title = $this->data['post_subject'];

		return;
	}
Example #3
0
function v_style($a) {
	global $template;

	$template->assign_vars(_style_uv($a));
	return true;
}