<?php
include("minicms/config.php");
include("minicms/code.php");
include("minicms/config_bd.php");
include("minicms/lang.inc.php");
Error_Reporting(E_ALL & ~E_NOTICE); /////////////// игнорируем ошибки
header("Content-type:text/vnd.wap.wml;charset=utf-8"); //////// тип и кодировка документа
print "<?xml version=\"1.0\" encoding=\"utf-8\"?>
<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.2//EN\" \"http://www.wapforum.org/DTD/wml12.dtd\">
<wml><card id=\"mas\" title=\"AdminPL\"><p>";
///////////// выводим вмл заголовок
$par=trim($par);
$adpar=trim($adpar);
if($par!=$adpar) {print"Вы не ввели пароль, либо вы ввели неверный пароль.
<br/>Введите пароль:<br/><input name=\"par\" value=\"$k\"/><br/>
<anchor title=\"ok\">Войти
<go href=\"admin.php?st=amPL\" method=\"post\">
<postfield name=\"par\" value=\"$(par)\"/>
</go>
</anchor>";}
////////////////////adminPL//////////////////////////////////////////////////////////////////////
else{
if($st=="amPL"){
echo "<img src=\"stl/mini_CMS.gif\" alt=\"Admin\"/><br/>";
print"<img src=\"stl/icon01.gif\" alt=\"*\"/><a href=\"admin.php?st=menu&par=$par\">Главное МЕНЮ</a><br/>";
print"<img src=\"stl/icon02.gif\" alt=\"*\"/><a href=\"admin.php?st=texgl&par=$par\">Текст На главной!</a><br/>";
print"<img src=\"stl/icon05.gif\" alt=\"*\"/><a href=\"manager.php?st=managr&par=$par\">Менеджер WML</a><br/>";
print"<img src=\"stl/icon06.gif\" alt=\"*\"/><a href=\"admin.php?st=statist&par=$par\">Статистика</a><br/>";
print"<img src=\"stl/icon07.gif\" alt=\"*\"/><a href=\"moduli.php?st=moduli&par=$par\">МОДУЛИ</a><br/>";
///print"<img src=\"stl/icon07.gif\" alt=\"*\"/><a href=\"admin.php?st=seting&par=$par\">МОДУЛИ</a><br/>";
}
//////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////SATTISTEKA////////////////////////////////////////////////////////..........................................................................................................
if($st=="statist") {print"Статистика<br/>";
print"<img src=\"stl/icon06.gif\" alt=\"*\"/><a href=\"admin.php?st=statHS&par=$par\"> по ХОСТАМ</a><br/>";
print"<img src=\"stl/icon06.gif\" alt=\"*\"/><a href=\"admin.php?st=statIP&par=$par\"> по IP</a><br/>";
print"<img src=\"stl/icon06.gif\" alt=\"*\"/><a href=\"admin.php?st=statSTR&par=$par\"> по Страницам</a><br/>";
print"<img src=\"stl/icon06.gif\" alt=\"*\"/><a href=\"admin.php?st=statBR&par=$par\"> по Браузеру</a><br/>";
}
//.....................................IP.............................................................
if($st=="statIP") {print"Статистика по IP<br/>";
print '
<table align="center" border="1" columns="4">
<tr align="center">
<th>ID</th>
<th>'.rus('Адрес').'</th>
<th>'.rus('Страница').'</th>
<th>'.rus('Дата').'</th>
</tr>
<tr align="center">
';
if (empty($page)) $page = 0;
if ($page < 0) $page = 0;
$count_query = 'select count(*) from ip where 1 ;';
$total_mess = mysql_query ($count_query);
$total_count = mysql_fetch_array ($total_mess);
$count = $total_count ['count(*)'];
$query = "SELECT * FROM ip LIMIT ".$page.", ".$max_mess." ;";
if (!$query) echo mysql_error();
$result = mysql_query($query);
if (!$result) echo mysql_error();
while($otvet = mysql_fetch_array($result))
{
print_r('<td align="center"><small>'.$id = $otvet ['id_ip'].'</small></td>');
print_r('<td align="center"><small>'.$id = $otvet ['ip'].'</small></td>');
print_r('<td align="center"><small>'.$id = $otvet ['page'].'</small></td>');
print_r('<td align="center"><small>'.$id = $otvet ['date'].'</small></td>');
echo '</tr>';
echo '<tr>';
}
print '
</tr>
</table>
';
if ($page > 0) echo '<a href="admin.php?st=statIP&par=$par&page='.($page - $max_mess).'">Предыдущие</a> ';
if ($count > $page + $max_mess) echo '<a href="admin.php?st=statIP&par=$par&page='.($page + $max_mess).'">Следующие</a>';
}
//....................................................................................................
//...................................HOST.............................................................
if($st=="statHS") {print"Статистика по ХОСТАМ<br/>";
print '
<table align="center" border="1" columns="4">
<tr align="center">
<th>ID</th>
<th>'.rus('Адрес').'</th>
<th>'.rus('Страница').'</th>
</tr>
<tr align="center">
';
if (empty($page)) $page = 0;
if ($page < 0) $page = 0;
$count_query = 'select count(*) from host where 1 ;';
$total_mess = mysql_query ($count_query);
$total_count = mysql_fetch_array ($total_mess);
$count = $total_count ['count(*)'];
$query = "SELECT * FROM host LIMIT ".$page.", ".$max_mess." ;";
if (!$query) echo mysql_error();
$result = mysql_query($query);
if (!$result) echo mysql_error();
while($otvet = mysql_fetch_array($result))
{
print_r('<td align="center"><small>'.$id = $otvet ['id_host'].'</small></td>');
print_r('<td align="center"><small>'.$id = $otvet ['ip_host'].'</small></td>');
print_r('<td align="center"><small>'.$id = $otvet ['page'].'</small></td>');
echo '</tr>';
echo '<tr>';
}
print '
</tr>
</table>
<br/>
';
if ($page > 0) echo '<a href="admin.php?st=statHS&par=$par&page='.($page - $max_mess).'">Предыдущие</a> ';
if ($count > $page + $max_mess) echo '<a href="admin.php?st=statHS&par=$par&page='.($page + $max_mess).'">Следующие</a>';
}
//....................................................................................................
//...................................STRA.............................................................
if($st=="statSTR") {print"Статистика по Страницам<br/>";
print '
<table border="1" columns="4">
<tr align="center">
<th>ID</th>
<th>'.rus('Страница').'</th>
<th>'.rus('Кол-во заходов').'</th>
</tr>
<tr align="center">
';
if (empty($page)) $page = 0;
if ($page < 0) $page = 0;
$count_query = 'select count(*) from page where 1 ;';
$total_mess = mysql_query ($count_query);
$total_count = mysql_fetch_array ($total_mess);
$count = $total_count ['count(*)'];
$query = "SELECT * FROM page ORDER BY `count` DESC LIMIT ".$page.", ".$max_mess." ;";
if (!$query) echo mysql_error();
$result = mysql_query($query);
if (!$result) echo mysql_error();
while($otvet = mysql_fetch_array($result))
{
print_r('<td align="center"><small>'.$id = $otvet ['id_page'].'</small></td>');
print_r('<td align="center"><small>'.$id = $otvet ['page'].'</small></td>');
print_r('<td align="center"><small>'.$id = $otvet ['count'].'</small></td>');
echo '</tr>';
echo '<tr>';
}
?>
</tr>
</table>
<?
if ($page > 0) echo '<a href="admin.php?st=statSTR&par=$par&page='.($page - $max_mess).'">Предыдущие</a> ';
if ($count > $page + $max_mess) echo '<a href="admin.php?st=statSTR&par=$par&page='.($page + $max_mess).'">Следующие</a>';
}
//....................................................................................................
//...................................BRUZER...........................................................
if($st=="statBR") {print"Статистика по Браузеру<br/>";
print '
<table border="1" columns="4">
<tr align="center">
<th>ID</th>
<th>'.rus('Браузер').'</th>
<th>'.rus('Адрес').'</th>
<th>'.rus('Страница').'</th>
<th>'.rus('Дата').'</th>
</tr>
<tr align="center">
';
######################################################### Auyniea? ii?ad n?diee
if (empty($page)) $page = 0;
if ($page < 0) $page = 0;
#########################################################
######################################################### N?e?aa? iauaa eie-ai oin?ia
$count_query = 'select count(*) from browser where 1 ;';
$total_mess = mysql_query ($count_query);
$total_count = mysql_fetch_array ($total_mess);
$count = $total_count ['count(*)'];
##########################################################
// Een?eia auaiaa oin?ia
$query = "SELECT * FROM browser LIMIT ".$page.", ".$max_mess." ;";
if (!$query) echo mysql_error();
$result = mysql_query($query);
if (!$result) echo mysql_error();
while($otvet = mysql_fetch_array($result))
{
print_r('<td align="center"><small>'.$id = $otvet ['id'].'</small></td>');
print_r('<td align="center"><small>'.$id = $otvet ['br'].'</small></td>');
print_r('<td align="center"><small>'.$id = $otvet ['ip'].'</small></td>');
print_r('<td align="center"><small>'.$id = $otvet ['page'].'</small></td>');
print_r('<td align="center"><small>'.$id = $otvet ['date'].'</small></td>');
echo '</tr>';
echo '<tr>';
}
print '
</tr>
</table>
';
####################################################### Nicaaiea nnueie
if ($page > 0) echo '<a href="admin.php?st=statBR&par=$par&page='.($page - $max_mess).'">Предыдущие</a> ';
if ($count > $page + $max_mess) echo '<a href="admin.php?st=statBR&par=$par&page='.($page + $max_mess).'">Следующие</a>';
#######################################################
}
//////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////SETING///////////////////////////////////////////////////////////
if($st=="seting") {print"ssss<br/>";
echo "<small>текст:</small> <input name=\"titles\" maxlength=\"200\" value=\"$title\"/><br/>";
echo "<small>текст:</small> <input name=\"titleg\" maxlength=\"200\" value=\"$tguest\"/><br/>";
echo "<small>текст:</small> <input name=\"titlen\" maxlength=\"200\" value=\"$nguest\"/><br/>";
echo "<small>текст:</small> <input name=\"jangle\" maxlength=\"200\" value=\"$jangle\"/><br/>";
echo "<small><anchor title=\"Update!\">Обновить!";
echo "<go href=\"admin.php?st=setingupd&par=$par\" method=\"post\">";
echo "<postfield name=\"titles\" value=\"\$titles\"/>";
echo "</go>";
echo "</anchor></small>";
}
////////////////////////////////GL Update///////////////////////////////////////////////////////////
if($st=="setingupd") {print"Текст изменен!<br/>";
$fp=fopen("minicms/config.php","w");
fputs($fp,"$titles \r\n"); ////////////////// создание нового файла с сообщением с именем номера этого файла
fclose($fp);
}
//////////////////////////////////////////////////////////////////////////////////////////////////////
if($st=="menu") {print"Главное МЕНЮ<br/>";
print"<img src=\"stl/icon03.gif\" alt=\"*\"/><a href=\"admin.php?st=menuview&par=$par\">ОБЗОР</a><br/>";
print"<img src=\"stl/icon04.gif\" alt=\"*\"/><a href=\"admin.php?st=menuedit&par=$par\">Редактировать</a><br/>";
}
////////////////////////////////GL MENUobzor//////////////////////////////////////////////////////
if($st=="menuview") {print"ОБЗОР Главное МЕНЮ<br/>";
$text2 = ("wml/index.cms");
$menu = include($text2);
echo"</p>";
}
////////////////////////////////GL MENUedit//////////////////////////////////////////////////////
if($st=="menuedit")
{
$login = "wml/";
print"Редактировать Главное МЕНЮ<br/>";
if(!isset($_GET['page']))
$_GET['page'] = 'index.cms';
if(preg_match('/[^\w\.]/', $_GET['page']))
{
}
$contents = file("wml/" . addslashes($_GET['page']));
echo "\n";
// Выводим первую часть страницы без изменений
for($i = 0; $i < count($contents) && (trim($contents[$i]) != '<p align="center">' && trim($contents[$i]) != '<p align="left">' && trim($contents[$i]) != '<p align="right">'); $i++)
{
echo $contents[$i];
}
$last_tag = '<img src="http://' . $server_name . 'wb/counter.php?id=' . $id . '" alt="counter"/>';
for($j = $i; $j < count($contents) && !(trim($contents[$j]) == '</p>' && trim($contents[$j+1]) == '</card>'); $j++)
{
if(preg_match('/<a href=\"(.*?)\">.*?<\/a>/i', $contents[$j]))
$contents[$j] = preg_replace('/<a href=\"(.*?)\">(.*?)<\/a>/i', '<a href="admin.php?st=menuedd&par=$par&page=' . $_GET['page'] . '&i=' . $j . '">$2</a>', $contents[$j]);
else if(preg_match('/<br\/>/i', $contents[$j]))
$contents[$j] = preg_replace('/<br\/>/i', '<br/><a href="admin.php?st=menuedd&par=$par&page=' . $_GET['page'] . '&i=' . $j . '"><br/></a><br/>', $contents[$j]);
else if(preg_match('/<p align=\"(.*?)\">/i', $contents[$j]))
$contents[$j] = preg_replace('/<p align=\"(.*?)\">/i', '<p align="$1"><a href="admin.php?st=menuedd&par=$par&page=' . $_GET['page'] . '&i=' . $j . '">align=$1</a><br/>', $contents[$j]);
else if(preg_match('/<img src=\"(.*?)\" alt=\"(.*?)\"\/>/i', $contents[$j]))
$contents[$j] = preg_replace('/<img src=\"(.*?)\" alt=\"(.*?)\"\/>/i', '<a href="admin.php?st=menuedd&par=$par&page=' . $_GET['page'] . '&i=' . $j . '">http://' . $server_name . '/$1</a>', $contents[$j]);
else if(preg_match('/<b>(.*?)<\/b>/i', $contents[$j]))
$contents[$j] = preg_replace('/<b>(.*?)<\/b>/i', '<b><a href="admin.php?st=menuedd&par=$par&page=' . $_GET['page'] . '&i=' . $j . '">$1</a></b>', $contents[$j]);
else if(preg_match('/<i>(.*?)<\/i>/i', $contents[$j]))
$contents[$j] = preg_replace('/<i>(.*?)<\/i>/i', '<i><a href="admin.php?st=menuedd&par=$par&page=' . $_GET['page'] . '&i=' . $j . '">$1</a></i>', $contents[$j]);
else if(preg_match('/<small>(.*?)<\/small>/i', $contents[$j]))
$contents[$j] = preg_replace('/<small>(.*?)<\/small>/i', '<small><a href="admin.php?st=menuedd&par=$par&page=' . $_GET['page'] . '&i=' . $j . '">$1</a></small>', $contents[$j]);
else if(trim($contents[$j]) != '')
$contents[$j] = preg_replace("/(.+)\n/i", '<a href="admin.php?st=menuedd&par=$par&page=' . $_GET['page'] . '&i=' . $j . '">$1</a>' . "\n", $contents[$j]);
echo $contents[$j];
}
// Выводим последнюю часть страницы без изменений
$j++;
for($k = $j; $k < count($contents); $k++)
{
echo $contents[$k];
}
echo"</p>";
}
////////////////////////////////GL MENUobzor2//////////////////////////////////////////////////////
if($st=="menuedd") {print"Редактировать Главное МЕНЮ<br/>";
$contents = file("wml/" . addslashes($_GET['page']));
echo htmlspecialchars($contents[(int)$_GET['i']]);//echo htmlentities($contents[(int)$_GET['i']]); ?><br/>
<a href="admin.php?par=<?php echo $par; ?>&p=<?php echo $login; ?>&page=<?php echo $_GET['page']; ?>&i=<?php echo $_GET['i']; ?>&st=menudelt">Удaлить</a><br/>
<a href="moduli.php?par=<?php echo $par; ?>&p=<?php echo $login; ?>&page=<?php echo $_GET['page']; ?>&i=<?php echo $_GET['i']; ?>&st=pmoduli">+МОДУЛЬ</a><br/>
<a href="admin.php?par=<?php echo $par; ?>&p=<?php echo $login; ?>&page=<?php echo $_GET['page']; ?>&i=<?php echo $_GET['i']; ?>&st=wmlpluse">+страницу</a><br/>
*********<br/>
Добавить Линк в меню!<br/>
Teкcт:<br/>
<input name="text" emptyok="true" value="" title="text"/><br/>
URL:<br/>
<input name="link" emptyok="true" maxlength="150" value="http://" title="link"/><br/>
Кapтинкa:<br/>
<input name="picture" emptyok="true" maxlength="150" value="http://" title="picture"/><br/>
Coздaть кaк:<br/>
<select name="action">
<option value="link">Линк</option>
<option value="linkb">Жирный линк</option>
<option value="linki">Курсивный линк</option>
<option value="linku">Подчеркнутый линк</option>
<option value="links">Малый линк</option>
<option value="text">Teкcт</option>
<option value="textb">Жирный текст</option>
<option value="texti">РљСѓСЂСЃРёРІ</option>
<option value="textu">Подчеркнутый</option>
<option value="texts">Малый текст</option>
<option value="picture">Кapтинкa</option>
<option value="urlpict">Линк в кapтинкe</option>
<option value="br"><br/></option>
<option value="left">align=left</option>
<option value="center">align=center</option>
<option value="right">align=right</option>
</select><br/>
Aвтo<br/>:<br/>
<select name="abr">
<option value="yes">Дa</option>
<option value="no">Нeт</option>
</select><br/>
Pacпoлoжeниe:<br/>
<select name="location">
<option value="below">Hиже</option>
<option value="rewrite">Пepeзaпиcь</option>
<option value="above">Вышe</option>
</select><br/>
Резать теги:<br/>
<select name="strip">
<option value="yes">Да</option>
<option value="no">Нет</option>
</select><br/>
<anchor title="go">OK<go href="admin.php?st=menuandd&par=<?php echo $par; ?>&page=<?php echo $_GET['page']; ?>&i=<?php echo $_GET['i']; ?>" method="post">
<postfield name="action" value="$(action)"/>
<postfield name="location" value="$(location)"/>
<postfield name="abr" value="$(abr)"/>
<postfield name="text" value="$(text)"/>
<postfield name="link" value="$(link)"/>
<postfield name="picture" value="$(picture)"/>
<postfield name="strip" value="$(strip)"/>
</go></anchor><br/>
<br/>
<?php
}
////////////////////////////////GL MENU DEL//////////////////////////////////////////////////////
if($st=="menudelt") {print"Удaлино!! Удачно!<br/>";
if($_GET['i'] != 5) // строка с первым <p align ...
{
$contents = file("wml/" . addslashes($_GET['page']));
$contents2 = array();
for($i = 0; $i < count($contents); $i++)
{
if($i != $_GET['i'])
$contents2[] = $contents[$i];
}
$fp = fopen("wml/" . addslashes($_GET['page']), 'w');
fputs($fp, join('', $contents2));
fclose($fp);
$message = 'Текст удален';
}
else
{
$message = 'Данную строку нельзя удалить';
}
}
////////////////////////////////GL MENU ANDD//////////////////////////////////////////////////////
if($st=="menuandd") {print"Линк в меню добавлен!<br/>";
if(preg_match('/[^\w\.]/', $_GET['page']))
{
?>
<wml>
<card id="error" title="error" ontimer="main.php?id=<?php echo $id; ?>&p=<?php echo $login; ?>"><timer value="15"/>
<p align="center">
Неправильное имя страницы
</p>
</card>
</wml>
<?php
exit;
}
$contents = file("wml/" . addslashes($_GET['page']));
for($i = 0; $i < count($contents); $i++)
{
if($banner == 'top' && $i == 6)
{
}
else
{
$contents2[] = $contents[$i];
}
if(trim($contents[$i]) == '<p align="center">' || trim($contents[$i]) == '<p align="left">' || trim($contents[$i]) == '<p align="right">')
{
if($banner == 'top')
$contents2[] = get_random_link();
}
if((isset($contents[$i+1]) && trim($contents[$i+1]) == '</p>') || (isset($contents[$i+2]) && trim($contents[$i+2]) == '</card>'))
{
if($banner == 'bottom')
{
array_pop($contents2);
$contents2[] = get_random_link();
}
}
if($i == $_GET['i'])
{
if($i == 5 && $_POST['location'] == 'rewrite' && $_POST['action'] != 'left' && $_POST['action'] != 'center' && $_POST['action'] != 'right')
{
?>
<wml>
<card id="added" title="added" ontimer="edit.php?id=<?php echo $id; ?>&p=<?php echo $login; ?>&page=<?php echo $_GET['page']; ?>"><timer value="15"/>
<p>
В этой строке Вы можете использовать только выравнивание текста<br/>
</p>
</card>
</wml>
<?php
exit;
}
$_POST['text'] = str_replace('&', '&', $_POST['text']);
$_POST['text'] = str_replace('$', '$$', $_POST['text']);
if($_POST['strip'] == 'yes')
$_POST['text'] = strip_tags($_POST['text']);
if($_POST['text'] == '' && ($_POST['action'] != 'left' && $_POST['action'] != 'center' && $_POST['action'] != 'right'))
{
?>
<wml>
<card id="added" title="added" ontimer="edit.php?id=<?php echo $id; ?>&p=<?php echo $login; ?>&page=<?php echo $_GET['page']; ?>"><timer value="15"/>
<p>
Вы не ввели текст<br/>
</p>
</card>
</wml>
<?php
exit;
}
switch($_POST['action'])
{
case 'link':
$new_line = '<a href="' . $_POST['link'] . '">' . $_POST['text'] . "</a>\n";
break;
case 'linkb':
$new_line = '<b><a href="' . $_POST['link'] . '">' . $_POST['text'] . "</a></b>\n";
break;
case 'linki':
$new_line = '<i><a href="' . $_POST['link'] . '">' . $_POST['text'] . "</a></i>\n";
break;
case 'links':
$new_line = '<small><a href="' . $_POST['link'] . '">' . $_POST['text'] . "</a></small>\n";
break;
case 'linku':
$new_line = '<u><a href="' . $_POST['link'] . '">' . $_POST['text'] . "</a></u>\n";
break;
case 'text':
$new_line = $_POST['text'] . "\n";
break;
case 'textb':
$new_line = '<b>' . $_POST['text'] . "</b>\n";
break;
case 'texti':
$new_line = '<i>' . $_POST['text'] . "</i>\n";
break;
case 'texts':
$new_line = '<small>' . $_POST['text'] . "</small>\n";
break;
case 'textu':
$new_line = '<u>' . $_POST['text'] . "</u>\n";
break;
case 'picture':
$new_line = '<img src="' . $_POST['picture'] . '" alt="' . $_POST['text'] . '"/>' . "\n";
break;
case 'urlpict':
$new_line = '<a href="' . $_POST['link'] . '"><img src="' . $_POST['picture'] . '" alt="' . $_POST['text'] . '"/></a>' . "\n";
break;
case 'br':
$new_line = '<br/>' . "\n";
break;
case 'left':
if($_GET['i'] == 5)
$new_line = '<p align="left">' . "\n";
else
$new_line = '</p><p align="left">' . "\n";
break;
case 'center':
if($_GET['i'] == 5)
$new_line = '<p align="center">' . "\n";
else
$new_line = '</p><p align="center">' . "\n";
break;
case 'right':
if($_GET['i'] == 5)
$new_line = '<p align="right">' . "\n";
else
$new_line = '</p><p align="right">' . "\n";
break;
default:
$new_line = '';
}
if($_POST['abr'] == 'yes')
$new_line .= "\n<br/>\n";
if($_POST['location'] == 'below')
{
// adding new line
$contents2[] = $new_line;
}
if($_POST['location'] == 'rewrite')
{
// adding new line
if($_GET['i'] == 5)
{
$adv_link = array_pop($contents2);
array_pop($contents2);
$contents2[] = $new_line;
//$contents2[] = $adv_link;
}
else
{
array_pop($contents2);
$contents2[] = $new_line;
}
}
if($_POST['location'] == 'above')
{
// adding new line
$curr_row = array_pop($contents2);
$contents2[] = $new_line;
array_push($contents2, $curr_row);
}
}
}
$fp = fopen("wml/" . addslashes($_GET['page']), 'wb');
fputs($fp, join('', $contents2));
fclose($fp);
}
if(!isset($_GET['page']))
$_GET['page'] = 'index.cms';
if(preg_match('/[^\w\.]/', $_GET['page']))
{
?>
<wml>
<card id="error" title="error" ontimer="main.php?id=<?php echo $id; ?>&p=<?php echo $login; ?>"><timer value="15"/>
<p align="center">
Неправильное имя страницы
</p>
</card>
</wml>
<?php
exit;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////GL TEKST///////////////////////////////////////////////////////////
if($st=="texgl") {print"Текст На главной!<br/>";
print"<img src=\"stl/icon03.gif\" alt=\"*\"/><a href=\"admin.php?st=texobz&par=$par\">ОБЗОР</a><br/>";
print"<img src=\"stl/icon04.gif\" alt=\"*\"/><a href=\"admin.php?st=texrd&par=$par\">Редактировать</a><br/>";
}
////////////////////////////////GL TEKST OBZOR/////////////////////////////////////////////////
if($st=="texobz") {print"ОбзорТекста! <br/><br/>";
echo "<small>";
$text = ("wml/waps.cms");
$opis = include($text);
echo "</small>";
}
/////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////GL TEKST REDAKTOR/////////////////////////////////////////////////
if($st=="texrd") {print"Редактор Текста! <br/><br/>";
$text_info = join('', file("wml/waps.cms"));
echo "<small>текст:</small> <input name=\"txss\" maxlength=\"200\" value=\"$text_info\"/><br/>";
echo "<small><anchor title=\"Update!\">Обновить!";
echo "<go href=\"admin.php?st=texupd&par=$par\" method=\"post\">";
echo "<postfield name=\"txss\" value=\"\$txss\"/>";
echo "</go>";
echo "</anchor></small>";
}
////////////////////////////////GL Update///////////////////////////////////////////////////////////
if($st=="texupd") {print"Текст изменен!<br/>";
$fp=fopen("wml/waps.cms","w");
fputs($fp,"$txss \r\n"); ////////////////// создание нового файла с сообщением с именем номера этого файла
fclose($fp);
}
////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////WMLPLUSED//////////////////////////////////////////////////////////
if($st=="wmlpluse") {print"+страницу<br/>";
$max_files = 5;
if(isset($_GET['from']))
$from = $_GET['from'];
else
$from = 0;
$to = $from + $max_files;
$n = 0;
$files = '';
if ($handle = opendir("inc/"))
{
while (false !== ($file = readdir($handle)))
{
if($file != '.' && $file != '..' && $file != 'files')
{
$filesize = filesize("inc/$file");
if($n >= $from && $n < $to)
$files .= '<a href="admin.php?st=wmlview&par=' . $par . '&i='.$i.'&urlwmls=inc/' . $file . '">' . $file . '(' . $filesize . ' byte)</a><br/>';
$n++;
}
}
closedir($handle);
}
if($n > $to )
$files .= <<<FILEDATA
<a href="admin.php?st=wmlpluse&par=$par&from=$to">Далее</a>
<br/>
FILEDATA;
$back_from = $from - $max_files;
if($from > 0)
$files .= <<<FILEDATA
<a href="admin.php.php?st=wmlpluse&par=$par&from=$back_from">Назад</a>
<br/>
FILEDATA;
?>
Всего файлов:<?php echo $n; ?>
<br/>
<?php echo $files; ?>
</p>
<p align="center">
<?php
}
//////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////WML NA GLAV/////////////////////////////////////////////////////////
if($st=="wmlview") {print"+страницу<br/>";
echo htmlspecialchars($contents[(int)$_GET['i']]);//echo htmlentities($contents[(int)$_GET['i']]);
?>
Teкcт:<br/>
<input name="text" emptyok="true" value="" title="text"/><br/>
Coздaть кaк:<br/>
<select name="action">
<option value="link">Линк</option>
<option value="linkb">Жирный линк</option>
<option value="linki">Курсивный линк</option>
<option value="linku">Подчеркнутый линк</option>
<option value="links">Малый линк</option></select><br/>
Aвтo<br/>:<br/>
<select name="abr">
<option value="yes">Дa</option>
<option value="no">Нeт</option>
</select><br/>
Pacпoлoжeниe:<br/>
<select name="location">
<option value="below">Hиже</option>
<option value="rewrite">Пepeзaпиcь</option>
<option value="above">Вышe</option>
</select><br/>
Резать теги:<br/>
<select name="strip">
<option value="yes">Да</option>
<option value="no">Нет</option>
</select><br/>
<anchor title="go">OK<go href="admin.php?st=menuandd&par=<?php echo $par; ?>&page=<?php echo $_GET['page']; ?>&i=<?php echo $_GET['i']; ?>" method="post">
<postfield name="action" value="$(action)"/>
<postfield name="location" value="$(location)"/>
<postfield name="abr" value="$(abr)"/>
<postfield name="text" value="$(text)"/>
<postfield name="link" value="<?php echo $_GET['urlwmls']; ?>"/>
<postfield name="strip" value="$(strip)"/>
</go></anchor><br/>
<br/>
<?php
}
/////////////////////////////////////////////////////////////////////////////////////////////////
}
print"<br/>__________<br/>
<a href=\"admin.php?par=$par&st=amPL\">Админ панель</a>
<br/>
</p></card></wml>";
?>