Помогите найти значения в БД HLStats

Тема в разделе "HLstatsX:CE", создана пользователем filipok, 9 янв 2016.

  1. filipok

    filipok

    Сообщения:
    73
    Симпатии:
    8
    Ребят, никто не подскажет, в каких таблицах БД хранятся значения, выделенные красным на скрине (позиции игроков в статистике)
    [​IMG]
    Перерыл всю БД, не нашел ничего. И может быть такое, что эти позиции не хранятся в БД, и веб скрипт сам ранжирует игроков по скиллу? Не хотелось бы)

    Спасибо заранее.
     
  2. Monomizer

    Monomizer Мимо пробегал Супер-модератор

    Сообщения:
    1.527
    Симпатии:
    201
    Там сортировка стоит, вернее зависимость от кол-ва очков, если не ошибаюсь(поправьте)
    А в чём суть вопроса? Поменять систему вывода или убрать столбец либо ещё что то?
    ---
    Только щас заметил, используй внутреннюю БД для загрузки флаг стран
     
    Последнее редактирование: 10 янв 2016
  3. filipok

    filipok

    Сообщения:
    73
    Симпатии:
    8
    Есть сервер кс гоу, а хотел я сделать вывод званий мм в табе на основе этих позиций. Первые 3 - глобалы и Т.д.
    Это самый простой и прозрачный для игроков вариант имхо. Жалко конечно.
    Спасибо за подсказки, Monomizer.
     
  4. filipok

    filipok

    Сообщения:
    73
    Симпатии:
    8
    Народ, кто поможет отредактировать player.php? В php ни бум бум
    Что необходимо сделать: необходимо заменить столбец "skill" картинкой из папки на хосте (host/hlstatsimg). Картинок 16, должны выводиться в зависимости от комбинации этих значений (из таблицы hlstats_Players БД хлстатс):
    Код:
    SELECT
                        hlstats_Players.kills,
                        hlstats_Players.deaths,
                        ......
    по формуле:
    Код:
    Rank = hlstats_Players.kills *  hlstats_Players.kills / hlstats_Players.deaths
    Вот зависимости:
    Rank < 0 => SILVER_I
    0 < SILVER_II < 40
    40 < SILVER_III < 60
    60 < SILVER_IV < 80
    80 < SILVER_ELITE < 100
    100 < SILVER_ELITE_MASTER < 150
    150 < GOLD_NOVA_I < 200
    200 < GOLD_NOVA_II < 275
    275 < GOLD_NOVA_III< 375
    375 < GOLD_NOVA_MASTER < 475
    475 < MASTER_GUARDIAN_I < 575
    575 < MASTER_GUARDIAN_II < 700
    700 < MASTER_GUARDIAN_ELITE < 1000
    1000 < DISTINGUISHED_MASTER_GUARDIAN < 2000
    2000 < LEGENDARY_EAGLE < 3000
    3000 < LEGENDARY_EAGLE_MASTER < 4000
    4000 < SUPREME_MASTER_FIRST_CLASS < 5000
    5000 < THE_GLOBAL_ELITE < 6000

    PHP:
        if ( !defined('IN_HLSTATS') )
        {
            die('Do not access this file directly.');
        }
    // Player Rankings
        $db->query
        ("
            SELECT
                hlstats_Games.name
            FROM
                hlstats_Games
            WHERE
                hlstats_Games.code = '$game'
        ");
        if ($db->num_rows() < 1) error("No such game '$game'.");
        list($gamename) = $db->fetch_row();
        $db->free_result();
        if (isset($_GET['minkills']))
        {
            $minkills = valid_request($_GET['minkills'], 1);
        }
        else
        {
            $minkills = 1;
        }
        pageHeader
        (
            array ($gamename, 'Player Rankings'),
            array ($gamename=>"%s?game=$game", 'Player Rankings'=>'')
        );
        $rank_type = 0;
        if (isset($_GET['rank_type']))
            $rank_type = valid_request(strval($_GET['rank_type']), 0);
            
    // Autocomplete function below implemented by KingJ. Heavy modified to use HTML request instead of JSON.
    ?>

    <div class="block">
        <?php printSectionTitle('Player Rankings');    ?>
        <div class="subblock">
            <div style="float:left;">
                <script type="text/javascript" src="<?php echo INCLUDE_PATH?>/js/Observer.js"></script>
                <script type="text/javascript" src="<?php echo INCLUDE_PATH?>/js/Autocompleter.js"></script>
                <script type="text/javascript" src="<?php echo INCLUDE_PATH?>/js/Autocompleter.Request.js"></script>
                <script type="text/javascript">
                    document.addEvent('domready', function() {
                        new Autocompleter.Request.HTML('playersearch', 'autocomplete.php?game=<?php echo $game?>', {
                            'indicatorClass': 'autocompleter-loading'
                        });
                    });
                </script>

                <form method="get" action="<?php echo $g_options['scripturl']; ?>" style="margin:0px;padding:0px;">
                    <input type="hidden" name="mode" value="search" />
                    <input type="hidden" name="game" value="<?php echo $game?>" />
                    <input type="hidden" name="st" value="player" />
                    <strong>•</strong> Find a player:
                    <input type="text" name="q" size="20" maxlength="64" class="textbox" id="playersearch" />
                    <input type="submit" value="Search" class="smallsubmit" />
                </form>
            </div>
            <div style="float:right;">
                <form method="get" action="<?php echo $g_options['scripturl']; ?>" style="margin:0px;padding:0px;">
                    <input type="hidden" name="mode" value="players" />
                    <input type="hidden" name="game" value="<?php echo $game?>" />
                    <strong>•</strong> Ranking View
                    <?php
                        $result 
    $db->query
                        
    ("
                            SELECT
                                hlstats_Players_History.eventTime
                            FROM
                                hlstats_Players_History
                            GROUP BY
                                hlstats_Players_History.eventTime
                            ORDER BY
                                hlstats_Players_History.eventTime DESC
                            LIMIT
                                0,
                                50
                        "
    );
                        echo 
    '<select name="rank_type"><option value="0">Total Ranking</option>';
                        echo 
    '<option value="-1">Last Week</option>';
                        echo 
    '<option value="-2">Last Month</option>';
                        
    $i 1;
                        
    $dates = array ();
                        while (
    $rowdata $db->fetch_array())
                        {
                            
    $dates[] = $rowdata
                            if (
    $rank_type == $i
                                echo 
    '<option value="'.$i.'" selected>'.$rowdata['eventTime'].'</option>';
                            else
                                echo 
    '<option value="'.$i.'">'.$rowdata['eventTime'].'</option>';
                            
    $i++;
                        }
                        echo 
    '</select>';
                    
    ?>
                    <input type="submit" value="View" class="smallsubmit" />
                </form>
            </div>
            <div style="clear:both;"></div><br /><br />
        </div>
        <?php
            
    if ($g_options['rankingtype']!='kills')
            {
                
    $table = new Table
                
    (
                    array
                    (
                        new 
    TableColumn
                        
    (
                            
    'lastName',
                            
    'Player',
                            
    'width=30&flag=1&link=' urlencode('mode=playerinfo&amp;player=%k')
                        ),
                        new 
    TableColumn
                        
    (
                            
    'skill',
                            
    'Points',
                            
    'width=7&align=right&skill_change=1'
                        
    ),
                        new 
    TableColumn
                        
    (
                            
    'activity',
                            
    'Activity',
                            
    'width=10&sort=no&type=bargraph'
                        
    ),
                        new 
    TableColumn
                        
    (
                            
    'connection_time',
                            
    'Connection Time',
                            
    'width=10&align=right&type=timestamp'
                        
    ),
                        new 
    TableColumn
                        
    (
                            
    'kills',
                            
    'Kills',
                            
    'width=7&align=right'
                        
    ),
                        new 
    TableColumn
                        
    (
                            
    'deaths',
                            
    'Deaths',
                            
    'width=7&align=right'
                        
    ),
                        new 
    TableColumn
                        
    (
                            
    'kpd',
                            
    'K:D',
                            
    'width=6&align=right'
                        
    ),
                        new 
    TableColumn
                        
    (
                            
    'headshots',
                            
    'Headshots',
                            
    'width=6&align=right'
                        
    ),
                        new 
    TableColumn
                        
    (
                            
    'hpk',
                            
    'HS:K',
                            
    'width=6&align=right'
                        
    ),
                        new 
    TableColumn
                        
    (
                            
    'acc',
                            
    'Accuracy',
                            
    'width=6&align=right&append=' urlencode('%')
                        )
                    ),
                    
    'playerId',
                    
    $g_options['rankingtype'],
                    
    'kpd',
                    
    true
                
    );
            }
            else
            {
                
    $table = new Table
                
    (
                    array
                    (
                        new 
    TableColumn
                        
    (
                            
    'lastName',
                            
    'Player',
                            
    'width=30&flag=1&link=' urlencode('mode=playerinfo&amp;player=%k')
                        ),
                        new 
    TableColumn
                        
    (
                            
    'activity',
                            
    'Activity',
                            
    'width=10&sort=no&type=bargraph'
                            
    ),
                        new 
    TableColumn
                        
    (
                            
    'kills',
                            
    'Kills',
                            
    'width=7&align=right'
                        
    ),
                        new 
    TableColumn
                        
    (
                            
    'deaths',
                            
    'Deaths',
                            
    'width=7&align=right'
                        
    ),
                        new 
    TableColumn
                        
    (
                            
    'kpd',
                            
    'K:D',
                            
    'width=6&align=right'
                        
    ),
                        new 
    TableColumn
                        
    (
                            
    'headshots',
                            
    'Headshots',
                            
    'width=6&align=right'
                        
    ),
                        new 
    TableColumn
                        
    (
                            
    'hpk',
                            
    'HS:K',
                            
    'width=6&align=right'
                        
    ),
                        new 
    TableColumn
                        
    (
                            
    'acc',
                            
    'Accuracy',
                            
    'width=6&align=right&append=' urlencode('%')
                        ),
                        new 
    TableColumn
                        
    (
                            
    'skill',
                            
    'Points',
                            
    'width=7&align=right&skill_change=1'
                        
    ),
                        new 
    TableColumn
                        
    (
                            
    'connection_time',
                            
    'Connection Time',
                            
    'width=10&align=right&type=timestamp'
                        
    )
                    ),
                
    'playerId',
                
    $g_options['rankingtype'],
                
    'kpd',
                
    true
                
    );
            }
            if (
    $rank_type == "0")
            {
                
    $result $db->query
                
    ("
                    SELECT
                        SQL_CALC_FOUND_ROWS
                        hlstats_Players.playerId,
                        hlstats_Players.connection_time,
                                            unhex(replace(hex(hlstats_Players.lastName), 'E280AE', '')) as lastName,
                        hlstats_Players.flag,
                        hlstats_Players.country,
                        hlstats_Players.skill,
                        hlstats_Players.kills,
                        hlstats_Players.deaths,
                        hlstats_Players.last_skill_change,
                        ROUND(hlstats_Players.kills/(IF(hlstats_Players.deaths=0, 1, hlstats_Players.deaths)), 2) AS kpd,
                        hlstats_Players.headshots,
                        ROUND(hlstats_Players.headshots/(IF(hlstats_Players.kills=0, 1, hlstats_Players.kills)), 2) AS hpk,
                        IFNULL(ROUND((hlstats_Players.hits / hlstats_Players.shots * 100), 1), 0) AS acc,
                        activity
                    FROM
                        hlstats_Players
                    WHERE
                        hlstats_Players.game = '
    $game'
                        AND hlstats_Players.hideranking = 0
                        AND hlstats_Players.kills >= 
    $minkills
                    ORDER BY
                        
    $table->sort $table->sortorder,
                        
    $table->sort2 $table->sortorder,
                        hlstats_Players.lastName ASC
                    LIMIT
                        
    $table->startitem,
                        
    $table->numperpage
                "
    );
                
                
    $resultCount $db->query("SELECT FOUND_ROWS()");
                list(
    $numitems) = $db->fetch_row($resultCount);
            }
            else
            {
                if (
    $rank_type == "-1")
                {
                    
    $maxEvent mktime(000date("m"), date("d"), date("Y"));
                    
    $minEvent $maxEvent - (86400 7);
                }
                if (
    $rank_type == "-2")
                {
                    
    $maxEvent mktime(000date("m"), date("d"), date("Y"));
                    
    $minEvent $maxEvent - (86400 30);
                }
                if (!isset(
    $minEvent))
                {
                    
    $minEvent split("-"$dates[$rank_type-1]['eventTime']);
                    
    $minEvent mktime(000$minEvent[1], $minEvent[2], $minEvent[0]);
                    
    $maxEvent $minEvent 86400;
                }
                
    $result $db->query
                
    ("
                    SELECT
                        SQL_CALC_FOUND_ROWS
                        hlstats_Players_History.playerId,
                        hlstats_Players.lastName,
                        hlstats_Players.flag,
                        hlstats_Players.country,
                        SUM(hlstats_Players_History.connection_time) AS connection_time,
                        SUM(hlstats_Players_History.skill_change) AS skill,
                        SUM(hlstats_Players_History.skill_change) AS skill_change,
                        SUM(hlstats_Players_History.skill_change) AS last_skill_change,
                        SUM(hlstats_Players_History.kills) AS kills,
                        SUM(hlstats_Players_History.deaths) AS deaths,
                        ROUND(SUM(hlstats_Players_History.kills) / IF(SUM(hlstats_Players_History.deaths) = 0, 1, SUM(hlstats_Players_History.deaths)), 2) AS kpd,
                        SUM(hlstats_Players_History.headshots) AS headshots,
                        ROUND(SUM(hlstats_Players_History.headshots) / SUM(hlstats_Players_History.kills), 2) AS hpk,
                        IFNULL(ROUND((SUM(hlstats_Players_History.hits) / SUM(hlstats_Players_History.shots) * 100), 1), 0) AS acc,
                        activity
                    FROM
                        hlstats_Players_History
                    INNER JOIN
                        hlstats_Players
                    ON
                        hlstats_Players_History.playerId = hlstats_Players.playerId
                    WHERE
                        hlstats_Players_History.game = '
    $game'
                        AND hlstats_Players.hideranking = 0
                        AND activity > 0
                        AND UNIX_TIMESTAMP(hlstats_Players_History.eventTime) >= 
    $minEvent
                        AND UNIX_TIMESTAMP(hlstats_Players_History.eventTime) <= 
    $maxEvent
                    GROUP BY
                        hlstats_Players_History.playerId
                    HAVING
                        SUM(hlstats_Players_History.kills) >= 
    $minkills
                    ORDER BY
                        
    $table->sort $table->sortorder,
                        
    $table->sort2 $table->sortorder,
                        hlstats_Players.lastName ASC
                    LIMIT
                        
    $table->startitem,
                        
    $table->numperpage
                "
    );
                
    $resultCount $db->query("SELECT FOUND_ROWS()");
                list(
    $numitems) = $db->fetch_row($resultCount);
            }
            
    $table->draw($result$numitems95);
        
    ?><br /><br />
        <div class="subblock">
            <div style="float:left;">
                <form method="get" action="<?php echo $g_options['scripturl']; ?>">
                    <?php                    
                        
    foreach ($_GET as $k=>$v)
                        {
                            
    $v valid_request($v0);
                            if (
    $k != 'minkills')
                            {
                                echo 
    "<input type=\"hidden\" name=\"" htmlspecialchars($k) . "\" value=\"" htmlspecialchars($v) . "\" />\n";
                            }
                        }
                    
    ?>
                    <strong>•</strong> Only show players with
                        <input type="text" name="minkills" size="4" maxlength="2" value="<?php echo $minkills?>" class="textbox" /> or more kills.
                        <input type="submit" value="Apply" class="smallsubmit" />
                </form>
            </div>
            <div style="float:right;">
                Go to: <a href="<?php echo $g_options["scripturl"] . "?mode=clans&amp;game=$game"?>">Clan Rankings</a>
            </div>    
        </div>
    </div>

    Если это сложно, готов стимулировать материально)
     
  5. Se7en_RUS

    Se7en_RUS

    Сообщения:
    53
    Симпатии:
    11
    Если еще актуально, могу попробовать сделать
     
  6. filipok

    filipok

    Сообщения:
    73
    Симпатии:
    8
    Спасибо, уже неактуально. Вопрос уже решил.
     
  7. Monomizer

    Monomizer Мимо пробегал Супер-модератор

    Сообщения:
    1.527
    Симпатии:
    201
    Решил? Сообщи другим, как решил
     
  8. filipok

    filipok

    Сообщения:
    73
    Симпатии:
    8
    В файле class_table.php
    PHP:
                        case 'bargraph':
                            
    $cellbody .= '<img src="' IMAGE_PATH '/bar';
                            if (
    $colval 40)
                                
    $cellbody .= '6';
                            elseif (
    $colval 30)
                                
    $cellbody .= '5';
                            elseif (
    $colval 20)
                                
    $cellbody .= '4';
                            elseif (
    $colval 10)
                                
    $cellbody .= '3';
                            elseif (
    $colval 5)
                                
    $cellbody .= '2';
                            else
                                
    $cellbody .= '1';

                            
    $cellbody .= '.gif" style="width:';
                            if (
    $colval 1)
                                
    $cellbody .= '1';
                            elseif (
    $colval 100)
                                
    $cellbody .= '100';
                            else
                                
    $cellbody .= sprintf("%d"$colval 0.5);

                            
    $cellbody .= "%;\" class=\"bargraph\" alt=\"$colval%\" />";
                            break;
    заменяем на
    PHP:
                        case 'bargraph':
                            
    $colval = ($rowdata['kills'] / $rowdata['deaths'] * $rowdata['kills'] * $rowdata['activity'] *0.01);
                            
    //$colval = (($rowdata[$col->kills]) / ($rowdata[$col->deaths]) * ($rowdata[$col->kills]));
                            
    $cellbody .= '<img src="' IMAGE_PATH '/rank/prog_';
                        
    //    <img src=\"" . IMAGE_PATH . "/t1.gif\" alt=\"".$rowdata['last_skill_change']." Points\" />";
                            
    if ($colval 6000)
                                
    $cellbody .= '6000';
                            elseif (
    $colval 6001)
                                
    $cellbody .= '6000';
                            elseif (
    $colval 5000)
                                
    $cellbody .= '5000';
                            elseif (
    $colval 4000)
                                
    $cellbody .= '4000';
                            elseif (
    $colval 3000)
                                
    $cellbody .= '3000';
                            elseif (
    $colval 2000)
                                
    $cellbody .= '2000';
                            elseif (
    $colval 1000)
                                
    $cellbody .= '1000';
                            elseif (
    $colval 700)
                                
    $cellbody .= '700';
                            elseif (
    $colval 575)
                                
    $cellbody .= '575';
                            elseif (
    $colval 475)
                                
    $cellbody .= '475';
                            elseif (
    $colval 375)
                                
    $cellbody .= '375';
                            elseif (
    $colval 275)
                                
    $cellbody .= '275';
                            elseif (
    $colval 200)
                                
    $cellbody .= '200';
                            elseif (
    $colval 150)
                                
    $cellbody .= '150';
                            elseif (
    $colval 100)
                                
    $cellbody .= '100';
                            elseif (
    $colval 80)
                                
    $cellbody .= '80';
                            elseif (
    $colval 60)
                                
    $cellbody .= '60';
                            elseif (
    $colval 40)
                                
    $cellbody .= '40';
                            elseif (
    $colval 1)
                                
    $cellbody .= '1';
                            else
                                
    $cellbody .= '1';

                            
    $cellbody .= '.png" style="';
                            if (
    $colval 1)
                                
    $cellbody .= '1';
                            elseif (
    $colval 100)
                                
    $cellbody .= '100';
                            else
                                
    $cellbody .= sprintf("%d"$colval 0.5);

                            
    $cellbody .= "%;\" alt=\"$colval%\" />";
                            break;