<ul>
	<?php
	$path="../../";
	include("../../map.php");
	if($_GET["id"]<>""){
		$ssql="(s1=".$_SESSION["user_id"]." and s2=".$_GET["id"].") or (s1=".$_GET["id"]." and s2=".$_SESSION["user_id"].") and t2<>'all'";
	}else{
		$ssql="t2='all'";
	}
	$sqlc=mysqli_query($conn, "select id,t2,s1,s2,n1,ts1 from t2 where ne='chat' and ".$ssql." order by id asc limit 0,10"); while($rsc=mysqli_fetch_assoc($sqlc)){
		if ($rsc["s2"]==$_SESSION["user_id"]){$Sqlk = mysqli_query($conn, "update genel set s3='1' where ne='chat' and id=".$rsc["id"]."");}
		?>
		<li class="<?php if($rsc["s1"]==$_SESSION["user_id"]){echo "sent";}elseif($rsc["s2"]==$_SESSION["user_id"] or $rsc["t2"]=='all'){echo "replies";}?>">
			<?php if($rsc["s1"]==0){?>
				<img class="prf" src="<?php echo $favicon?>" alt="" />
			<?php }else{?>
				<?php $sql=mysqli_query($conn, "select * from t5 where id=".$rsc["s1"]." or id=".$rsc["s2"].""); $rsu=mysqli_fetch_assoc($sql);?>
					<span class="prf"><?php $name = explode(" ",$rsu["t1"]); echo $name[0][0]."".$name[1][0];?></span>
				<?php }?>
				<p><?php echo $rsc["n1"]?><span style="font-size:9px; display:block;"><?php echo timeAgo($rsc["ts1"])?></span></p>
			</li>
		<?php }?>
	</ul>