View file super2/mafhist.php

File size: 2.77Kb
<?php
require 'connect.php';
require 'header.php';
require 'result.php';

//$rm = intval($_GET['rm']);
$rm = 1;

$rmaf = 'maf'.$rm;
$ringame = 'ingame'.$rm;

$us = $row['user'];
$smset = $row['smiles'];

mysql_query('SELECT * FROM `'.$ringame.'` WHERE `gamer_id` = '.$id);
if(mysql_affected_rows() != 0)
{$gmes = 1;}
else
{$gmes = 0;}

$max = $row['max'];

if($row['fsize'] == 'small')
{$fsize1 = '<small>'; $fsize2 = '</small>';}
elseif($row['fsize'] == 'big')
{$fsize1 = '<big>'; $fsize2 = '</big>';}
else
{$fsize1 = null; $fsize2 = null;}


print $top.'
<head><meta http-equiv="Cache-Control" content="no-cache" forua="true"/></head>
<card id="history" title="История">
<do type="options" name="refresh" label="Обновить">
<go href="maf.php?id='.$id.'&amp;ps='.$ps.'&amp;rm='.$rm.'&amp;ref='.$ref.'"/></do>
<p>
'.$fsize1.'
<a href="maf.php?id='.$id.'&amp;ps='.$ps.'&amp;rm='.$rm.'#add">Написать</a><br/>
<a href="maf.php?id='.$id.'&amp;ps='.$ps.'&amp;rm='.$rm.'&amp;ref='.$ref.'">Обновить</a>
<br/>---';

$res = mysql_query('SELECT * FROM `'.$rmaf.'` ORDER BY `id` DESC LIMIT 200');
$kol = mysql_affected_rows();
$total = $kol - 1;
$num = intval($_GET['num']);

$ignor = $row['ignor'];
$mread = $num;

for($i=1; $i<=$num; $i++)
{$data = mysql_fetch_assoc($res);}

$i = $num;
while(($mread < $num+$max) && ($i<=$total))
{
$data = mysql_fetch_assoc($res);
$date = $data['time'];
$name = $data['who'];
$usid = $data['usid'];
$msg = $data['message'];
$gm = $data['gamemes'];
if($smset==0 && $data['messagewosm'])
{$msg = $data['messagewosm'];}
if($smset==2 && $data['messagewoasm'])
{$msg = $data['messagewoasm'];}
$time = $data['id'];
$th = $data['towhom'];
$hid = $data['hid'];
$i++;

if((strpos($ignor, $name.'|') === false)&&(($hid!=2) || ($id==$usid)) && ($gmes==0 || ($gmes==1 && $gm==1)))
{
if(!$th)
{
print '<br/><strong><a href="mafinside.php?id='.$id.'&amp;ps='.$ps.'&amp;rm='.$rm.'&amp;nk='.$usid.'&amp;ref='.$ref.'">'.$name.'</a></strong><small>('.$date.')&#187;</small>'.$msg;
$mread++;
}
elseif(($th == $id) || ($id == $usid))
{
print '<br/><strong><a href="mafinside.php?id='.$id.'&amp;ps='.$ps.'&amp;rm='.$rm.'&amp;nk='.$usid.'&amp;ref='.$ref.'">'.$name.'</a>[P!]</strong>('.$date.')&#187;'.$msg;
$mread++;
}
}
}
mysql_close();
$page_next = $num + $max-1;
$page_prev = $num - $max+1;

print '<br/>---';
if($num + $max < $total)
{print '<br/><a href="mafhist.php?id='.$id.'&amp;ps='.$ps.'&amp;rm='.$rm.'&amp;num='.$page_next.'">&gt;&gt;&gt;</a>';}
if($num >= $max)
{print '<br/><a href="mafhist.php?id='.$id.'&amp;ps='.$ps.'&amp;rm='.$rm.'&amp;num='.$page_prev.'">&lt;&lt;&lt;</a>';}
print '<br/><a href="enter.php?id='.$id.'&amp;ps='.$ps.'">Прихожая</a>
'.$fsize2.'
</p>
</card>
</wml>';
?>