Авторизуйтесь по паролю
Или через соцсеть
Casper-X 17.03.2015 Общие вопросы, Модули 2717
lutskboy - 2015-03-1617 марта 2015 19:07 - #42222
DaN - 2015-03-1617 марта 2015 20:50 - #42223
Casper-X - 2015-03-1617 марта 2015 21:32 - #42226
vitnet - 2015-03-1617 марта 2015 22:54 - #42229
kolumb - 2015-03-1617 марта 2015 23:29 - #42230
<?phpif (!defined('DATALIFEENGINE')) { die("Hacking attempt!");}$is_change = false;if (!$config['allow_cache']) { $config['allow_cache'] = "1"; $is_change = true;}$tpl->result['module'] = dle_cache("my", $config['skin']);if ($tpl->result['module'] === false) { /// Код модуля /// $tpl->compile('module'); $tpl->clear(); $tpl->result['module']; create_cache("my", $tpl->result['module'], $config['skin']); }echo $tpl->result['module'];if ($is_change) $config['allow_cache'] = false;?>
vitnet - 2015-03-1618 марта 2015 00:04 - #42231
dle_cache("префикс кеша", $config['skin'], true, "время в минутах");
kolumb - 2015-03-1618 марта 2015 00:11 - #42232
vitnet - 2015-03-1618 марта 2015 00:52 - #42234
kolumb - 2015-03-1618 марта 2015 17:47 - #42253
<?phpif (!defined('DATALIFEENGINE')) { die("Hacking attempt!");}//////function my_cache($prefix, $cache_id = false, $member_prefix = false, $cache = false) { global $config, $is_logged, $member_id, $mcache; if( !$config['allow_cache'] ) return false; $config['clear_cache'] = (intval($cache) >= 1) ? intval($cache) : ((intval($config['clear_cache']) > 1) ? intval($config['clear_cache']) : 0); if( $is_logged ) $end_file = $member_id['user_group']; else $end_file = "0"; if( ! $cache_id ) { $key = $prefix; } else { $cache_id = md5( $cache_id ); if( $member_prefix ) $key = $prefix . "_" . $cache_id . "_" . $end_file; else $key = $prefix . "_" . $cache_id; } if ( $mcache ) { return memcache_get( $mcache, md5( DBNAME . PREFIX . md5(SECURE_AUTH_KEY) .$key ) ); } else { $buffer = @file_get_contents( ENGINE_DIR . "/cache/" . $key . ".tmp" ); if ( $buffer !== false AND $config['clear_cache'] ) { $file_date = @filemtime( ENGINE_DIR . "/cache/" . $key . ".tmp" ); $file_date = time()-$file_date; if ( $file_date > ( $config['clear_cache'] * 60 ) ) { $buffer = false; @unlink( ENGINE_DIR . "/cache/" . $key . ".tmp" ); } return $buffer; } else return $buffer; }}//////$is_change = false;if (!$config['allow_cache']) { $config['allow_cache'] = "1"; $is_change = true;}$tpl->result['module'] = my_cache("my", $config['skin'], true, "1" );if ($tpl->result['module'] === false) { /// Код модуля /// $tpl->compile('module'); $tpl->clear(); $tpl->result['module']; create_cache("my", $tpl->result['module'], $config['skin'], true ); }echo $tpl->result['module'];if ($is_change) $config['allow_cache'] = false;?>
vitnet - 2015-03-1618 марта 2015 17:58 - #42254
kolumb - 2015-03-1621 марта 2015 00:59 - #42357
vitnet - 2015-03-1621 марта 2015 11:47 - #42362
<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>