Вопросы, советы, возможные модификации и вообще все про модуль статистики кланов

Модератор: Exinaus, shw

#2469 solen75 12 апр 2012, 01:02
Everything installs fine with ru and clan ID 37 selected in config.php. But if I change that info to

us and 1000002594 for the clan ID.

I get the below when I install, I can still import and the sql structure is created fine.

Warning: Cannot modify header information - headers already sent by (output started at /home/content/42/7027542/html/stat/function/config.php:1) in /home/content/42/7027542/html/stat/install.php on line 110

Warning: Cannot modify header information - headers already sent by (output started at /home/content/42/7027542/html/stat/function/config.php:1) in /home/content/42/7027542/html/stat/install.php on line 111

Warning: Cannot modify header information - headers already sent by (output started at /home/content/42/7027542/html/stat/function/config.php:1) in /home/content/42/7027542/html/stat/install.php on line 112

Warning: Cannot modify header information - headers already sent by (output started at /home/content/42/7027542/html/stat/function/config.php:1) in /home/content/42/7027542/html/stat/install.php on line 113

Warning: Cannot modify header information - headers already sent by (output started at /home/content/42/7027542/html/stat/function/config.php:1) in /home/content/42/7027542/html/stat/install.php on line 114


If I ignore the above and go to the Index.php file it runs the waiting screen for a bit and returns the below info.


Notice: Undefined variable: result in /home/content/42/7027542/html/stat/function/func.php on line 857

Notice: Undefined variable: result in /home/content/42/7027542/html/stat/function/func.php on line 857
Couldn't load this tab. Most likely a problem on the wargaming.net site



I am hoping I am just missing something simple.
#2471 shw 12 апр 2012, 11:03
I don't understand you get an error in
1) install with default settings, module create structure, then change RU->US?
or
2) change settings, and you get an error with install and create structure?

please, kill all sql tables and try again. also try to change in settings curl->mcurl
are you sure about your Clan ID?
#2487 Edrard 12 апр 2012, 14:39
Hi m8

first at all, if u allready install.php needed only for importing database, so if u allready did it, u can delete it.
Another question, are using last version of the script? And pls, can u provide as with link to u stat?
#2521 solen75 15 апр 2012, 03:58
http://www.semperfitanks.com/stat/


If I use the below in the config, it works perfect.

define("SERVER",'ru'); // Server, can be ru, eu, us(Сервер может быть ru, eu, us)
define("CLAN",'37'); //Clan ID(ID Клана) 7188


If I change info to the below, it gives the error on my page.



define("SERVER",'us'); // Server, can be ru, eu, us(Сервер может быть ru, eu, us)
define("CLAN",'1000002594'); //Clan ID(ID Клана) 7188



The error it gives

Notice: Undefined variable: result in /home/content/42/7027542/html/stat/function/func.php on line 857

Notice: Undefined variable: result in /home/content/42/7027542/html/stat/function/func.php on line 857
Couldn't load this tab. Most likely a problem on the wargaming.net site
#2534 Exinaus 16 апр 2012, 15:22
Столкнулся с этой проблемой на другом хостинге. Для русского клана. Вроде есть догадка, 847-я строка, это вот эта функция:

Код: Выделить всё    function get_last_roster()
    {
        global $db;
        $error = 1;
        $players = $db->query("SELECT * FROM players;")->fetchAll();
        if(count($players) > 0){
            $result = $db->query("SELECT * FROM players ORDER BY up DESC ;")->fetch();   
        }else{
            $error = 21; //No entries in MySQL
        }
        $roster['request_data']['items'] = $db->query("SELECT name,id,account_id,role,member_since FROM players WHERE up <= '".$result['up']."' AND up > '".($result['up'] - 100)."' ORDER BY up ASC;")->fetchALL();
        //print_r(restr($roster));
        $new['error'] = &$error;
        $new['data'] = &restr($roster);
        return $new;
    }


857 строка вот:
Код: Выделить всё        $roster['request_data']['items'] = $db->query("SELECT name,id,account_id,role,member_since FROM players WHERE up <= '".$result['up']."' AND up > '".($result['up'] - 100)."' ORDER BY up ASC;")->fetchA


Ситуация такая: установка модуля с ноля, соответственно в базе нет никаких записей, ни об одном пользователе.
Вот если посмотреть принцип работы функции, то получается вот так:
-в $players считывается данные о мэмберах клана, но запуск первый, в бд ничего нет, и после выполнения запроса $players все равно 0.
- идет проверка: if(count($players) > 0), в нашем случае как раз 0, и проверка не срабатывает, и выполняется вот этот код: $error = 21; а переменная $result не задается, т.е. не существует.
- В $roster опять попытка достать данные из БД, но при этом в sql запросе используется $result['up'], который не задан, потому что в предыдущем пункте проверка не прошла. Отсюда и ошибка что переменная $result не задана.

В общем, вот так картина видится ... я не знаю прав я или нет. И непонятно почему на некоторых кланах возникает такая ошибка, а на других - нет.
#2538 Edrard 16 апр 2012, 17:54
Надо в следующей версии дать возможность отключать эту функцию.

We will try to fix this in the next patch.
#2542 Exinaus 16 апр 2012, 19:45
shw писал(а):я уже писал нечто подобное, описывающее ситуацию...
viewtopic.php?f=30&t=1280&start=10#p2489

Да, но в данной ситуации так делать нельзя. Насколько я понимаю код, этот $result['up'] фильтрует по дате обновления информации, т.е. исключенные из клана не обновляются и данные по ним не достаются из базы, хотя в базе они есть. А в предложенном вами решении они тоже достанутся из БД.
Не уверен конечно, в правильности моей догадки, но если я прав, в данном случае подошел бы и простой костыль, временный, в виде:
Код: Выделить всё        }else{
            $error = 21; //No entries in MySQL
            $result['up'] = 99*99;
        }

Хотя тут надо посмотреть что будет. Как поведет себя модуль, если эта функция выдаст нулевой результат. Надо будет проверить ...

ЗЫ Проверил. Работало вроде ... Вот только в БД были кое какие данные, хз, влияет ли это.
#3093 Drak 08 май 2012, 14:58
I am also recieving this error:

Код: Выделить всёNotice: Undefined variable: result in /home3/coreclan/public_html/wotstats/function/func.php on line 857
Couldn't load this tab. Most likely a problem on the wargaming.net site


Site: http://coreclan.net/wotstats/

define("SERVER",'us'); // Server, can be ru, eu, us(? ? ? ru, eu, us)
define("CLAN",'1000002077--SSI-'); //Clan ID(ID ?) 7188

I have also tried

define("SERVER",'us'); // Server, can be ru, eu, us(? ? ? ru, eu, us)
define("CLAN",'1000002077'); //Clan ID(ID ?) 7188

Any help would be greatly appreciated.

Кто сейчас на конференции

Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 42

Реклама | Adv
cron