30.04.13, 21:19
0 комментарий
  DLE Хаки

attachment для Tracker for DLE v3.0

Новый вид attachment для Tracker for DLE v3.0
Автор: Rezerss

Решил выложить свой вариант attachment так как стандартный стоит у всех и это не интересно. Для установки нового вида attachment нужно пройти несколько шагов установки. И так приступим.

1. Скачиваем архив с картинками и заливаем в ваш шаблон /templates/ваш шаблон/
2. Прописываем CSS стили в вашем шаблоне /templates/ваш шаблон/style/style.css

/* attachment by Rezerss */
.full_torrent {border:1px solid #e9ebeb;background-color:#FFF;width:539px;margin:1px 0 6px 70px;}
.full_torrent1 {background:url(../images/style/full_torrent1.gif) no-repeat;margin:-1px;}
.full_torrent2 {background:url(../images/style/full_torrent2.gif) no-repeat bottom;padding:1px 1px 16px 1px;}
.full_torrent3 {padding-left:125px;height:35px;display:block;overflow:hidden;line-height:36px;}
.full_torrent3 a {color:#FFF;}
.full_torrent3 a:hover {text-decoration: underline; color:#FFF;}
.full_torrent4 {background:url(../images/style/short11.gif) repeat-x bottom;padding:10px 13px 22px 13px;color:#505050;}
.full_torrent4 a {color:#559eaf;font-weight:bold;font-style:italic;}
.full_torrent4 a:hover {text-decoration: none;}
.full_torrent4 span {color:#888888;}
.full_torrent5 {background:url(../images/style/short11.gif) repeat-x bottom;padding:0 13px 23px 13px;margin-top:-5px;color:#505050;}
.full_torrent5 span {color:#f0b006;font-style:italic;}
.full_torrent5 span span {color:#8ea73d;}
.full_torrent5 span span span {color:#849ba0;}
.full_torrent6 {background:url(../images/style/nav2.gif) repeat-x 0 0px;color:#FFF;text-decoration:none;padding:1px 5px 2px 5px;margin:0 7px 0 -5px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;float:left;}
.full_torrent6:hover {background-position:0 -3px;}
.full_torrent7 {padding:0 13px 0 13px;margin-top:-5px;color:#FFF;display:block;overflow:hidden;}
.li_distribute_m {color:#f0b006;font-style:italic;margin:0 4px 0 2px;}
.li_swing_m {color:#8ea73d !important;margin:0 4px 0 2px;}
.li_download_m {color:#849ba0 !important;margin:0 4px 0 2px;}
.li_list_a1 {padding:5px 12px 0 14px;}
/* attachment by Rezerss */


Стили можно изменять под дизайн.
3. Открываем /templates/ваш шаблон/tracker/file_info_open.tpl удаляем все и вставляем:
[torrent_block]<div id="torrent_{id}_info">[/torrent_block]
<div class="full_torrent">
<div class="full_torrent1">
<div class="full_torrent2">

[download]<div class="full_torrent3">    <a href="/engine/download.php?id={id}">{name}</a></div>[/download]
<div class="full_torrent4"><b>Загрузил:</b> <a href="{author_url}" {author_miniprofile}><b>{author}</b></a> ({date_uploaded})      <a href="#" onclick="tracker_refresh('{id}', '{news_id}', 'info'); return !1;">[обновить]</a>
            [repair]<a href="#" onclick="tracker_check('{id}', '{news_id}', 'repair'); return!1;">[починить]</a>[/repair]
            [delete]<a href="#" onclick="tracker_delete('{id}', '{news_id}'); return!1;">[удалить]</a>[/delete]
            [delete_fake]<a href="#" onclick="tracker_delete('{id}', '{news_id}', 'fake'); return!1;"><span style="color:red">[удалить фейк]</span></a>[/delete_fake]
            [editor]<a href="#" onclick="torrent_editor('{id}'); return!1;">[редактировать]</a>[/editor] </div>
<div class="full_torrent5"><b>Взяли:</b> {num_take} | <b>Размер:</b> {size} | <b>Последняя активность:</b> {date_lastactiv}</div>


{multitracker}



    <div class="li_list_a3">
            <div class="li_swing_a1">
                <div style=" padding-right: 7px;"><b>&nbsp;&nbsp;&nbsp;Файлы:</b></div>
                
            </div>
            <div class="li_list_a1" style="max-height: 420px; overflow: auto;">
                <div class="trackerFileTree" id="torrentFileList_{id}" onclick="trackerFileTreeToogle(arguments[0])">{files}</div>
            </div></div>
        
</div>
</div>
</div>


Внимание! для корректной работы мультитрекера открываем /engine/modules/tracker/multitracker.php удаляем все и вставляем :
<?php
/*
=====================================================
 Модуль: Tracker for DLE
 Версия: 3.0
-----------------------------------------------------
 Автор: MSW
 Сайт:  http://0-web.ru/
-----------------------------------------------------
 Copyright (c) 2011-2013 MSW
=====================================================
 Данный код защищен авторскими правами
=====================================================
 Файл: multitracker.php
=====================================================
*/

if($_POST['edit']=="yes") {
    $fid = intval($_POST['fid']);
    if($fid) {
        @error_reporting ( E_ALL ^ E_WARNING ^ E_NOTICE );
        @ini_set ( 'display_errors', true );
        @ini_set ( 'html_errors', false );
        @ini_set ( 'error_reporting', E_ALL ^ E_WARNING ^ E_NOTICE );
        @session_start();

        define('DATALIFEENGINE', true);
        define('ROOT_DIR', substr(dirname( __FILE__ ), 0, -23));
        define('ENGINE_DIR', ROOT_DIR . '/engine');
        include ENGINE_DIR . '/data/config.php';
        require_once ENGINE_DIR . '/classes/mysql.php';
        require_once ENGINE_DIR . '/data/dbconfig.php';
        require_once ENGINE_DIR . '/data/config.tracker.php';
        require_once ENGINE_DIR . '/modules/functions.php';
        @header("Content-type: text/html; charset={$config['charset']}");

        require_once('multitracker.class.php');

        $scraper = new multitracker();

        $res = $scraper->scrape($_POST['site'], $_POST['hash']);
        if($res['error']) {
            $res = $scraper->announce($_POST['site'], $_POST['hash'], $config_tracker['multitracker_type']);
        }

        if($config_tracker['multitracker_rand']=="on") {
            if($res['leechers']<1) $res['leechers'] = rand(10, 100);
            if($res['seeders']<1) $res['seeders'] = rand(10, 100);
            if($res['completed']<1) $res['completed'] = rand(10, 100);
        } else {
            if(!$res['leechers']) $res['leechers'] = 0;
            if(!$res['seeders']) $res['seeders'] = 0;
            if(!$res['completed']) $res['completed'] = 0;
        }

        echo "{"leech":"{$res['leechers']}","seed":"{$res['seeders']}","down":"{$res['completed']}"}";

        $time = time() + ($config['date_adjust'] * 60);
        $db->query("UPDATE " . PREFIX . "_tracker_multitracker SET leechers='{$res['leechers']}', seeders='{$res['seeders']}', completed='{$res['completed']}', time='{$time}' WHERE link='{$_POST['site']}' AND fid='{$fid}'");
    }
} else {
    $time = time() + ($config['date_adjust'] * 60);
    $tr = array('seeders'=>0, 'leechers'=>0, 'completed'=>0);

    if($config_tracker['multitracker']=="on") {
        $i=0;
        $mt_link = "";
        $sqlx = $db->query("SELECT * FROM " . PREFIX . "_tracker_multitracker WHERE fid='{$rowz['id']}' ORDER BY id ASC");
        while($rowx = $db->get_row($sqlx)) {
            if($rowx['time']<$time-$config_tracker['multitracker_cache']) {
                $rowx['seeders'] = $rowx['leechers'] = $rowx['completed'] = "<img src="/templates/{$config['skin']}/tracker/img/ajax-loader.gif" style="padding: 0px;"/>";
                $mt_js .= "<input type="hidden" id="t{$rowz['id']}_m{$rowx['id']}" value="{$rowx['link']}">n";
                $js_arr[] = $rowx['id'];
            } else {
                $tr['seeders'] += $rowx['seeders'];
                $tr['leechers'] += $rowx['leechers'];
                $tr['completed'] += $rowx['completed'];
            }
            $mt_tpl = file_get_contents(ROOT_DIR . '/templates/' . $config['skin'] . '/tracker/multitracker.tpl');
            $mt_tpl = str_replace('{id}', $rowz['id'], $mt_tpl);
            $mt_tpl = str_replace('{mt_id}', $rowx['id'], $mt_tpl);
            $mt_tpl = str_replace('{mt_link}', $rowx['link'], $mt_tpl);

            $mt_tpl = str_replace('{seeders}', $rowx['seeders'], $mt_tpl);
            $mt_tpl = str_replace('{leechers}', $rowx['leechers'], $mt_tpl);
            $mt_tpl = str_replace('{completed}', $rowx['completed'], $mt_tpl);

            $mt_tpl = str_replace('{THEME}', "/templates/{$config['skin']}", $mt_tpl);
            $mt_js .= "<input type="hidden" id="t{$rowz['id']}_m{$i}" value="{$rowx['link']}">n";
            $mt_link .= $mt_tpl;
        }
        $js = implode(",", $js_arr);

$multitracker = <<<HTML
<script type="text/javascript"><!--
tr_id_array = [{$js}];
$(function() {
    setTimeout(function(){ multitracker('{$rowz['id']}',tr_id_array); }, 100);
});
//--></script>

{$mt_js}
<input type="hidden" id="torrent{$rowz['id']}_hash" value="{$rowz['info_hash']}">

        <div class="bord_a1">
            <div class="li_list" onclick="javascript:ShowOrHide('torrent_{$rowz['id']}_multi')" style="cursor: pointer;"></div>

            <div class="full_torrent5"><b>Раздают: <span id="torrent{$rowz['id']}_multi_seed" class="li_distribute_m">{$tr['seeders']}</span> Качают: <span id="torrent{$rowz['id']}_multi_leech" class="li_swing_m">{$tr['leechers']}</span> Скачали: <span id="torrent{$rowz['id']}_multi_down" class="li_download_m">{$tr['completed']}</span></b></div>

            <div id="torrent_{$rowz['id']}_multi" style="display: none;"><br>
            <table width="100%">
                <tr>
                    <th style="text-align:center;">#</th>
                    <th style="text-align:center;">Трекер</th>
                    <th style="text-align:center;">Раздают</th>
                    <th style="text-align:center;">Качают</th>
                    <th style="text-align:center;">Скачали</th>
                </tr>
                {$mt_link}
            </table>
            </div>
        </div>
HTML;
    } else {
        $multitracker = "";
    }
    $tmp = str_replace('{multitracker}', $multitracker, $tmp);
}
?>


Установка завершена! Удачных проектов!

СКАЧАТЬ

Вес файла
12.79 Kb

Напишите своё мнение