Авторизуйтесь по паролю
Или через соцсеть
sr.green 05.05.2014 Все вопросы » Ламерские вопросы 3414
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);
<style> .sociallinks { display: none; position: fixed; z-index: 999; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.4); } .sociallinks-content { background-color: #fefefe; margin: auto; padding: 20px; border: 1px solid #888; width: 80%; max-width: 500px; border-radius: 10px; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); } .close { color: #aaa; position: absolute; top: 10px; right: 10px; font-size: 28px; font-weight: bold; } .close:hover, .close:focus { color: black; text-decoration: none; cursor: pointer; } .social-container { display: flex; align-items: center; } .social-container > div { margin-left: 10px; } h2, p { margin: 5px 0; } .social { padding-top: 20px; } .social img { margin: 10px; } .sharebtn { padding-top: 20px; width: 100%; } .sharebtn_area { border: 1px solid black; height: 40px; } .sharebtn input[type="text"] { width: 70%; border: none; height: 95%; } .sharebtn button { width: 25%; height: 95%; border: none; background-color: #fff; } </style> <button id="opensociallinksBtn">Поделиться</button> <div id="mysociallinks" class="sociallinks"> <div class="sociallinks-content"> <span class="close">×</span> <div class="social-container"> <img src="{image-1}" alt="Icon" width="30" height="30"> <div> <h2>{title}</h2> <p>Поделиться</p> </div> </div> <div class="social"> <a href="https://api.whatsapp.com/send/?text={full-link}"><img src="whatsapp.png" alt="WhatsApp" width="30" height="30"></a> <a href="https://www.facebook.com/sharer/sharer.php?u={full-link}"><img src="facebook.png" alt="Facebook" width="30" height="30"></a> <a href="https://twitter.com/intent/post?url={full-link}"><img src="twitter.png" alt="Twitter" width="30" height="30"></a> <a href="https://www.instagram.com/share?url={full-link}"><img src="instagram.png" alt="Instagram" width="30" height="30"></a> </div> <div class="sharebtn"> <div class="sharebtn_area"> <input type="text" id="inputText" value="{full-link}" readonly="true"> <button id="copyBtn">Поделиться <img src="share.png" width="10px" alt="Share Icon"></button> </div> </div> </div> </div> <script> var sociallinks = document.getElementById("mysociallinks"); var opensociallinksBtn = document.getElementById("opensociallinksBtn"); var closeBtn = document.getElementsByClassName("close")[0]; var copyBtn = document.getElementById("copyBtn"); var inputText = document.getElementById("inputText"); opensociallinksBtn.onclick = function() { sociallinks.style.display = "block"; } closeBtn.onclick = function() { sociallinks.style.display = "none"; } window.onclick = function(event) { if (event.target == sociallinks) { sociallinks.style.display = "none"; } } copyBtn.onclick = function() { inputText.select(); document.execCommand("copy"); } </script>