Файл: adm_panel/modules.php
Строк: 73
<?
include_once '../sys/inc/start.php';
include_once '../sys/inc/compress.php';
include_once '../sys/inc/sess.php';
include_once '../sys/inc/home.php';
include_once '../sys/inc/settings.php';
include_once '../sys/inc/db_connect.php';
include_once '../sys/inc/ipua.php';
include_once '../sys/inc/fnc.php';
include_once '../sys/inc/adm_check.php';
include_once '../sys/inc/user.php';
user_access('modules_edit',null,'index.php?'.SID);
adm_check();
$set['title'] = lang('Модули');
include_once '../sys/inc/thead.php';
title();
aut();
if (isset($_GET['detals']))
{
$q = mysql_query("SELECT * FROM `modules` where `id` = ".intval($_GET['detals']));
$post = mysql_fetch_assoc($q);
echo "<table class='post'>";
echo " <tr>";
$ank = get_user($post['author_install']);
echo " <td class='p_t'>";
echo output_text($post['name']) .' :: '. output_text($post['author']);
echo " </td>";
echo " </tr>";
echo " <tr>";
echo " <td class='p_m'>";
echo output_text($post['opis']);
echo " </td>";
echo " </tr>";
echo "</table>";
echo '<div class="p_m">Установил '.nick($ank['id']).'</div>';
echo '<a href="?"><div class="p_m"> Назад</div></a>';
include_once H.'sys/inc/tfoot.php';
exit;
}
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `modules`"),0);
$k_page=k_page($k_post,$set['p_str']);
$page=page($k_page);
$start=$set['p_str']*$page-$set['p_str'];
$q=mysql_query("SELECT * FROM `modules` ORDER BY `id` DESC LIMIT $start, $set[p_str]");
echo "<table class='post'>n";
if ($k_post==0)
{
echo " <tr>";
echo " <td class='p_t'>";
echo lang("Список установленных модулей пуст");
echo " </td>";
echo " </tr>";
}
while ($post = mysql_fetch_assoc($q))
{
echo " <tr>n";
$ank = get_user($post['author_install']);
echo " <td class='icon14' rowspan='2'>";
echo image::is('/style/modules/'. $post['img'],100,100,'/style/modules/null.png');
echo '<a href="?detals='.$post['id'].'"><div class="ank_span"><center> '.lang('Подробнее').'</center></div></a>';
echo " </td>";
echo " <td class='p_t'>";
echo output_text($post['name']) .' :: '. output_text($post['author']);
echo " </td>";
echo " </tr>";
echo " <tr>";
echo " <td class='p_m'>";
//разбиваем на массив
$arr_str = explode(" ", output_text($post['opis']));
//берем первые 6 элементов
$arr = array_slice($arr_str, 0, 15);
//превращаем в строку
$text = implode(" ", $arr);
// Если необходимо добавить многоточие
if (count($arr_str) > 15)
$text .= '...';
echo ($text);
echo " </td>";
echo " </tr>";
}
echo "</table>";
if ($k_page>1)str("?",$k_page,$page); // Вывод страниц
echo "<div class='foot'>";
echo "«<a href='modules_install.php'>".lang('Установка модулей')."</a><br />";
echo "«<a href='modules_market.php'>".lang('Fiera Market')."</a><br />";
echo "«<a href='".APANEL."/'>".lang('В админку')."</a><br />";
echo "</div>";
include_once H.'sys/inc/tfoot.php';
?>