Небольшой хак для редактора категорий. На этот раз - наглядный выбор иконки для категории вместо простого ввода ссыкли на иконку. Для версий DLE: 7.5, 8.0, 8.2, 8.3 Итак, начинаем: Открываем файл engineskinsdefault.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() } 2. Затем открываем файл engineinccategories.php Ищем строку (по умолчанию строка #306): [?] Заменяем на: [?] [ Выбрать значек ] [ Свернуть ] $iconlist Далее ищем строку (по умолчанию строка #483): [?] Заменяем на: [?] [ Выбрать значек ] [ Свернуть ] $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 .= "[img]\".$config[[/img] | "; 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 .= "[img]\".$config[[/img] | "; if ($i%$columnsnum == 0) $iconlist .= " "; } } } } $iconlist .= "
"; closedir($handle); } Затем Ищем строку (по умолчанию строка #726): echo "[img]\"[/img] "; Заменяем на: echo "[img]\"[/img] "; Далее создаем каталог icons в папке uploads и загружаем туда нужные Вам иконки в форматах gif или png. Готово! Вы также можете воспользоваться модифицированными(готовыми) файлами:
|