Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *
- * @ This file is created by http://DeZender.Net
- * @ deZender (PHP7 Decoder for ionCube Encoder)
- *
- * @ Version : 4.1.0.1
- * @ Author : DeZender
- * @ Release on : 29.08.2020
- * @ Official site : http://DeZender.Net
- *
- */
- global $rowCollection;
- global $do;
- $action = $action ?: strip_tags($_GET['action']);
- $collectionAction = $action;
- $mainAltCollection = '';
- if ($do == 'dle_collections_download') {
- if (!$is_logged) {
- $member_id['user_group'] = 5;
- }
- require_once DLEPlugins::Check(ENGINE_DIR . '/classes/download.class.php');
- $id = intval($_REQUEST['id']);
- $perm = true;
- $full_link = $config['http_home_url'];
- $row = $db->super_query('SELECT id, name, onserver FROM ' . PREFIX . ('_dle_collections_files WHERE id=\'' . $id . '\''));
- if ($row['id'] != $id) {
- $perm = false;
- }
- if (!$perm) {
- header('HTTP/1.1 403 Forbidden');
- exit('You don\'t have access to download this file');
- }
- $url = parse_url($row['onserver']);
- $file_path = dirname(LazyDev\Collections\Helper::cleanDir($url['path']));
- $file_name = pathinfo($url['path']);
- $file_ext = totranslit($file_name['extension'], true, false);
- $file_name = totranslit($file_name['basename'], false);
- if ($file_path && ($file_path != '.')) {
- $file_name = $file_path . '/' . $file_name;
- }
- if (stripos($file_name, '.php') !== false) {
- header('HTTP/1.1 403 Forbidden');
- exit('Access denied');
- }
- if (!$user_group[$member_id['user_group']]['allow_files']) {
- header('HTTP/1.1 403 Forbidden');
- exit('Access denied');
- }
- if ($config['files_antileech']) {
- $_SERVER['HTTP_REFERER'] = LazyDev\Collections\Helper::resetUrl($_SERVER['HTTP_REFERER']);
- $_SERVER['HTTP_HOST'] = LazyDev\Collections\Helper::resetUrl($_SERVER['HTTP_HOST']);
- if ($_SERVER['HTTP_HOST'] != $_SERVER['HTTP_REFERER']) {
- header('HTTP/1.1 403 Forbidden');
- header('Location: ' . $full_link);
- exit('Access denied!!!<br /><br />Please visit <a href="' . $config['http_home_url'] . '">' . $config['http_home_url'] . '</a>');
- }
- }
- $file = new download(ROOT_DIR . '/uploads/dle_collections/' . $file_name, $row['name'], $config['files_force'], intval($user_group[$member_id['user_group']]['files_max_speed']));
- $db->close();
- session_write_close();
- $file->download_file();
- exit();
- }
- else if ($action == 'main') {
- $collectionAction = $action;
- $collectionsConfigVar['number_collections'] = $collectionsConfigVar['number_collections'] ?: 10;
- if (0 < $cstart) {
- $cstart = ($cstart - 1) * $collectionsConfigVar['number_collections'];
- }
- $cacheIdPage = intval($_GET['cstart']);
- $collectionCache = LazyDev\Collections\Cache::get('collections_' . $cacheIdPage);
- if ($collectionCache) {
- $tpl->result['content'] = $collectionCache;
- if ($collectionsConfigVar['redirect']) {
- $count_all = $db->super_query('SELECT COUNT(*) as count FROM ' . PREFIX . '_dle_collections WHERE approve')['count'];
- LazyDev\Collections\Collections::redirect($count_all, '/' . $collectionsConfigVar['url'] . '/', $cacheIdPage, $collectionsConfigVar['number_collections']);
- }
- }
- else {
- $orderColl = 'position ASC';
- if ($collectionsConfigVar['sort_coll'] == 'by_position_asc') {
- $orderColl = 'position ASC';
- }
- else if ($collectionsConfigVar['sort_coll'] == 'by_position_desc') {
- $orderColl = 'position DESC';
- }
- else if ($collectionsConfigVar['sort_coll'] == 'title') {
- $orderColl = 'name ASC';
- }
- else if ($collectionsConfigVar['sort_coll'] == 'by_count_desc') {
- $orderColl = 'count DESC';
- }
- else if ($collectionsConfigVar['sort_coll'] == 'by_count_asc') {
- $orderColl = 'count ASC';
- }
- else if ($collectionsConfigVar['sort_coll'] == 'by_date_desc') {
- $orderColl = 'date DESC';
- }
- else if ($collectionsConfigVar['sort_coll'] == 'by_date_asc') {
- $orderColl = 'date ASC';
- }
- $sqlCollections = $db->query('SELECT c.*, (SELECT COUNT(*) as count FROM ' . PREFIX . '_dle_collections_news WHERE collectionId=c.id) as count FROM ' . PREFIX . ('_dle_collections c WHERE approve GROUP BY c.id ORDER BY fixed DESC, ' . $orderColl . ' LIMIT ' . $cstart . ', ' . $collectionsConfigVar['number_collections']));
- $count_all = $db->super_query('SELECT COUNT(*) as count FROM ' . PREFIX . '_dle_collections WHERE approve')['count'];
- if ($collectionsConfigVar['redirect']) {
- LazyDev\Collections\Collections::redirect($count_all, '/' . $collectionsConfigVar['url'] . '/', $cacheIdPage, $collectionsConfigVar['number_collections']);
- }
- $newsCount = $cstart;
- $idArrayCollections = [];
- $tpl->load_template('lazydev/dle_collections/main/collections.tpl');
- while ($row = $db->get_row($sqlCollections)) {
- $idArrayCollections[] = $row['id'];
- $newsCount++;
- $tpl->set('{name}', stripslashes($row['name']));
- if ($row['title']) {
- $tpl->set('{title}', stripslashes($row['title']));
- $tpl->set_block('\'\\[title\\](.*?)\\[/title\\]\'si', '\\1');
- $tpl->set_block('\'\\[not-title\\](.*?)\\[/not-title\\]\'si', '');
- }
- else {
- $tpl->set('{title}', '');
- $tpl->set_block('\'\\[title\\](.*?)\\[/title\\]\'si', '');
- $tpl->set_block('\'\\[not-title\\](.*?)\\[/not-title\\]\'si', '\\1');
- }
- $row['description'] = stripslashes($row['description']);
- ........................................................................
- .............................................
- .....................
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement