clantop Stress Web 13

KaRmiN

Vassal
Customer
Доброго времени суток
У кого есть готовый модуль clantop.php для lucera?
Или кто сможет подправить запросы?
Code:
<?php
/**
* STRESS WEB
* @author S.T.R.E.S.S.
* @copyright 2008 - 2012 STRESS WEB
* @version 13
* @web http://stressweb.ru
* @fix L2Banners.ru
*/
if ( !defined("STRESSWEB") )
    die( "Access denied..." );

/******************************
* НАСТРОЙКА МОДУЛЯ
******************************/
$T_ENABLE = true; // вкл/выкл модуль
$T_COUNT = 10; // количество результатов
$T_SID = 1; // ID сервера с которого выводить результаты
$T_CACHE = 5; // время кеширования в минутах, 0 - отключить
/******************************
* ВЫВОД РЕЗУЛЬТАТОВ
******************************/
if ( !$T_ENABLE )
    $tpl->SetResult( 'clantop' );
else {
    $clantop = $controller->GetCache( 'mod_clantop' );
    if ( $clantop )
        $tpl->SetResult( 'clantop', $clantop );
    else {

        $db->gdb( $T_SID );

        $T_SEL = $gdb[$T_SID]->query( "SELECT `clan_name`,`clan_level`,`reputation_score` FROM `clan_data` ORDER BY `clan_level` DESC, `reputation_score` DESC LIMIT {$T_COUNT}" );
        if ( $gdb[$T_SID]->num_rows($T_SEL) > 0 ) {
            $T_N = 1;
            while ( $T_RESULT = $gdb[$T_SID]->fetch($T_SEL) ) {
                $tpl->LoadView( 'clantop' );
                $tpl->Block( 'main', false );
                $tpl->Block( 'item' );
                $tpl->Set( 'n', $T_N );
                $tpl->Set( 'clan_name', $T_RESULT['clan_name'] );
                $tpl->Set( 'clan_level', $T_RESULT['clan_level'] );
                $tpl->Set( 'reputation_score', $T_RESULT['reputation_score'] );
                $tpl->Build( 'clantop_item' );
                $T_N++;
            }
            $tpl->LoadView( 'clantop' );
            $tpl->Block( 'item', false );
            $tpl->Block( 'main' );
            $tpl->Set( 'item', $tpl->GetResult('clantop_item', true) );
            $tpl->Build( 'clantop' );
        } else
            $tpl->SetResult( 'clantop' );
        if ( $T_CACHE > 0 ) {
            $controller->SetCache( 'mod_clantop', $tpl->GetResult('clantop'), $T_CACHE );
        }
    }
}
?>
 
Last edited:
Оберни плизик в тэг [CODE][/CODE]
Читать просто невозможно
 
Last edited:
SELECT `clan_level`,`reputation_score` FROM `clan_data` ORDER BY `clan_level` DESC, `reputation_score` DESC LIMIT 1 так выборка по уровню и репе
SELECT `clan_id`,`type`,`name`,`leader_id` FROM clan_subpledges LIMIT 1; Так выборка уровня, id, имени и id лидера
 
Back
Top