View file smile.php

File size: 959B
<?php

require 'inc/func.php';
bk_head('Smiles');
require 'inc/head.php';
if(!$user) {
err('Bạn Chưa Đăng Nhập!');
}
echo '<div class="list1"><div class="tt">Smiles</div>';
$count_sm = mysql_result(mysql_query("SELECT COUNT(id) FROM smiles"), 0);

$display = 5;
$count_pages = ceil($count_sm/$display);
$page = (isset($_GET['page']) and is_numeric($_GET['page']) and $_GET['page']>1 and $_GET['page']<=$count_pages) ? $_GET['page'] : 1;
$start = $page*$display-$display;

$querys = mysql_query("SELECT * FROM smiles ORDER BY id DESC LIMIT $start, $display");
while ($smilesh = mysql_fetch_assoc($querys)){

echo '<div class="list1"><img src="/smiles/'.$smilesh['image'].'">&nbsp;<textarea>'.$smilesh['text'].'</textarea></div><div class="li"></div>';

}

if($count_sm > 3 && $page < $count_pages)
{
echo '<div class="pages">';
pages($page,$count_pages,'/smile/page');
echo '</div><br />';
}
echo '</div>';

bk_foot();
?>