Просмотр файла wwphpmaster1.03/www.phpedited.com/fm/showpst.php

Размер файла: 16.28Kb
<?php
////////////////////////////////////////////////////////////////////////////
//               -_- W|W PHP-master -_-                                   //
//                                                                        //
//                Copyright 2008 MyIE                                     //
//  Create and Design by -_- MyIE                                         //
//  Site (web)           -_- http://www.phpedited.com                     //
//  Site (wap)           -_- http://wap.phpedited.com                     //
//  E-mail (MyIE)        -_- [email protected]                           //
//  ICQ (MyIE)           -_- 952-11-78                                    //
//                                                                        //
//  Вы не имеете право убирать копирайт                                   //
//  оффициального сайта!                                                  //
//This program is free software: you can redistribute it and/or modify    //
//it under the terms of the GNU General Public License as published by    //
//the Free Software Foundation, either version 3 of the License, or       //
//(at your option) any later version.                                     //
//                                                                        //
//This program is distributed in the hope that it will be useful,         //
//but WITHOUT ANY WARRANTY; without even the implied warranty of          //
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the            //
//GNU General Public License for more details.                            //
//                                                                        //
//You should have received a copy of the GNU General Public License       //
//along with this program. If not, see <http://www.gnu.org/licenses/>.    //
////////////////////////////////////////////////////////////////////////////
require_once"../tmpl/cnf.php";
require_once"../tmpl/func.php";
require_once"../tmpl/ses.php";
require_once"../tmpl/hd.php";
require_once"../js/bb_code.php";
require_once"../tmpl/hd_dw.php";

$f=fopen("../wap/lcl/panel3.dt","r");
$ifda=fgets($f);
$ifda=trim($ifda);
if ($ifda==1)
{
echo "<table border=0 cellspacing=5 cellpadding=0 width=100%>";
echo "<tr>";
echo "<td valign=_top width=100%>";
require_once"../panel/panel3q.php";
echo "</td>";
echo "</tr>";
echo "</table>";
}
else
{
echo "</td>";
echo "</tr>";
echo "</table>";
}

$f=fopen("../wap/lcl/panel1.dt","r");
$ifda=fgets($f);
$ifda=trim($ifda);
if ($ifda==1)
{
echo "<table border=0 cellspacing=5 cellpadding=0 width=100%>";
echo "<tr>";
echo "<td valign=_top>";
require_once"../panel/panel1q.php";
echo "</td>";
echo "<td width=100% valign=_top>";
}
else
{
echo "<table border=0 cellspacing=5 cellpadding=0 width=100%>";
echo "<tr>";
echo "<td valign=_top width=100%>";
}
?>

<table border=0 cellspacing=5 cellpadding=0 width=100%>
<tr>
<?php
echo("<td background='../thm-wb/$url_thm/pls.gif' align=center>");
echo("<img src='../thm-wb/$url_thm/plsl.gif' align=left>");
echo("<img src='../thm-wb/$url_thm/plsr.gif' align=right>");
echo("Форум на $title");
?>
</td>
</tr>
<tr>
<td>

<?php
$razdel=$_GET['razdel'];
$podrazdel=$_GET['podrazdel'];
$entry=$_GET['entry'];
$theme=$_GET['theme'];

echo "<center>";
$podrazdel = str_replace(" ","%20",$podrazdel);
$razdel = str_replace(" ","%20",$razdel);
echo "<a href=$url/fm/index.php?razdel=$razdel class=forum1>";
$podrazdel = str_replace("%20"," ",$podrazdel);
$razdel = str_replace("%20"," ",$razdel);
echo "Форум на $title</a> | ";
$podrazdel = str_replace(" ","%20",$podrazdel);
$razdel = str_replace(" ","%20",$razdel);
echo "<a href=$url/fm/show.php?razdel=$razdel&podrazdel=$podrazdel class=forum1>";
$podrazdel = str_replace("%20"," ",$podrazdel);
$razdel = str_replace("%20"," ",$razdel);
echo "$podrazdel</a>";
echo " | $theme";
echo "</center>";

echo "<table border=0 cellspacing=5 cellpadding=0 width=100%>";
// определяем очередность сообщений и выводим их
$file_array=file("../wap/lcl/fm/$razdel/$podrazdel/rec.$entry");
$i=count($file_array);
$count = $i;
$count1 = $count;
if (empty($start))
{
$start = 0;
}
$start = intval($start);
if ($start < 0)
{
$start = 0;
}
$file=fopen("../wap/lcl/msg_fm.dt","r");
$mgs_fm=fgets($file);
if ($count > $start + $mgs_fm) $count = $start + $mgs_fm;
fclose($file);

echo "<table border=0 cellspacing=5 cellpadding=0 width=100%>";
// выводим все сообщения в цикле
for ($i = $start; $i < $count; $i++)
{
if ($i!=0)
{
list ($from, $msg, $time) = explode("|", $file_array[$i]);
// делаем bb-code
$msg = str_replace("[color=red]","<font color=red>",$msg);
$msg = str_replace("[color=blue]","<font color=blue>",$msg);
$msg = str_replace("[color=green]","<font color=green>",$msg);
$msg = str_replace("[color=yellow]","<font color=yellow>",$msg);
$msg = str_replace("[/color]","</font>",$msg);
$msg = str_replace("[u]","<u>",$msg);
$msg = str_replace("[U]","<u>",$msg);
$msg = str_replace("[i]","<i>",$msg);
$msg = str_replace("[I]","<i>",$msg);
$msg = str_replace("[b]","<B>",$msg);
$msg = str_replace("[B]","<B>",$msg);
$msg = str_replace("[sub]","<SUB>",$msg);
$msg = str_replace("[SUB]","<SUB>",$msg);
$msg = str_replace("[sup]","<SUP>",$msg);
$msg = str_replace("[SUP]","<SUP>",$msg);
$msg = str_replace("[/u]","</u>",$msg);
$msg = str_replace("[/U]","</u>",$msg);
$msg = str_replace("[/i]","</i>",$msg);
$msg = str_replace("[/I]","</i>",$msg);
$msg = str_replace("[/b]","</B>",$msg);
$msg = str_replace("[/B]","</B>",$msg);
$msg = str_replace("[/SUB]","</SUB>",$msg);
$msg = str_replace("[/sub]","</SUB>",$msg);
$msg = str_replace("[/SUP]","</SUP>",$msg);
$msg = str_replace("[/sup]","</SUP>",$msg);
$msg = eregi_replace("(.*)\\[url\\](.*)\\[/url\\](.*)","\\1<ahref=\\2>\\2</a>\\3",$msg);
$msg = str_replace("[br]","<br>",$msg);
$msg = str_replace(";)","<img src='../wap/img/bb_icons/smile.gif'>",$msg);
$msg = str_replace(":dance:","<img src='../wap/img/bb_icons/4.gif'>",$msg);
$msg = str_replace(";(","<img src='../wap/img/bb_icons/2.gif'>",$msg);
$msg = str_replace(":ok:","<img src='../wap/img/bb_icons/9.gif'>",$msg);
$msg = str_replace(":shit:","<img src='../wap/img/bb_icons/13.gif'>",$msg);
$msg = str_replace(":star:","<img src='../wap/img/bb_icons/star.gif'>",$msg);
$msg = str_replace(":rofl:","<img src='../wap/img/bb_icons/rofl.gif'>",$msg);
$msg = str_replace(":punish2:","<img src='../wap/img/bb_icons/punish2.gif'>",$msg);
$msg = str_replace(":friends:","<img src='../wap/img/bb_icons/friends.gif'>",$msg);
$msg = str_replace(":tease:","<img src='../wap/img/bb_icons/tease.gif'>",$msg);
$msg = str_replace(":padonak:","<img src='../wap/img/bb_icons/padonak.gif'>",$msg);
$msg = str_replace(":wild:","<img src='../wap/img/bb_icons/wild.gif'>",$msg);
// непосредственный вывод
$from=trim($from);
echo "<tr><td class=frm3_head>Дата: $time";
////////// проверка на админа ////////
if ($_SESSION)
{
$files_array = file("../wap/lcl/prof/$log");
if(!$files_array)
	{
echo("Ошибка открытия файла wap/lcl/prof/log$log");
	}
if (($files_array[2]==101) || ($files_array[2]==102) || ($files_array[2]==103))
	{
$podrazdel = str_replace(" ","%20",$podrazdel);
$razdel = str_replace(" ","%20",$razdel);
echo ("<a href='fm_msg_del.php?del=$i&razdel=$razdel&podrazdel=$podrazdel&entry=$entry&theme=$theme' class=cool title='Удалить'>[del]</a>");
echo ("<a href='msg_edit.php?del=$i&razdel=$razdel&podrazdel=$podrazdel&entry=$entry&theme=$theme&i=$i' class=cool title='Редактировать'>[edit]</a>");
	}
}
////////// проверка на админа ////////
// если гость - нет ссылки на профиль, если зареганый - есть
$dir = opendir ("../wap/lcl/prof/");
$fear=0;
while ( $file = readdir ($dir))
		{
if (( $file != ".") && ($file != ".."))
{
//echo "<br>----$file<br>";
if ($from!=$file)
	{
$fear=$fear;
	}
else
	{
$fear++;
	}
}
		}
closedir ($dir);
if ($fear>0) 
{
echo "</td><td class=frm3_head align=center width=18%><a href='../usr/prosmotr.php?log_pr=$from' class=cool title='Профиль'>$from</a>";
echo "</td></tr><tr><td valign=_top>";
echo "$msg<br></td><td align=center class=frm3>";
$anketa_f=file("../wap/lcl/prof/$from");
if ($anketa_f[2]==101) { echo "Admin<br>"; }
if ($anketa_f[2]==102) { echo "CO-Admin<br>"; }
if ($anketa_f[2]==103) { echo "Moderator<br>"; }
if ($anketa_f[2]==1) { echo "User<br>"; }
echo "Сообщений: $anketa_f[12]<br>";
echo "<a href=../usr/priv_to.php?komu=$from class=forum2 title='Отправить личное сообщение'>[ЛС]</a>";
$anketa_f[16]=trim($anketa_f[16]);
if ($anketa_f[16]!='') { echo "<a href=$anketa_f[16] class=forum2 title='Перейти на сайт' target=_blank>[WWW]</a><br>"; }
echo "</td></tr>";
$theme = $file_array[0];
}
else
{
echo "</td><td class=frm3 align=center width=18%>$from";
echo "</td></tr><tr><td valign=_top>";
echo "$msg<br></td><td align=center class=frm3>";
echo "</td></tr>";
$theme = $file_array[0];
}
}
}
echo "</td>";
echo "</tr>";
print "</table>";

$file=fopen("../wap/lcl/perm_fm.dt","r");
$guest=fgets($file);

if ($_SESSION)
{
$log=$_SESSION['username'];
?>
<center>
<table border=0 width=100%>
<?php
$podrazdel = str_replace(" ","%20",$podrazdel);
$razdel = str_replace(" ","%20",$razdel);
$theme = str_replace(" ","%20",$theme);
//////////////////////////
$file_array = file("../wap/lcl/fm/$razdel/$podrazdel/rec.$entry");
$total=count($file_array);
//////////////////////////
if ($start != 0)
{
echo '<form action=fm_add.php?log='.$log.'&entry='.$entry.'&start='.($start - $mgs_fm).'&razdel='.$razdel.'&podrazdel='.$podrazdel.'&theme='.$theme.'&start='.$total.' method=post name="formular" onsubmit=SubmitControl(this)>';
}
if ($count1 > $start + $mgs_fm)
{
echo '<form action=fm_add.php?log='.$log.'&entry='.$entry.'&start='.($start + $mgs_fm).'&razdel='.$razdel.'&podrazdel='.$podrazdel.'&theme='.$theme.'&start='.$total.' method=post name="formular" onsubmit=SubmitControl(this)>';
}
else
{
echo '<form action=fm_add.php?log='.$log.'&entry='.$entry.'&razdel='.$razdel.'&podrazdel='.$podrazdel.'&theme='.$theme.' method=post name="formular" onsubmit=SubmitControl(this)>';
}
?>
<tr>
<td colspan=2 width=100%>Сообщение | post:<br>
<div class="bb_bar">
<img src="../wap/img/bb_icons/smile.gif" onClick="insert(' ;) ', '')"/>
<img src="../wap/img/bb_icons/4.gif" onClick="insert(' :dance: ', '')"/>
<img src="../wap/img/bb_icons/2.gif" onClick="insert(' ;( ', '')"/>
<img src="../wap/img/bb_icons/9.gif" onClick="insert(' :ok: ', '')"/>
<img src="../wap/img/bb_icons/13.gif" onClick="insert(' :shit: ', '')"/>
<img src="../wap/img/bb_icons/star.gif" onClick="insert(' :star: ', '')"/>
<img src="../wap/img/bb_icons/rofl.gif" onClick="insert(' :rofl: ', '')"/>
<img src="../wap/img/bb_icons/punish2.gif" onClick="insert(' :punish2: ', '')"/>
<img src="../wap/img/bb_icons/friends.gif" onClick="insert(' :friends: ', '')"/>
<img src="../wap/img/bb_icons/tease.gif" onClick="insert(' :tease: ', '')"/>
<img src="../wap/img/bb_icons/padonak.gif" onClick="insert(' :padonak: ', '')"/>
<img src="../wap/img/bb_icons/wild.gif" onClick="insert(' :wild: ', '')"/>
<br>
<input type="button" style="width: 50px;" class=submit value=" B " onClick="insert('[b]', '[/b]')"/>
<input type="button" style="width: 50px;" class=submit value=" I " onClick="insert('[i]', '[/i]')"/>
<input type="button" style="width: 50px;" class=submit value=" U " onClick="insert('[u]', '[/u]')"/>
<input type="button" style="width: 50px;" class=submit value="URL" onClick="insert('[url]', '[/url]')"/>
<input type="button" style="width: 50px;" class=submit value="IMG" onClick="insert('[img]', '[/img]')"/>
<input type="button" style="width: 50px;" class=submit value="SUP" onClick="insert('[sup]', '[/sup]')"/>
</div>
<textarea cols=40 style="width:100%;" rows=7 name='msg' class=input>
</textarea>
</td>
</tr>
<tr>
<td colspan=2><center><input type=submit value='Добавить' class=submit></center></td>
</tr>
</form>
</table>
</center>
<?php
}
if ((!$_SESSION) && ($guest==1))
{
?>
<center>
<table width=100% border=0>
<?php
$podrazdel = str_replace(" ","%20",$podrazdel);
$razdel = str_replace(" ","%20",$razdel);
$theme = str_replace(" ","%20",$theme);
if ($start != 0)
{
echo '<form action=fm_add.php?log=guest&entry='.$entry.'&razdel='.$razdel.'&podrazdel='.$podrazdel.'&theme='.$theme.'&start='.$total.' method=post name="formular" onsubmit=SubmitControl(this)>';
}
if ($count1 > $start + $mgs_fm)
{
echo '<form action=fm_add.php?log=guest&entry='.$entry.'&razdel='.$razdel.'&podrazdel='.$podrazdel.'&theme='.$theme.'&start='.$total.' method=post name="formular" onsubmit=SubmitControl(this)>';
}
else
{
echo '<form action=fm_add.php?log=guest&entry='.$entry.'&razdel='.$razdel.'&podrazdel='.$podrazdel.'&theme='.$theme.'&start='.$total.' method=post name="formular" onsubmit=SubmitControl(this)>';
}
?>
<tr>
<td colspan=2>Сообщение: <font color=red></font><br>
<textarea cols=40 style="width:100%;" rows=7 name='msg' class=input>
</textarea>
</td>
</tr>
<tr>
<td colspan=2><center><input type=submit value='Добавить' class=submit></center></td>
</tr>
</form>
</table>
</center>
<?php
}

if ((!$_SESSION) && ($guest==0))
{
?>
<center>
<table border=0 width=100%>
<tr>
<td align=center><font color=00FF00>Для добавления сообщения необходимо авторизоваться</font></td>
</tr>
</table>
</center>
<?php
}
////////////////////////////////////////////////////////////////////////////////////
echo'<hr>';
$file_array = file("../wap/lcl/fm/$razdel/$podrazdel/rec.$entry");
$total=count($file_array);
// Вывод выбора далее\назад
if ($start != 0) {echo '<a href="showpst.php?start='.($start - $mgs_fm).'&razdel='.$razdel.'&podrazdel='.$podrazdel.'&entry='.$entry.'&theme='.$theme.'" class=forum2>&lt;-Назад</a> ';}else{echo'&lt;-Назад ';}
echo'|'; 
// Вывод выбора страницы
if($total>0)
{
$ba=ceil($total/$mgs_fm);
$ba2=$ba*$mgs_fm-$mgs_fm;

$asd=$start-($mgs_fm*4);
$asd2=$start+($mgs_fm*5);

if($asd<$total && $asd>0) { echo " <a href='showpst.php?start=0&razdel=$razdel&podrazdel=$podrazdel&entry=$entry&theme=$theme' class=forum2>1</a> ... "; }

for($i=$asd; $i<$asd2;)
{
if($i<$total && $i>=0)
{
$ii=floor(1+$i/$mgs_fm);

if ($start==$i) {
echo ' <b>'.$ii.'</b>';
               }
                else {
echo " <a href='showpst.php?start=$i&razdel=$razdel&podrazdel=$podrazdel&entry=$entry&theme=$theme' class=forum2>$ii</a>";
                     }
}
$i=$i+$mgs_fm;
}
if($asd2<$total) { echo " ... <a href='showpst.php?start=$ba2&razdel=$razdel&podrazdel=$podrazdel&entry=$entry&theme=$theme' class=forum2>$ba</a>"; }
}
echo' |'; 
if ($total > $start + $mgs_fm) {echo ' <a href="showpst.php?start='.($start + $mgs_fm).'&razdel='.$razdel.'&podrazdel='.$podrazdel.'&entry='.$entry.'&theme='.$theme.'" class=forum2>Далее -&gt;</a>';}else{echo' Далее-&gt;';}

?>

<h5 align=right>
<input type="hidden" name="Choose site" class=select>
<SELECT onchange="top.location.href = this.options[this.selectedIndex].value;" class=select>
<option value="#" style="BACKGROUND: #663333; COLOR: #ffffff;">Выбор раздела</option>
<?php
// первый уровень начался
$dir_one = opendir ("../wap/lcl/fm/");
while ( $one_razdel = readdir ($dir_one))
{
if (( $one_razdel != ".") && ($one_razdel != ".."))
{
$one_razdel = str_replace(" ","%20",$one_razdel);
echo '<option VALUE='.$url.'/fm/index.php?razdel='.$one_razdel.' class=select>';
$one_razdel = str_replace("%20"," ",$one_razdel);
echo ' &nbsp; '.$one_razdel.'</a>';
// второй уровень начался
$dir_two = opendir ("../wap/lcl/fm/$one_razdel/");
while ( $one_podrazdel = readdir ($dir_two))
	{
if (( $one_podrazdel != ".") && ($one_podrazdel != ".."))
	{
$one_podrazdel = str_replace(" ","%20",$one_podrazdel);
$one_razdel = str_replace(" ","%20",$one_razdel);
echo '<option VALUE="'.$url.'/fm/show.php?podrazdel='.$one_podrazdel.'&razdel='.$one_razdel.'" class=select>';
$one_podrazdel = str_replace("%20"," ",$one_podrazdel);
$one_razdel = str_replace("%20"," ",$one_razdel);
echo ' &nbsp; &nbsp; '.$one_podrazdel.'</option>';
	}
	}
closedir ($dir_two);
// второй уровень кончился
}
}
?>
</h5>

</td>
</tr>
</table>

<?php
$f=fopen("../wap/lcl/panel2.dt","r");
$ifda=fgets($f);
$ifda=trim($ifda);
if ($ifda==1)
{
echo "</td>";
echo "<td width=100% valign=_top>";
require_once"../panel/panel2q.php";
}

require_once"../tmpl/dw.php";
decoder();
echo "</BODY>";
echo "</HTML>";
?>