Размер файла: 2.43Kb
<?php
$title='Мои сообщения';
require"../system/config.php";
require"../system/func.php";
require"../system/head.php";
require"../system/error.php";
if($vhod==1){}else{header("Location: ../index.php"); exit;}
echo'<div class="i">'.$title.'<br></div>';
if(isset($_GET['st'])){$st=cifry($_GET['st']);}else{$st=0;}
if(isset($_POST['str'])){$str=cifry($_POST['str']);}else{$str=0;}
if(!empty($str)){$st=$str*10-10;}
if(empty($st) or $st<0){$st=0;}
$num=10;
$ikm=$user['id_user'];
$adata=mysql_query("SELECT * FROM `forum_messages` WHERE `id_user`='$ikm'");
$sdata=mysql_query("SELECT * FROM `forum_messages` WHERE `id_user`='$ikm' ORDER BY `timer` DESC LIMIT $st,$num");
$kol=mysql_num_rows($adata);
if($st>$kol){echo'Не верный номер страници'; require"../system/foot.php"; exit;}
if($kol==""){
echo'<div class="p">
ERROR<br>
</div>';
echo'<div class="i">Найдено '.$kol.' сообщений</div>';
}else{
while($ofile=mysql_fetch_array($sdata)){ $idkd=$ofile['id_them'];
echo'<div class="p">';
$oofile=mysql_fetch_array(mysql_query("SELECT * FROM `forum_themes` WHERE `id_them`='$idkd'"));
echo'Тема: <a href="/forum/theme/'.$ofile['id_kat'].'/'.$ofile['id_them'].'/">'.$oofile['ftname'].'</a> ';
$messages=mysql_num_rows(mysql_query("SELECT * FROM `forum_messages` WHERE `id_them`='$idkd'")); if($messages>10){ $stbud=round($messages,-1); $skcf=strlen($messages);
$poslc=substr($messages,($skcf-1),$skcf);
if($poslc>=5 or $poslc=='0'){$stbud=$stbud-10;}
echo'[<a href="/forum/theme/'.$ofile['id_kat'].'/'.$ofile['id_them'].'/page='.$stbud.'"><b>»</b></a>]';
}
echo'<br>Дата: '.date_fixed($ofile['timer']).'<br>Сообщение: '.vizual(mb_substr($ofile['fmtext'],0,250,'UTF-8')).'</div> ';
}}
if($st!=0){
echo'<div class="p"><img src="../design/default/act.gif" alt="-"> <a href="my_messages.php?st='.($st-$num).'&'.$s.'">Назад</a><br></div>';
}
if($kol>$st+$num){
echo'<div class="p"><img src="../design/default/act.gif" alt="-"> <a href="my_messages.php?st='.($st+$num).'&'.$s.'">Вперед</a><br></div>';}
if($kol>10){
echo'<div class="p">
<form action="my_messages.php?'.$s.'" method="post">
На страницу (1-'.ceil(($kol/10)).'):<br>
<input type="text" name="str" maxlength="4" class="form" size="3" value="'.ceil(($kol/10)).'">
<input type="submit" value="ОК" class="but"><br>
</form></div>';}
require"../system/foot.php";
?>