View file gb/vig.php

File size: 1.42Kb
<?php
Defined('INDEX_S_S') or die ('Доступ запрещен!!!');
if ($_SESSION['login'] != '')
include('gb/vig_add.php');
else
echo 'Ошибка IP адреса.';
if (filesize('gb/gb_base.txt') == 0) echo 'Писем нет';
else
	 {
			    $st_r = $cgf_ind_gb;
			    // столько выводим



			if (is_file('gb/gb_base.txt')) $post = @file('gb/gb_base.txt'); else echo 'Ошибка';

			$count_post = count($post);

			if (empty($_GET['gbpages'])) {
			    $pages = 1;
			} else {
			    $pages = (int) $_GET['gbpages'];
			}

			$j = ($count_post-1)-(($pages-1)*$st_r);
			$i = $j-$st_r;
			for(; $i<$j && $j>=0; $j--)
			{
			$fn = explode("|",$post[$j]);

			echo '

			<table
			 style="width: 100%; text-align: left; margin-left: auto; margin-right: auto;"
			 border="0" cellpadding="0" cellspacing="0">
			  <tbody>
			    <tr>
			      <td style="text-align: left; vertical-align: top;"><span class="mess1"><div align="left">'.$fn[0].'</div><div align="right">'.$fn[1].'</div></span> <span class="mess2">'.$fn[2].'</span>   </td>
			       </tr>
			  </tbody>
			</table>
			      <br>


			     ';


			}

			/*echo 'Страницы:&nbsp;'."\n";
			$all = ceil($count_post/$st_r);
			 for ($i=1;$i<=$all;$i++)
			 {
			     if ($pages==$i) {
			        echo '<b>'.$i.'</b> ';
			     }
			     else
			     {
			        echo '<a href="/?page='.$_GET['page'].'&gbpages='.$i.'">'.$i.'</a> '."";
			     }

			 }*/
	}
?>