php include system core php total count Smiles smiles _GET intval _GET

 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
<?php
include '../../system/core.php';
$total = count(Smiles::$smiles);
$p = ($_GET['p']) ? intval($_GET['p']) : 1;
$pagination = new Pagination(10, $total, $p);
if(empty($p) or $p < 0) $p = 1;
if($p > $total) $p = $total;
$end = 10 * $p;
$start = $p * 10 - 10;
$i = 0;
$page = new Page('Смайлы / Помощь');
$page -> head();
?>
<div class="block yellow">
Чтобы вставить смайл нужно написать его псевдоним.
</div>
<?php foreach(Smiles::$smiles as $name => $img): ?>
<?php $i++; ?>
<?php if($i <= $start) continue; ?>
<div class="block b_top">
<img src="<?php echo Config::SITE_NAME_ADDR ?>/img/smiles/<?php echo $img ?>.gif" alt="smile" /> <?php echo $name ?>
</div>
<?php if($end <= $i) break; ?>
<?php endforeach ?>
<?php $pagination -> printPages('back=' . $_GET['back']) ?>
<?php
$page -> foot();
?>