File size: 1.8Kb
<?
echo'<font color="#0000ff"><h3>Стена</h3></font>';
echo'
<form action="./?id='.$idi.'" method="post" name="forma">
Сообщение:<br/>
<textarea cols="25" rows="3" id="comment" name="text"></textarea><br>
<input type="submit" value="Добавить"/><br/>
<div id="smil"><a href="javascript:smil()">Смайлы</a></div><br/>
</form>';
if(!empty($_GET['del']) && ($idi == $id) || !empty($_GET['del']) && ($admin))
{
if(mysql_query("delete from sten where id='$_GET[del]'")){echo'Cообщение удалено';}
}
$text=check($_POST['text']);
if (!empty($id))
{
if (!empty($text))
{
//$text=smiles($text);
$data = $den.' '.$mesac.' '.$god.'г.<br/>'.$time;
if(mysql_query("insert into `sten`(`sten`,`idi`,`data`,`text`) values('$idi','$id','$data','$text');")){echo "Сообщение добавлено!<br/>";} else {echo mysql_error();}
}
}
$max_mess=30;
$page=$_GET[page];
if(empty($page)){$page=0;}
$result_sten = mysql_query("select * from `sten` where sten='$idi' ORDER BY `id` DESC LIMIT ".$page." ,".$max_mess."");
while ($mess_sten = mysql_fetch_array($result_sten))
{
$result_sten_log = mysql_query("select * from `prof` where id='$mess_sten[idi]'");
while ($sten_log = mysql_fetch_array($result_sten_log))
{
$text=smiles($mess_sten[text]);
echo '<br/><div class="a"><table><tr><td valign="top" width="200" align="left">';
photo_sten($sten_log[foto],$mess_sten[idi]);
echo '<br/>';
//on($mess_sten[idi]);
echo'<a href="./?id='.$mess_sten[idi].'">'.$sten_log[name].' '.$sten_log[fam].'</a><br/>'.$mess_sten[data].'<br/>';
if(($idi == $id) || ($admin)){echo'<a href="./?id='.$idi.'&del='.$mess_sten[id].'">Удалить</a><br/>';}
echo'</td><td>'.$text;
echo'</td></tr></table></div><br/>';
}
}
?>