View file wap-meet/news.php

File size: 904B
<?php
require_once('system/config.php');
require_once('system/functions.php');

echo head();
$all = mysql_result(mysql_query('SELECT COUNT(*) FROM news'), 0);

	if ( $all < 1 ) {
		echo '<div class="menu">Новостей нет.</div>';
	} else {
		$pages = ceil($all / $config['site']['onpage']);
		if ($p > $pages) $p = $pages;
		if ($p < 1) $p = 1;
		$start = ($p - 1) * $config['site']['onpage'];
		$q = mysql_query("SELECT * FROM `news` ORDER BY `nid` DESC LIMIT $start, " . intval($config['site']['onpage']) . " ");
		while( $news = mysql_fetch_assoc($q) ) {
			echo '<div class="menu">' . htmlentities($news['news']) . '<br />
			<br />
			<b>Добавлено:</b> ' . date('d.m.y в H:i', $news['time']) . '<br />
			<b>Разместил:</b> ' . htmlentities($news['author']) . '</div>';
		}
		echo navigation($p, $pages, $_SERVER['PHP_SELF'] . '?');
	}
echo foot();