View file inc/head.php

File size: 1.27Kb
<?php


$kda = mysql_query("SELECT * FROM `album_photo` ORDER BY RAND() DESC LIMIT 5");

if($user)
{

$f = mysql_result(mysql_query("SELECT COUNT(*) FROM `friend_reqs` WHERE `fid` = '{$userid}'"), 0);

$m = mysql_result(mysql_query("SELECT COUNT(id) FROM `messages` WHERE `id_ger` = '{$userid}' AND `read` = '0' "), 0);

$n = mysql_result(mysql_query("SELECT COUNT(id) FROM `notice` WHERE `id_user` = '{$userid}' AND `read` = '0'"),0);
echo '<div class="logo" id="top">
 <table id="logol" width="100%">
		<tr>
	<td id="logom"><a href="/"><img src="/images/logo.png" alt="TF"/></a></td>
	<td><a href="/users/notif.php">'.($n == 0 ? 'NOTIC':'NOTIC+<span style="font-weight: bold; color:red;">'.$n.'</span>').'</a></td>';
echo '<td><a href="/friends/requests.php">'.($f ==0 ? 'FRN':'FRN+<span style="font-weight: bold; color:red;">'.$f.'</span>').'</a></td>';
	echo '
	<td><a href="/mail">'.($m == 0 ? 'MSG':'MSG+<span style="font-weight: bold; color:red;">'.$m.'</span>').'</a></td>';
	echo '	<td><a href="/forum">FORUM</a></td>';
	echo '
	</tr></table>
 </div>';
mysql_query("UPDATE `users` SET `last_active` = ".time()." WHERE `username` = '$user'");
  
 
 }else{
 
echo '<div class="logo">
<img src="/images/logo.png" alt="logo"/>Baka Social ^^</div>';
}
?>
</body>