Авторизуйтесь по паролю
sr.green 05.05.2014 Все вопросы » Ламерские вопросы 3590
psih - 2015-01-305 мая 2014 18:43 - #28204
sr.green - 2015-01-305 мая 2014 18:47 - #28205
Kota - 2015-01-305 мая 2014 19:09 - #28209
sr.green - 2015-01-305 мая 2014 19:49 - #28213
rocksmart - 2015-01-305 мая 2014 20:56 - #28219
vitnet - 2015-01-305 мая 2014 21:15 - #28222
Googledono - 2015-01-307 мая 2014 12:28 - #28295
require_once ROOT_DIR . '/engine/init.php';
/*Меню алфавитное*/ $alfa_menu = dle_cache( "menu_for_main", $config['skin'], true );if ($alfa_menu === FALSE) { $serials_alfa = Array(); $cats = $db->query("SELECT id, name, alt_name FROM " . PREFIX . "_post ORDER BY name ASC"); while ($row = $db->get_row($cats)) { if (ord(substr($row['name'], 0, 1)) >= 48 AND ord(substr($row['name'], 0, 1)) <= 57) $symbol = "0-9"; elseif ((ord(strtoupper(substr($row['name'], 0, 1))) >= 65) AND (ord(strtoupper(substr($row['name'], 0, 1))) <= 90)) $symbol = "A-Z"; else $symbol = ord(substr($row['name'], 0, 1)); $serials_alfa[$symbol][$row['id']] = $row; } $tpl1 = new dle_template(); $tpl1->dir = TEMPLATE_DIR; $tpl1->load_template( 'menu_block.tpl' ); foreach ($serials_alfa as $id => $array) { if ($id == '0-9' OR $id == 'A-Z') $tpl1->set("{symbol}", $id); else $tpl1->set("{symbol}", "А-Я"); $tpl1->set("{col}", count($array)); $tpl12 = new dle_template(); $tpl12->dir = TEMPLATE_DIR; $tpl12->load_template( 'menu_link.tpl' ); foreach ($array as $key => $info) { $link = $config['http_home_url'] . $info['alt_name'] . "/"; $tpl12->set( '[full-link]', "<a href=\"" . $link . "\">" ); $tpl12->set( '[/full-link]', "</a>" ); $tpl12->set( '{name}', $info['name'] ); $tpl12->set( '{alt_name}', $info['metatitle'] ); $tpl12->set( '{id}', $info['id'] ); $tpl12->compile( 'menu_links' ); } $tpl1->set("{menu_links}", $tpl12->result['menu_links']); unset($tpl12); $tpl1->compile( 'alfa_menu' ); } $alfa_menu = $tpl1->result['alfa_menu']; unset($tpl1); create_cache( "menu_for_main", $alfa_menu, $config['skin'], true ); } $tpl->set("{menu}", $alfa_menu);
case "comments" : include ENGINE_DIR . '/modules/comments.php'; break;
case "menu" : include ENGINE_DIR . '/modules/alfa_menu.php'; break;
<div class="fast_info_box"> [full-link]{name}[/full-link]</div>
<li> <a href="#"><div class="menu_anker"><div class="menu_float_l"><div class="menu_float_l2">{symbol}</div></div><div class="menu_float_r">(всего: {col})</div></div></a> <ul class="menu_2"> {menu_links} </ul> </li>
Googledono - 2015-01-307 мая 2014 12:40 - #28296
/*Меню алфавитное*/ $alfa_menu = dle_cache( "menu_for_main", $config['skin'], true );if ($alfa_menu === FALSE) { $serials_alfa = Array(); $cats = $db->query("SELECT id, name, alt_name, parentid FROM " . PREFIX . "_category WHERE parentid='0' AND id != 11 ORDER BY name ASC"); while ($row = $db->get_row($cats)) { if (ord(substr($row['name'], 0, 1)) >= 48 AND ord(substr($row['name'], 0, 1)) <= 57) $symbol = "0-9"; elseif ((ord(strtoupper(substr($row['name'], 0, 1))) >= 65) AND (ord(strtoupper(substr($row['name'], 0, 1))) <= 90)) $symbol = "A-Z"; else $symbol = ord(substr($row['name'], 0, 1)); $serials_alfa[$symbol][$row['id']] = $row; } $tpl1 = new dle_template(); $tpl1->dir = TEMPLATE_DIR; $tpl1->load_template( 'menu_block.tpl' ); foreach ($serials_alfa as $id => $array) { if ($id == '0-9' OR $id == 'A-Z') $tpl1->set("{symbol}", $id); else $tpl1->set("{symbol}", chr($id)); $tpl1->set("{col}", count($array)); $tpl12 = new dle_template(); $tpl12->dir = TEMPLATE_DIR; $tpl12->load_template( 'menu_link.tpl' ); foreach ($array as $key => $info) { $link = $config['http_home_url'] . $info['alt_name'] . "/"; $tpl12->set( '[full-link]', "<a href=\"" . $link . "\">" ); $tpl12->set( '[/full-link]', "</a>" ); $tpl12->set( '{name}', $info['name'] ); $tpl12->set( '{alt_name}', $info['metatitle'] ); $tpl12->set( '{id}', $info['id'] ); $tpl12->compile( 'menu_links' ); } $tpl1->set("{menu_links}", $tpl12->result['menu_links']); unset($tpl12); $tpl1->compile( 'alfa_menu' ); } $alfa_menu = $tpl1->result['alfa_menu']; unset($tpl1); create_cache( "menu_for_main", $alfa_menu, $config['skin'], true ); } $tpl->set("{menu}", $alfa_menu);
CREATE TABLE `dle_views` ( `id` int(11) NOT NULL, `news_id` int(11) NOT NULL DEFAULT '0' ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;