View file modile/user/send_mess.php

File size: 1.56Kb
<?php
Defined('INDEX_S_S') or die ('Доступ запрещен!!!');
if (filesize($cms.'user/'.$_SESSION['user_login'].'/mess_to.txt') == 0) echo 'Писем нет';
else
	 {
			    $st_r = $cgf_ind_mess;
			    // столько выводим



			if (is_file($cms.'user/'.$_SESSION['user_login'].'/mess_to.txt')) $post = @file($cms.'user/'.$_SESSION['user_login'].'/mess_to.txt'); else echo 'Ошибка';

			$count_post = count($post);

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

			$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 class="user_name" align="right">Кому: <a href="/?page=anketa&log_in='.$fn[1].'">'.$fn[1].'</a></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'].'&&mess_id='.$_GET['mess_id'].'&postpages='.$i.'">'.$i.'</a> '."";
			    }

			 }
	}


?>