Просмотр файла clan/login.php

Размер файла: 18.98Kb
<?php
include "config.php";
function errors() {
error_reporting(0);}
function hdr() {
global $clan;
global $bgcolor;
global $css;
global $textcolor;
echo "<HTML>";
echo "<HEAD>";
echo "<TITLE>";
echo "$clan";
echo " Clan - Мой аккаунт</TITLE>";
echo "<link rel=\"stylesheet\" href=\"$css\">";
echo "<meta HTTP-EQUIV=\"Content-Type\" Content=\"text-html; charset=Windows-1251\">";
echo "<script>\n";
echo "function close_win() {\n";
echo "window.close();\n";
echo "return false;}\n";
echo "</script>\n";
echo "</head><BODY bgcolor=\"$bgcolor\" text=\"$textcolor\">";}
function ftr (){
echo "</BODY>\n";
echo "</HTML>\n";}
function myacc(){
global $color;
global $fid;
global $fstatus;
global $fname;
global $fgame;
global $flastname;
global $fage;
global $ficq;
global $fcity;
global $fmail;
global $fcountry;
global $clan;
global $count2;
$mounths=array("Января","Февраля","Марта","Апреля","Мая","Июня","Июля","Августа","Сентября","Октября","Ноября","Декабря");
$today=date ("d")." ".$mounths[date("m")-1]." ".date("Y")."г.";
echo "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" bgcolor=\"#cccccc\">\n";
echo "<tr bgcolor=\"$color[2]\" height=20>\n";
echo "<td width=\"100%\"  align=\"center\">\n";
echo "<font class =\"plain\" color=\"ffffff\" face=\"Arial, Helvetica, sans-serif\" size=\"2\">\n";
echo "Здравствуйте, $fname. Сегодня $today\n";
echo "</font></td></tr><tr height=1 bgcolor=\"1B1D95\">\n";
echo "<td colspan=3></td></tr><tr height=1 bgcolor=\"1B1D95\"><td colspan=3>\n";
echo "</td></tr><tr bgcolor=\"$color[2]\" height=20>\n";
echo "<td width=\"100%\" align=\"left\">\n";
echo "<font class =\"plain\" color=\"ffffff\" face=\"Arial, Helvetica, sans-serif\" size=\"2\">\n";
echo "</font></td>
</tr>

<tr height=1 bgcolor=\"1B1D95\">
<td colspan=3>
</td>
</tr>


<tr bgcolor=\"$color[2]\" height=20>
         <td width=\"100%\" align=\"center\"><font class =\"plain\" color=\"ffffff\" face=\"Arial, Helvetica, sans-serif\" size=\"2\">
Ваш статус: $fstatus
</font></td>
</tr>

<tr height=1 bgcolor=\"1B1D95\">
<td colspan=3>
</td>
</tr>



<tr bgcolor=\"$color[2]\" height=20>
         <td width=\"100%\" align=\"center\"><font class =\"plain\" color=\"ffffff\" face=\"Arial, Helvetica, sans-serif\" size=\"2\">
Ваш ID: $fid
</font></td>
</tr>

<tr height=1 bgcolor=\"1B1D95\">
<td colspan=3>
</td>
</tr>


<tr bgcolor=\"$color[2]\" height=20>
         <td width=\"100%\" align=\"center\">
         <font class =\"plain\" color=\"ffffff\" face=\"Arial, Helvetica, sans-serif\" size=\"2\">
Ваш e-mail: $fmail
</font></td>
</tr>

<tr height=1 bgcolor=\"1B1D95\">
<td colspan=3>
</td>
</tr>


<tr bgcolor=\"$color[2]\" height=20>
         <td width=\"100%\" align=\"center\"><font class =\"plain\" color=\"ffffff\" face=\"Arial, Helvetica, sans-serif\" size=\"2\">
Cпециализация: $fgame
</font></td>
</tr>

<tr height=1 bgcolor=\"1B1D95\">
<td colspan=3>
</td>
</tr>



<tr bgcolor=\"$color[2]\" height=20>
         <td width=\"100%\" align=\"center\">
         <font class =\"plain\" color=\"ffffff\" face=\"Arial, Helvetica, sans-serif\" size=\"2\">
Имя: $fname
</font></td>
</tr>

<tr height=1 bgcolor=\"1B1D95\">
<td colspan=3>
</td>
</tr>


<tr bgcolor=\"$color[2]\" height=20>
         <td width=\"100%\" align=\"center\">
         <font class =\"plain\" color=\"ffffff\" face=\"Arial, Helvetica, sans-serif\" size=\"2\">
Фамилия: $flastname
</font></td>
</tr>

<tr height=1 bgcolor=\"1B1D95\">
<td colspan=3>
</td>
</tr>


<tr bgcolor=\"$color[2]\" height=20>
         <td width=\"100%\" align=\"center\"><font class =\"plain\" color=\"ffffff\" face=\"Arial, Helvetica, sans-serif\" size=\"2\">
Возраст: $fage
</font></td>
</tr>



<tr height=1 bgcolor=\"1B1D95\">
<td colspan=3>
</td>
</tr>

<tr bgcolor=\"$color[2]\" height=20>
         <td width=\"100%\" align=\"center\"><font class =\"plain\" color=\"ffffff\" face=\"Arial, Helvetica, sans-serif\" size=\"2\">
Город: $fcity
</font></td>
</tr>

<tr height=1 bgcolor=\"1B1D95\">
<td colspan=3>
</td>
</tr>

<tr bgcolor=\"$color[2]\" height=20>
         <td width=\"100%\" align=\"center\"><font class =\"plain\" color=\"ffffff\" face=\"Arial, Helvetica, sans-serif\" size=\"2\">
Страна: $fcountry
</font></td>
</tr>

<tr height=1 bgcolor=\"1B1D95\">
<td colspan=3>
</td>
</tr>
<tr bgcolor=\"$color[2]\" height=20>
         <td width=\"100%\" align=\"center\"><font class =\"plain\" color=\"ffffff\" face=\"Arial, Helvetica, sans-serif\" size=\"2\">
ICQ: $ficq
</font></td>
</tr>

<tr height=1 bgcolor=\"1B1D95\">
<td colspan=3>
</td>
</tr>";

 ///////////////////////////////////////////////

echo "

<tr height=1 bgcolor=\"1B1D95\">
<td colspan=3>
</td>
</tr>
<tr bgcolor=\"$color[2]\" height=20>
         <td width=\"100%\" align=\"center\"><font class =\"plain\" color=\"ffffff\" face=\"Arial, Helvetica, sans-serif\" size=\"2\">
------------------------------------
</font></td>
</tr>

<tr height=1 bgcolor=\"1B1D95\">
<td colspan=3>
</td>
</tr>

<tr height=1 bgcolor=\"1B1D95\">
<td colspan=3>
</td>
</tr>
<tr bgcolor=\"$color[2]\" height=20>
         <td width=\"100%\" align=\"center\"><font class =\"plain\" color=\"ffffff\" face=\"Arial, Helvetica, sans-serif\" size=\"2\">
Количество мемберов в клане $clan: $count2
</font></td>
</tr>

<tr height=1 bgcolor=\"1B1D95\">
<td colspan=3>
</td>
</tr> ";

for ($n=0; $n<9;$n++){
echo "<tr height=1 bgcolor=\"1B1D95\">
<td colspan=3>
</td>
</tr>
<tr bgcolor=\"$color[2]\" height=20>
<td width=\"100%\" align=\"center\"><font class =\"plain\" color=\"ffffff\" face=\"Arial, Helvetica, sans-serif\" size=\"2\">
</font></td>
</tr>
<tr height=1 bgcolor=\"1B1D95\">
<td colspan=3>
</td>
</tr>";}

exit;
}

hdr();
$file = "members.dat";
$open = fopen ($file, "r");
$data = file($file);
$total=count($data);
      if ($total>0)    {
for ($n=0; $n<$total;$n++){
list($fid,$fmail,$fcity,$fcountry,$fname,$flastname,$fnick,$fage,$ficq,$fgame,$fdate ) = split("\|", "$data[$n]");
if ($id == $fid){


 $file = "$dat_folder/$id.dat";
 $ein = @fopen($file,"r");
 if ($ein) {
 $massiv = file($file);
 $count2 = count($massiv);

 for ($n=0; $n<$count2; $n++) {
 list( $fid,$fmail,$fcity,$fcountry,$fname,$flastname,$fnick,$fage,$ficq,$fgame,$fstatus, $fdate ) = split( '\|', "$massiv[$n]" );
/*---------------------------------------------------*/

echo "<table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\" border=\"0\">
<tr><td bgcolor=\"#000080\"><img src=\"l.jpg\" border=0></td>

<td width=\"100%\" bgcolor=\"#000080\" align=right><input type=\"submit\" value=\"x\" class=\"button\" onClick=\"return close_win();\"></td></tr>
<tr><td bgcolor=\"$color[1]\"  width=\"20%\" height=500 valign=\"top\">";
echo "<center>
<table width=\"95%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" bgcolor=\"#cccccc\">
<tr bgcolor=\"$color[0]\" height=20>
<td width=\"95%\" align=\"center\"><font color=\"ffffff\" face=\"Arial, Helvetica, sans-serif\" size=\"2\">
<a href=\"login.php?my_ac=1&id=$fid&x=25&y=5\" class=\"plain\">Мой аккаунт</a>
</font></td>
</tr>
<tr height=1 bgcolor=\"1B1D95\">
<td colspan=3>
</td>
</tr>

<tr bgcolor=\"$color[0]\" height=20>
         <td width=\"95%\" align=\"center\"><font color=\"ffffff\" face=\"Arial, Helvetica, sans-serif\" size=\"2\">
               <a href=\"login.php?inc_mes=1&id=$fid&x=25&y=5\" class=\"plain\">Входящие сообщения</a>
</font></td>
</tr>

<tr height=1 bgcolor=\"1B1D95\">
<td colspan=3>
</td>
</tr>

<tr bgcolor=\"$color[0]\" height=20>
         <td width=\"95%\" align=\"center\"><font color=\"ffffff\" face=\"Arial, Helvetica, sans-serif\" size=\"2\">
         <a href=\"login.php?wr_n=1&id=$fid&x=25&y=5\" class=\"plain\">Написать в приват</a>
</font></td>
</tr>

<tr height=1 bgcolor=\"1B1D95\">
<td colspan=3>
</td>
</tr>


<tr bgcolor=\"$color[0]\" height=20>
         <td width=\"95%\" align=\"center\"><font color=\"ffffff\" face=\"Arial, Helvetica, sans-serif\" size=\"2\">
         <a href=\"$geme_game\" class=\"plain\" target=\"_blank\">Состав на игру</a>
</font></td>
</tr>

<tr height=1 bgcolor=\"1B1D95\">
<td colspan=3>
</td>
</tr>

<tr bgcolor=\"$color[0]\" height=20>
         <td width=\"95%\" align=\"center\"><font color=\"ffffff\" face=\"Arial, Helvetica, sans-serif\" size=\"2\">
         <font class=\"plain\">Рейтинг</font> <font size=\"-2\">|не доступно|</font>
</font></td>
</tr>

<tr height=1 bgcolor=\"1B1D95\">
<td colspan=3>
</td>
</tr>

<tr bgcolor=\"$color[0]\" height=20>
         <td width=\"95%\" align=\"center\"><font color=\"ffffff\" face=\"Arial, Helvetica, sans-serif\" size=\"2\">
         <a href=\"login.php?faq=1&id=$fid&x=25&y=5\" class=\"plain\">F.A.Q.</a>

</font></td>
</tr>

<tr height=1 bgcolor=\"1B1D95\">
<td colspan=3>
</td>
</tr>

</table>
     <font color=\"$color[3]\">
<XMP>
...........................
...........................
...........................
...$$$......$$.$$......$$..
...$$$.....$$$.$$$....$$$..
...$$$$....$$$..$$$..$$$...
...$$$$...$$$$...$$.$$$....
...$$.$$.$$.$$....$$$$.....
...$$.$$.$$.$$....$$$......
...$$.$$$$$.$$....$$$......
...$$..$$$$.$$....$$$......
...$$..$$$..$$....$$$......
...........................
...........................
...........................
........$$.................
........$$.................
........$$.................
..$$$$..$$..$$$$$$..$$$$$$.
.$$.$$$.$$.$$$..$$$.$$$.$$.
.$......$$..$$$$$$$.$$..$$.
.$...$$.$$.$$$$$.$$.$$..$$.
.$$.$$$.$$.$$$..$$$.$$..$$.
..$$$$..$$..$$$$$$$.$$..$$.
...........................
...........................
...........................
...........................
</XMP>
             </font>

            </center> ";





  echo "
</td><td valign=top bgcolor=\"$color[1]\">";

if ($faq=="1"){

echo "<br>";
include "faq.php";
exit;

 }

if ($wr_n=="1"){
echo "<br><br><center><table cellpadding=2 cellspacing=1 bgcolor=\"#454545\" width=\"70%\">
<tr><td width=\"100%\" border=0 bgcolor=$color[1]><center>Отправить приватное сообщение</center></td></tr></table><center>
";
echo "<center><table cellpadding=2 cellspacing=1 bgcolor=\"#454545\" width=\"70%\">
<tr><td width=\"70%\" border=0 bgcolor=$color[1]>
<form action=\"login.php?id=$fid&x=25&y=5\" method=\"post\">";
echo "Кому: \n";
echo "<select size=\"1\" name=\"to\">";
echo "  <option value=\"\" selected></option>";
$file = "$dat_folder/$id.dat";
$ein = @fopen($file,"r");
$massiv = file($file);
list( $lid,$lmail,$lcity,$lcountry,$lname,$llastname,$lnick,$lage,$licq,$lgame,$lstatus, $ldate ) = split( '\|', "$massiv[0]" );
fclose ($ein);
$file = "members.dat";
$ein = @fopen($file,"r");
$massiv = file($file);
$count2 = count($massiv);

 for ($n=0; $n<$count2; $n++) {
 list( $fid,$fmail,$fcity,$fcountry,$fname,$flastname,$fnick,$fage,$ficq,$fgame,$fstatus, $fdate ) = split( '\|', "$massiv[$n]" );

if ($lnick != $fnick) echo "<option value=\"$fnick\">$fnick</option>";

}
echo "</select><br>   <br>

Сообщение: <textarea name=\"text_h\" rows=5 cols=60 wrap=\"on\" maxlength=\"5\"></textarea><br>

";


 echo "
 <input name=\"submit\" type=\"submit\" value=\"Отправить\">

</form>

</td></tr></table><center>
";



exit;
}

if ($submit=="Отправить"){
$text_h_str = strlen($text_h);
if ($text_h_str >= 254) {
echo "<center>\n";
echo "<br><br><br><br><br><br>$err[3]<br>\n";
echo "<a href=\"javascript:history.go(-1)\" class=\"text\">Вернуться назад</a></center>\n";
exit;
} elseif (empty($text_h)) {
errors();
echo "<center>\n";
echo "<br><br><br><br><br><br> $err[4] <br>";
echo "<a href=\"javascript:history.go(-1)\" class=\"text\">Вернуться назад</a>";
echo "</center>\n";
exit;
} elseif (empty($to)) {
echo "<center>\n";
echo "<br><br><br><br><br><br> $err[5] <br>";
echo "<a href=\"javascript:history.go(-1)\" class=\"text\">Вернуться назад</a>";
echo "</center>\n";
exit;} else {
$text_h = trim($text_h);
$text_h = stripcslashes($text_h);
$text_h = ereg_replace("&", "&amp;", $text_h);
$text_h = ereg_replace("\|", "&#0166;", $text_h);
$text_h = ereg_replace(">", "&gt;", $text_h);
$text_h = ereg_replace("<", "&lt;", $text_h);
$text_h = ereg_replace("\"", "&quot;", $text_h);
$text_h = str_replace("
", "<br>", $text_h);
$file = "$dat_folder/$id.dat";
$ein = @fopen($file,"r");
$massiv = file($file);
list( $lid,$lmail,$lcity,$lcountry,$lname,$llastname,$lnick,$lage,$licq,$lgame,$lstatus, $ldate ) = split( '\|', "$massiv[0]" );
$all = "$text_h"."|"."$lnick";
fclose ($ein);
$file = "messages.dat";
$open = fopen($file,"a");
fwrite($open, "$to|$all|$today|\n");
fclose($open);
echo "<center>\n";
echo "<br><br><br><br><br><br>Спасибо. Ваше сообщение отправлено.";
echo "</center>\n";
exit;
}


}

if ($inc_mes=="1") {

echo "<br><br><center><table cellpadding=2 cellspacing=1 bgcolor=\"#454545\" width=\"70%\">
<tr><td width=\"100%\" border=0 bgcolor=$color[1]><center>Ваши приватные сообщения</center></td></tr></table><center>
";
echo "<center><table cellpadding=2 cellspacing=1 bgcolor=\"#454545\" width=\"70%\">
<tr><td width=\"20%\" border=0 bgcolor=$color[4]>От:</td><td width=\"60%\" border=0 bgcolor=$color[4]>
Сообщение</td><td width=\"20%\" border=0 bgcolor=$color[4]>Отправлено:</td></tr>";

$file = "$dat_folder/$id.dat";
$ein = @fopen($file,"r");
$massiv = file($file);
list( $lid,$lmail,$lcity,$lcountry,$lname,$llastname,$lnick,$lage,$licq,$lgame,$lstatus, $ldate ) = split( '\|', "$massiv[0]" );
fclose ($ein);

$file = "messages.dat";
$ein = @fopen($file,"r");
$massiv = file($file);
$massiv=array_reverse($massiv);
$total = count($massiv);

$counter=0;
for ($n=0; $n<$total;$n++){
list($to,$message,$from,$date ) = split("\|", "$massiv[$n]");
if ($lnick == $to) $counter++;
}

if ($counter<=$maxm) {
for ($n=0; $n<$total;$n++){
list($to,$message,$from,$date ) = split("\|", "$massiv[$n]");
if ($lnick == $to) {
$counter++;
echo"<tr><td width=\"20%\" border=0 bgcolor=$color[1] valign=\"top\">$from</td>
<td width=\"80%\" border=0 bgcolor=$color[1]>";

//текст мессаги
$message_substr=substr($message,0,29);
$count_mes = strlen($message);

if ($count_mes<29) {
echo "$message";
} else {
echo "<form action=\"login.php?full_mes&id=$fid&x=25&y=5\" method=\"post\">";
echo "$message_substr...";
echo "<input name=\"full_mes\" type=\"hidden\" value=\"$message\">";
echo "<input type=\"image\" src=\"full_mes.gif\" name=\"dfr\" value=\"dfg\" align=\"right\">";
echo "</form>";
}
echo "</td>";
echo "<td width=\"60%\" border=0 bgcolor=$color[1] valign=\"top\">$date</td></tr>";
}


}
}
else {
$counter_2 =1;
for ($n=0; $n<$total;$n++){
list($to,$message,$from,$date ) = split("\|", "$massiv[$n]");
if ($counter_2<=$maxm) {
if ($lnick == $to) {
echo"<tr><td width=\"20%\" border=0 bgcolor=$color[1] valign=\"top\">$from</td>\n";
echo "<td width=\"80%\" border=0 bgcolor=$color[1]>\n";
$message_substr=substr($message,0,29);
$count_mes = strlen($message);
if ($count_mes<29) {
echo "$message";
} else {
echo "<form action=\"login.php?full_mes&id=$fid&x=25&y=5\" method=\"post\">";
echo "$message_substr...";
echo "<input name=\"full_mes\" type=\"hidden\" value=\"$message\">";
echo "<input type=\"image\" src=\"full_mes.gif\" name=\"dfr\" value=\"dfg\" align=\"right\">";
echo "</form>";
}
echo "</td>";
echo "<td width=\"60%\" border=0 bgcolor=$color[1] valign=\"top\">$date</td></tr>";
$counter_2++;
}}}
echo "<table cellpadding=2 cellspacing=1 bgcolor=\"#454545\" width=\"70%\">
<tr><td width=\"100%\" border=0 bgcolor=$color[1] align=\"right\">
<a href=\"login.php?arc=show&id=$fid&x=25&y=5\"><font color=\"#8888FF\">архив сообщений</font></a></td></tr></table> ";
}
fclose($ein);
echo "</table>
<center>";
exit;
}
if ($arc=="show") {

$file = "$dat_folder/$id.dat";
$ein = @fopen($file,"r");
$massiv = file($file);
list( $lid,$lmail,$lcity,$lcountry,$lname,$llastname,$jnick,$lage,$licq,$lgame,$lstatus, $ldate ) = split( '\|', "$massiv[0]" );
fclose ($ein);

$file = "messages.dat";
$ein2 = @fopen($file,"r");
$massiv = file($file);
$massiv=array_reverse($massiv);
$total = count($massiv);

echo "<br><br><center><table cellpadding=2 cellspacing=1 bgcolor=\"#454545\" width=\"70%\">
<tr><td width=\"100%\" border=0 bgcolor=$color[1]><center>Все ваши приватные сообщения</center></td></tr></table><center>
";
echo "<center><table cellpadding=2 cellspacing=1 bgcolor=\"#454545\" width=\"70%\">
<tr><td width=\"20%\" border=0 bgcolor=$color[4]>От:</td><td width=\"60%\" border=0 bgcolor=$color[4]>
Сообщение</td><td width=\"20%\" border=0 bgcolor=$color[4]>Отправлено:</td></tr>";


for ($n=0; $n<$total;$n++){
list($to2,$message2,$from2,$date2 ) = split("\|", "$massiv[$n]");
if ($jnick == $to2) {
echo"<tr><td width=\"20%\" border=0 bgcolor=$color[1] valign=\"top\">$from2</td>
<td width=\"80%\" border=0 bgcolor=$color[1]>";
//текст мессаги
$message_substr=substr($message2,0,29);
$count_mes = strlen($message2);

if ($count_mes<29) {
echo "$message2";
} else {
echo "<form action=\"login.php?full_mes&id=$fid&x=25&y=5\" method=\"post\">";
echo "$message_substr...";
echo "<input name=\"full_mes\" type=\"hidden\" value=\"$message2\">";
echo "<input type=\"image\" src=\"full_mes.gif\" name=\"dfr\" value=\"dfg\" align=\"right\">";
echo "</form>";
}  echo"
</td>";
echo "<td width=\"60%\" border=0 bgcolor=$color[1] valign=\"top\">$date2</td></tr>";
}
}
fclose($ein2);
exit;
}
if (!empty($full_mes)) {
echo "<br><br><center><table cellpadding=2 cellspacing=1 bgcolor=\"#454545\" width=\"70%\">
<tr><td width=\"100%\" border=0 bgcolor=#000075><center>Полный текст сообщения:</center></td></tr><tr>
<td width=\"100%\" border=0 bgcolor=$color[1]>$full_mes</td></tr></table>
";
echo "<a href=\"javascript:history.go(-1)\" class=\"text\"><br><br>Вернуться назад</a>";
echo "</center>\n";
exit;
}

if (!isset($my_ac)){


$data = file("members.dat");
$count2=count($data);



myacc();

}

if (isset($my_ac)) {

$data = file("members.dat");
$count2=count($data);

$mounths=array("Января","Февраля","Марта","Апреля","Мая","Июня","Июля","Августа","Сентября","Октября","Ноября","Декабря");
$today=date ("d")." ".$mounths[date("m")-1]." ".date("Y")."г.";
myacc();

}



echo "</td></tr></table>";}
fclose ($ein);}
else {
echo "<center>\n";
echo "<br>\n";
echo "<br>\n";
echo "<br>\n";
echo "<br>";
echo "<br>";
echo "<font color=\"#FF0000\">$err[1]</font>\n";
echo "</center>\n";
}exit;}
else {
$erre="error";}}
fclose ($open);} else {$erre="error"; }
if (isset($erre)) {
echo "<center>";
echo "<font color=#FF0000>\n";
echo "$err[0]<br>";
echo "</font>\n";
echo "Если вы уверены, что эта ошибка произошла не по вашей вине, уверены,<br>\n";
echo "что всё ввели правильно, пожалуйста обратитесь к <a href=\"mailto:$master_mail\">Клан Мастеру</a><br>\n";
echo "Попробуйте войти ещё раз<br>\n";
echo "<form action=\"login.php\" method=post>\n";
echo "ID:<input type=\"text\" name=\"id\" size=8 maxlength=\"5\"><br>\n";
echo "<input type=\"submit\" value=\"вход\" hight=1>\n";
echo "</form>\n";
echo "</center>";}
echo "</body>\n";
echo "</html>\n";
?>