Skocz do zawartości

Witamy w Nieoficjalnym polskim support'cie AMX Mod X

Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.
  • Rozpoczynaj nowe tematy i odpowiedaj na inne
  • Zapisz się do tematów i for, aby otrzymywać automatyczne uaktualnienia
  • Dodawaj wydarzenia do kalendarza społecznościowego
  • Stwórz swój własny profil i zdobywaj nowych znajomych
  • Zdobywaj nowe doświadczenia

Dołączona grafika Dołączona grafika

Guest Message by DevFuse
 

Zdjęcie

Zombie webstats- błedy w liniach


  • Zamknięty Temat jest zamknięty
2 odpowiedzi w tym temacie

#1 cinek91

    Pomocny

  • Użytkownik

Reputacja: 17
Początkujący

  • Postów:46
  • GG:
  • Lokalizacja:Jarocin
Offline

Napisano 19.04.2010 17:57

Mam następujące problem po instalacji zombie webstats:

[ZP] Stats - ?????????? ???????


Plik - confing.php

<?php $mysql_user = '139_zombiestats'; $mysql_password = '*******'; $mysql_host = 'promania.pl'; $mysql_db = '139_zombiestats'; $lang_file = 'Russian.xml'; $template_dir = 'default'; $players_per_page = 10; $max_inactivity = 5; $min_ammo = 100; $min_online = 240; $pages_for_navigator = 2; $zp_stats_main_link = 'http://www.zombiestats.promania.pl/'; ?>


Plik index.php

<?php

session_start();

include 'inc/config.php';

if (!@mysql_connect($mysql_host, $mysql_user, $mysql_password))
die (mysql_error());
if (!mysql_select_db($mysql_db))
die (mysql_error());

$min_online *= 60;

mysql_query("SET NAMES utf8");

$data = new DOMDocument('UTF-8');
$data->formatOutput = true;

$langs = array();

$lang_dir = opendir('lang');
while($file = readdir($lang_dir))
{
if($file != "." && $file != "..")
{
$lang_ex = explode('.', $file);
if ($lang_ex[count($lang_ex) - 1] == 'xml')
$langs[] = $file;
}
}

closedir($lang_dir);

$lang_count = count($langs);

if ($lang_count == 0)
die('Lang file not found!');

if (!in_array($lang_file, $langs))
$lang_file = $langs[0];

if (isset($_POST['lang']))
{
$lang_num = abs((int)$_POST['lang']);
if ($lang_num <= $lang_count && $lang_num > 0)
$_SESSION['lang'] = $lang_num - 1;
}
if (isset($_SESSION['lang']))
{
$lang_file = $langs[abs((int)$_SESSION['lang'])];
}


$templates = array();
$template_dir_handle = opendir('templates');
while($file = readdir($template_dir_handle))
{
if($file != "." && $file != "..")
{
if (is_dir("templates/$file"))
$templates[] = $file;
}
}
closedir($template_dir_handle);
$templates_count = count($templates);
if ($templates_count == 0)
die('Templates not found!');
if (!in_array($template_dir, $templates))
$template_dir = $templates[0];
if (isset($_POST['template']))
{
$template_num = abs((int)$_POST['template']);
if ($template_num <= $templates_count && $template_num > 0)
$_SESSION['template'] = $template_num - 1;
}
if (isset($_SESSION['template']))
$template_dir = $templates[abs((int)$_SESSION['template'])];

$lang = new DOMDocument('UTF-8');
$lang->load("lang/polish.xml");

$root = $data->appendChild($data->createElement('root'));
$node = $data->importNode($lang->documentElement, true);
$root->appendChild($node);

$root->appendChild($data->createElement('main_link', $zp_stats_main_link));

$chooselang_node = $data->createElement('chooselang');
$chooselang = $root->appendChild($chooselang_node);
for ($i = 0; $i < $lang_count; $i++)
{
$lang_name = substr($langs[$i], 0, strrpos($langs[$i], '.'));
$langElement = $data->createElement('lang', $lang_name);
if ($langs[$i] == $lang_file)
$langElement->setAttribute('current', 1);
$chooselang->appendChild($langElement);
}

$templates_node = $data->createElement('templates');
$templates_element = $root->appendChild($templates_node);
for ($i = 0; $i < $templates_count; $i++)
{
$tempElement = $data->createElement('template', $templates[$i]);
if ($templates[$i] == $template_dir)
$tempElement->setAttribute('current', 1);
$templates_element->appendChild($tempElement);
}

$action = isset($_GET['action']) ? $_GET['action'] : '';

switch($action)
{
case 'maps':
include 'inc/maps.php';
break;
case 'player':
include 'inc/player.php';
break;
case 'weapons':
include 'inc/weapons.php';
break;
case 'classes':
include 'inc/classes.php';
break;
case 'graph':
$template = "graph.xsl";
break;
case 'graph_img':
include 'inc/graph.php';
break;

default:
$action = 'index';
include 'inc/index.php';
}

if (isset($template))
{
$title = $lang->getElementsByTagName("title_$action")->item(0)->nodeValue;
$root->appendChild($data->createElement('title', $title));

$root->appendChild($data->createElement('request_uri', htmlentities($_SERVER['REQUEST_URI'])));

$root->appendChild($data->createElement('template', $template_dir));

$xsl = new DOMDocument('UTF-8');
$xsl->load("templates/$template_dir/main.xsl");

$import = $xsl->getElementsByTagName('import')->item(0);
$import->setAttribute('href', $template);

//echo $xsl->saveXML();

$proc = new XSLTProcessor();
$proc->importStyleSheet($xsl);
echo $proc->transformToXML($data);

//echo $data->saveXML();
}

?>



źródło skąd instalowałem - [ZP] Addon: Web Stats v0.2.5 - AlliedModders

Gdzie poprawić?
  • +
  • -
  • 0

#2 Lukasz5

    Godlike

  • Power User

Reputacja: 280
Wszechwidzący

  • Postów:1 414
  • Imię:Łukasz
  • Lokalizacja:C: / WINDOWS
Offline

Napisano 19.04.2010 19:05

Ta twoja strona po rusku jest trzeba na polski ustawiać...
W index.php linie 54, 55 i 76...

Użytkownik Lukasz5 edytował ten post 19.04.2010 19:05

  • +
  • -
  • 0

#3 cinek91

    Pomocny

  • Autor tematu
  • Użytkownik

Reputacja: 17
Początkujący

  • Postów:46
  • GG:
  • Lokalizacja:Jarocin
Offline

Napisano 20.04.2010 12:11

tutaj rozchodzi się o te linie:

$total = mysql_result($r, 0);
mysql_free_result($r);


oraz

while ($row = mysql_fetch_assoc($r))


ja tu widze jedną rzecz wspólna - $r ?

Jezyk na stronie można zmieniać więc to nie od tego chyba ;]
  • +
  • -
  • 0




Użytkownicy przeglądający ten temat: 0

0 użytkowników, 0 gości, 0 anonimowych