View file XCMS_ver_1_0/gbook/index.php

File size: 1.93Kb
<?php
#######################################################
#  [Автор скрипта: ]                                 #
#  [Роман Гринько aka Nominal]                        #
#  [ICQ:  405-623-516] [E-Mail: [email protected]]    #
#######################################################
// Модуль by Shell
@session_start();
$dir = '../';
include_once $dir.'system/func.php';
include_once $dir.'system/antimat.php'; 
include $dir.'system/head.php';
$String_AM = new anti_mate;

	$file=@file('base.dat');
	$all= count($file);
    $onpage = 8;
	$page=(isset($_GET['p'])) ? (int)$_GET['p'] : 1;
	$num_pages=ceil($all/$onpage);
	$start=$page*$onpage-$onpage;
	if ($page > $num_pages || $page < 1)
		{
    		$page=1;
    		$start=0;
		}
		echo'<div class="info"><a href="goo.php">Добавить</a><br/></div>';
	if ($all)
	{

		
   			for ($i=$all-$start-1; $i>=$all-$start-$onpage; $i--)
    			{
					if (!empty($file[$i]))
						{
						$mes=explode('::',$file[$i]);

$msg = $String_AM->filter($mes[2]);
						echo '<div class="navs"><b>['.date('H:i d/m',$mes[1]).']<a href="/pages/anketa.php?uz='.$mes[0].'"> '.$mes[0].'</b></a> <br />'.$msg.'<br/><span style="color: green; font-size:10px;">'.$mes[3].' | '.$mes[4].'</span><br/>';
						
						if(is_admin()) {
						
						//echo'<div class="info"><a href="goo.php"><small>Изменить</small></a> | <a href="goo.php"><small>Удалить</small></a></div>';
						}
						
						echo'</div>';
					}
				}
     	echo '<div class="login">';
    	for($pr = '', $i =1; $i <= $num_pages; $i++)
    		{
        		echo $pr=(($i == 1 || $i == $num_pages || abs($i-$page) < 2) ? ($i == $page ? " [<b>$i</b>] " : ' <a href="index.php?p='.$i.'">'.$i.'</a> ') : (($pr == ' ... ' || $pr == '')? '' : ' ... '));
    		}

		echo '</div>';

	}
	else
{
	echo '<div class="navi">Записей нет</div>';
}



include $dir.'system/end.php';
?>