View file index.php

File size: 2.29Kb
<?php
require 'inc/func.php';
bk_head('Index');
require 'inc/head.php';

if($user){
echo '<div class="list1"><table width="100%">';
####form chat
if($datauser['avatar']){
echo '<td width="10%"><img src="/gallery/photos/'.$userid.'/micro/'.$datauser['avatar'].'" width="35" height="50" /></td>';
}else{
$gender = mysql_fetch_assoc(mysql_query("SELECT `gender` FROM `users` WHERE `id` = '".$userid."'"));

	if($gender == "f"){
	echo '<td width="10%"><img src="/images/f.png" width="35" height="50" /></td>';
	}else{
	echo '<td width="10%"><img src="/images/m.png" width="35" height="50" /></td>';		
	}
}
echo '<td width="80%"> <form action="" method="post"><textarea name="content" cols="20"></textarea>
  </td>
  <td width="10%"><input class="submit" type="submit" value="'.$lng_index['but1'].'" name="chat"></form></td></tr></table>';

######chat######

if(isset($_POST['chat'])){

$content = bk_check($_POST['content']);

$ctime = time();

if(empty($content)){
echo '<div class="notic">'.$lng_index['empty'].'</div>';
}elseif(strlen($content) > 9999 || strlen($content) < 3)
{
echo '<div class="notic">'.$lng_index['str'].'</div>';
}elseif(time() - 15 <= $datauser['ctime']) {
echo '<div class="notic"> '.$lng_index['time'].' '.(15 - (time() - $datauser['ctime'])).' '.$lng_index['s'].'<br /><a href="index.php">Go Back</a></div>';
}else{
mysql_query("UPDATE users SET ctime = '".time()."' WHERE id = '$userid'");
mysql_query("INSERT INTO status (from_id, text, time,timeline_id) VALUES ( '$userid', '$content', '$ctime', '$userid')");
echo '<div class="notic">&bull; '.$lng_index['success'].'</div>';
}
}
echo '<div class="tt">'.$lng_index['stt'].'</div><br />';

#########status#########
include 'status.php';  
echo '</div>';
}else{
echo'<div class="list1"><form action="login.php" method="get">
'.$lng_index['username'].'<br/><input style="width:96%;" type="text" name="username" maxlength="20"/><br/>
'.$lng_index['password'].'<br/><input style="width:96%;" type="password" name="password" maxlength="20"/>
<input type="checkbox" name="rem" value="1" />'.$lng_index['rem'].'<br />
<input type="submit" value="'.$lng_index['but'].'" class="sbmt"/><br />
<a href="/recover.html">'.$lng_index['forgot'].'</a></form><br />
'.$lng_index['w'].'';

echo '</div>';
}

bk_foot();
?>