
Хак позволит вам выбрать иконки для ваших категорий, как это показано на скрине выше.
Тестировался на DLE 7.5-8.3
Начнем...
Открываем engine\skins\default.js и в начало ставим:
function ShowOrHide2(d1) {
if (d1 != '') DoDiv2(d1);
}
function DoDiv2(id) {
var item = null;
if (document.getElementById) {
item = document.getElementById(id);
} else if (document.all){
item = document.all[id];
} else if (document.layers){
item = document.layers[id];
}
if (!item) {
}
else if (item.style) {
if (item.style.display == "none"){ item.style.display = ""; }
else {item.style.display = "none"; }
}else{ item.visibility = "show"; }
}
function inserticon(a,b)
{
document.getElementById(b).value=a;
$("#"+b).focus()
}
if (d1 != '') DoDiv2(d1);
}
function DoDiv2(id) {
var item = null;
if (document.getElementById) {
item = document.getElementById(id);
} else if (document.all){
item = document.all[id];
} else if (document.layers){
item = document.layers[id];
}
if (!item) {
}
else if (item.style) {
if (item.style.display == "none"){ item.style.display = ""; }
else {item.style.display = "none"; }
}else{ item.visibility = "show"; }
}
function inserticon(a,b)
{
document.getElementById(b).value=a;
$("#"+b).focus()
}
Затем открываем engine\inc\categories.php
Ищем строку (по умолчанию строка #306):
[?]
И этот кусок меняем на:
[?]
[ Выбрать значек ][ Свернуть ]
$iconlist
[ Выбрать значек ][ Свернуть ]
$iconlist
Теперь ищем строку (по умолчанию строка #483):
[?]
Меняем на:
[?]
[ Выбрать значек ][ Свернуть ]
$iconlist
[ Выбрать значек ][ Свернуть ]
$iconlist
Находим строку (по умолчанию строка #275):
$row['news_msort'] = makeDropDown( array ("" => $lang['sys_global'], "DESC" => $lang['opt_sys_mminus'], "ASC" => $lang['opt_sys_mplus'] ), "news_msort", $row['news_msort'] );
И сразу после ставим:
$dir = ROOT_DIR.'/uploads/icons';
$columnsnum = 8;
if ($handle = opendir($dir))
{
$i = 0;
$iconlist = "";
while (false !== ($file = readdir($handle)))
{
if ($file != '.' and $file != '..' and $file != '.htaccess' and $file != 'Thumbs.db' and $file != 'system' and $file != 'index.html')
{
$ext = explode(".", $file);
$icons = explode(",", $file);
foreach($icons as $iconame)
{
if(end($ext) == "gif" OR end($ext) == "png")
{
$i++; $iconame = trim($iconame);
$iconlist .= "";
if ($i%$columnsnum == 0) $iconlist .= "";
}
}
}
}
$iconlist .= "";
closedir($handle);
}
$columnsnum = 8;
if ($handle = opendir($dir))
{
$i = 0;
$iconlist = "";
while (false !== ($file = readdir($handle)))
{
if ($file != '.' and $file != '..' and $file != '.htaccess' and $file != 'Thumbs.db' and $file != 'system' and $file != 'index.html')
{
$ext = explode(".", $file);
$icons = explode(",", $file);
foreach($icons as $iconame)
{
if(end($ext) == "gif" OR end($ext) == "png")
{
$i++; $iconame = trim($iconame);
$iconlist .= "";
if ($i%$columnsnum == 0) $iconlist .= "";
}
}
}
}
$iconlist .= "";
closedir($handle);
}
Теперь ищем строку (по умолчанию строка #481):
$skinlist = SelectSkin( '' );
И сразу после ставим следующий код:
$dir = ROOT_DIR.'/uploads/icons';
$columnsnum = 8;
if ($handle = opendir($dir))
{
$i = 0;
$iconlist = "";
while (false !== ($file = readdir($handle)))
{
if ($file != '.' and $file != '..' and $file != '.htaccess' and $file != 'Thumbs.db' and $file != 'system' and $file != 'index.html')
{
$ext = explode(".", $file);
$icons = explode(",", $file);
foreach($icons as $iconame)
{
if(end($ext) == "gif" OR end($ext) == "png")
{
$i++; $iconame = trim($iconame);
$iconlist .= "";
if ($i%$columnsnum == 0) $iconlist .= "";
}
}
}
}
$iconlist .= "";
closedir($handle);
}
$columnsnum = 8;
if ($handle = opendir($dir))
{
$i = 0;
$iconlist = "";
while (false !== ($file = readdir($handle)))
{
if ($file != '.' and $file != '..' and $file != '.htaccess' and $file != 'Thumbs.db' and $file != 'system' and $file != 'index.html')
{
$ext = explode(".", $file);
$icons = explode(",", $file);
foreach($icons as $iconame)
{
if(end($ext) == "gif" OR end($ext) == "png")
{
$i++; $iconame = trim($iconame);
$iconlist .= "";
if ($i%$columnsnum == 0) $iconlist .= "";
}
}
}
}
$iconlist .= "";
closedir($handle);
}
Ищем строку (по умолчанию строка #726):
echo "";
Меняем на:
echo "";
Теперь создаем папку icons папке uploads, куда и загружаем нужные иконки в форматах gif и png
ИЛИ же качаем данный архив, в котором лежат уже откорректированные файлы + иконки.
скачать хак


Комментариев: 0
Просмотров: 1495

Информация
Голосование
Топ Новостей
Друзья
Архив сайта