Chciałbym przerobić a właściwie wyciągnąć pewne informacje ze skryptu psychostats
chodzi dokładnie o te : http://tower.org.pl/rank/weapons.php
"27 broni zabilo 10,073,226 gracz i zadalo 1,451,043,360 Obrazen" czyli te wszystkie liczby np. na stronę główną.
Jeśli jest ktoś zainteresowany zrobieniem tego tutaj jest skrypt : http://www.psychostats.com/downloads/ .
W pliku weapons.php jest $totaldamage, $totalkills ale nie mam pojęcia jak przenieść to do innego pliku.
<?php /** * This file is part of PsychoStats. * * Written by Jason Morriss <stormtrooper@psychostats.com> * Copyright 2008 Jason Morriss * * PsychoStats is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * PsychoStats is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with PsychoStats. If not, see <http://www.gnu.org/licenses/>. * * Version: $Id: weapons.php 385 2008-04-14 00:57:23Z lifo $ */ $cms->init_theme($ps->conf['main']['theme'], $ps->conf['theme']); $ps->theme_setup($cms->theme); $cms->theme->page_title('PsychoStats - Weapon Usage'); // change this if you want the default sort of the player listing to be something else like 'kills' $DEFAULT_SORT = 'kills'; $cms->theme->assign_request_vars($validfields, true); $start = 0; $limit = 100; 'sort' => $sort, 'order' => $order, 'start' => $start, 'limit' => $limit, )); // calculate some extra percentages for each weapon and determine max values foreach ($keys as $k) { if ($stats[$k]) { } if ($weapons[$i][$k] > $max[$k]) $max[$k] = $weapons[$i][$k]; } } // calculate scale width of pct's based on max $scale = 200; $ofs = $scale; // + 40; foreach ($keys as $k) { if ($max[$k] == 0) { } else { } } } if ($xml) { foreach ($weapons as $w) { $ary[ $w['uniqueid'] ] = $w; } print_xml($ary); } // organize the weapons by 'class' foreach ($weapons as $w) { $weaponclasses[$class][] = $w; } // build a dynamic table that plugins can use to add custom columns of data $table = $cms->new_table($weapons); $table->if_no_data($cms->trans("No Weapons Found")); $table->attr('class', 'ps-table ps-weapon-table'); $table->start_and_sort($start, $sort, $order); 'headshotkills' => array( 'label' => $cms->trans("HS"), 'modifier' => 'commify', 'tooltip' => $cms->trans("Headshot Kills") ), 'headshotkillspct' => array( 'label' => $cms->trans("HS%"), 'modifier' => '%s%%', 'tooltip' => $cms->trans("Headshot Kills Percentage") ), 'ffkills' => array( 'label' => $cms->trans("FF"), 'modifier' => 'commify', 'tooltip' => $cms->trans("Friendly Fire Kills") ), 'ffkillspct' => array( 'label' => $cms->trans("FF%"), 'modifier' => '%s%%', 'tooltip' => $cms->trans("Friendly Fire Kills Percentage") ), 'accuracy' => array( 'label' => $cms->trans("Acc"), 'modifier' => '%s%%', 'tooltip' => $cms->trans("Accuracy") ), 'shotsperkill' => array( 'label' => $cms->trans("S:K"), 'tooltip' => $cms->trans("Shots Per Kill") ), 'damage' => array( 'label' => $cms->trans("Dmg"), 'modifier' => 'abbrnum0', 'tooltip' => $cms->trans("Damage") ), )); $table->column_attr('uniqueid', 'class', 'first'); $ps->weapons_table_mod($table); $cms->filter('weapons_table_object', $table); // assign variables to the theme 'weapons_by_class' => $weaponclasses, // allow a theme to use either ... 'weapons' => $weapons, // ... way to display weapons 'weapons_table' => $table->render(), 'totalweapons' => $totalweapons, 'totalkills' => $stats['kills'], 'totaldamage' => $stats['damage'], )); // display the output //$cms->theme->add_css('css/tabs.css'); $cms->full_page($basename, $basename, $basename.'_header', $basename.'_footer'); ?>
To forum nie raz mi pomagało więc mam nadzieję, że teraz też ktoś będzie wiedział o co chodzi i mi pomoże.
Pozdrawiam