Somebody have statistics code like this???
This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.
-
-
It will be build in time on version 2.0You can contact me by Discord or Telegram
Discord Galactic Conquest
Video Youtube dev + tutorials
Webside -
You have old code for this ?
-
Source Code
- {block name="title" prepend}{$LNG.lm_statistics}{/block}
- {block name="content"}
- <div id="page">
- <div id="content">
- <div id="ally_content" class="conteiner">
- <div class="gray_stripe">
- {$LNG.st_statistics} ({$LNG.st_updated}: {$stat_date}) {$LNG.st_next}: <span style="color:#FC0"><b id=brpstats></b></span>
- </div>
- <form name="stats" id="stats" method="post" action="">
- <table class="tablesorter ally_ranks">
- <tr>
- <td>
- <label for="who">{$LNG.st_show}</label> <select name="who" id="who" onchange="$('#stats').submit();">{html_options options=$Selectors.who selected=$who}</select>
- </td>
- <td>
- <label for="type">{$LNG.st_per}</label> <select name="type" id="type" onchange="$('#stats').submit();">{html_options options=$Selectors.type selected=$type}</select>
- </td>
- <td>
- <label for="range">{$LNG.st_in_the_positions}</label> <select name="range" id="range" onchange="$('#stats').submit();">{html_options options=$Selectors.range selected=$range}</select>
- </td>
- </tr>
- </table>
- </form>
- <table class="table519">
- {if $who == 1}
- {include file="shared.statistics.playerTable.tpl"}
- {elseif $who == 2}
- {include file="shared.statistics.allianceTable.tpl"}
- {/if}
- </table>
- <script type=text/javascript>
- v = new Date();
- var brpstats = document.getElementById('brpstats');
- function tstats(){
- n = new Date();
- ss = {$st_out};
- s = ss - Math.round( (n.getTime() - v.getTime()) / 1000.);
- m = 0;
- h = 0;
- d = 0;
- if ( s < 0 ) {
- var zeit = new Date();
- var ende = zeit.getTime();
- ende = ende + 100;
- function countdown() {
- var zeit2 = new Date();
- var jetzt = zeit2.getTime();
- if(jetzt >= ende) {
- brpstats.innerHTML = '<blink><b><font color=red>...</font></b></blink>';
- }
- }
- setInterval(countdown, 1000);
- } else
- {
- if ( s > 59 ) { m = Math.floor( s / 60 ); s = s - m * 60; }
- if ( m > 59 ) { h = Math.floor( m / 60 ); m = m - h * 60; }
- if ( h > 24 ) { d = Math.floor( h / 24 ); h = h - d * 24; }
- if ( s < 10 ) { s = '0' + s }
- if ( m < 10 ) { m = '0' + m }
- if ( h < 10 ) { h = '' + h }
- if ( s >= 0 ) { s = s + 's' }
- if ( m > 0 ) { m = m + 'm' } else m = '';
- if ( m == 0 && h > 0 ) { m = '0' + m + 'm'}
- if ( h > 0 ) { h = h + '??' } else h = '';
- if ( d > 0 ) { d = d + '??' } else d = '';
- brpstats.innerHTML = ' <b><font>' + d + ' ' + h + ' ' + m + ' ' + s + '</font></b>';
- }
- window.setTimeout('tstats();',999);
- }
- window.onload=tstats();
- </script>
- {/block}
-
Source Code
- {block name="title" prepend}{$LNG.lm_statistics}{/block}
- {block name="content"}
- <div id="content">
- <div id="ally_content" class="conteiner">
- <table style="width:680px;">
- <div class="gray_stripe">
- <th colspan="4">Top 30 Votings</th>
- </div>
- <tr>
- <th colspan="4"><center><a href='./game.php?page=statistics' style="color:red">Back to Player Statistic</a></center></th>
- </tr>
- <tr>
- <td colspan="4">Best Voters for ZyperaxGalaxy<br>
- Top 3 will respectivly receive 150k, 100k & 50k DM at the end of the month</td>
- </tr>
- <tr style="height:23px;">
- <td style="width:80px"><strong style="color:orange;">Ranking</strong></td>
- <td style="width:250px"><strong style="color:orange;">Players</strong></td>
- <td><strong style="color:orange;">Amount of votes</strong></td>
- </tr>
- {foreach from=$voturile key=k item=v}
- <tr>
- <td style="height:40px;">{$v.rank}</td>
- <td><a href="#" onclick="return Dialog.Playercard({$v.id}" {if $v.id == $id_users} style="color:lime"{/if}>{$v.username}</a></td>
- <td>{$v.vcount}</td>
- </tr>
- {/foreach}
- </table>
- {/block}
-
Source Code
- class ShowStatisticsPage extends AbstractPage
- {
- public static $requireModule = MODULE_STATISTICS;
- function __construct()
- {
- parent::__construct();
- }
- function show()
- {
- global $USER, $CONF, $LNG, $UNI;
- $who = HTTP::_GP('who', 1);
- $type = HTTP::_GP('type', 1);
- $range = HTTP::_GP('range', 1);
- $CurrentUserPoints = $GLOBALS['DATABASE']->uniquequery("SELECT *FROM ".STATPOINTS." where `id_owner` = ".$USER['id']." and `stat_type` = '1';");
- switch ($type)
- {
- case 2:
- $Order = "fleet_rank";
- $Points = "fleet_points";
- $Rank = "fleet_rank";
- $OldRank = "fleet_old_rank";
- break;
- case 3:
- $Order = "tech_rank";
- $Points = "tech_points";
- $Rank = "tech_rank";
- $OldRank = "tech_old_rank";
- break;
- case 4:
- $Order = "build_rank";
- $Points = "build_points";
- $Rank = "build_rank";
- $OldRank = "build_old_rank";
- break;
- case 5:
- $Order = "defs_rank";
- $Points = "defs_points";
- $Rank = "defs_rank";
- $OldRank = "defs_old_rank";
- break;
- case 6:
- $Order = "ach_rank";
- $Points = "ach_points";
- $Rank = "ach_rank";
- $OldRank = "ach_old_rank";
- break;
- default:
- $Order = "total_rank";
- $Points = "total_points";
- $Rank = "total_rank";
- $OldRank = "total_old_rank";
- break;
- }
- $RangeList = array();
- switch($who)
- {
- case 1:
- $MaxUsers = Config::get('users_amount');
- $range = min($range, $MaxUsers);
- $LastPage = max(1, ceil($MaxUsers / 100));
- for ($Page = 0; $Page < $LastPage; $Page++)
- {
- $PageValue = ($Page * 100) + 1;
- $PageRange = $PageValue + 99;
- $Selector['range'][$PageValue] = $PageValue."-".$PageRange;
- }
- $start = max(floor(($range - 1) / 100) * 100, 0);
- $stats_sql = 'SELECT DISTINCT s.*, u.id, u.race, u.username,u.urlaubs_modus, u.ally_id,u.bana,u.banaday,u.onlinetime,a.fraction,a.FraLevel, a.ally_name FROM '.STATPOINTS.' as s
- INNER JOIN '.USERS.' as u ON u.id = s.id_owner
- LEFT JOIN '.ALLIANCE.' as a ON a.id = s.id_ally
- WHERE s.`universe` = '.$UNI.' AND s.`stat_type` = 1 '.((Config::get('stat') == 2)?'AND u.`authlevel` < '.Config::get('stat_level').' ':'').'
- ORDER BY `'. $Order .'` ASC LIMIT '. $start .',100;';
- $query = $GLOBALS['DATABASE']->query($stats_sql);
- $RangeList = array();
- $fraction = $GLOBALS['DATABASE']->getFirstCell("SELECT fraction FROM ".ALLIANCE." WHERE id = ".$USER['ally_id'].";");
- $fra1 = '<img src="styles/images/alliance/fraction_'.$fraction.'.png" alt="1" width="19" height="18">';
- while ($StatRow = $GLOBALS['DATABASE']->fetch_array($query))
- {
- $isFriend = $GLOBALS['DATABASE']->getFirstCell("SELECT COUNT(*) FROM ".BUDDY." WHERE (sender = ".$USER['id']." AND owner = ".$StatRow['id']." ) OR (sender = ".$StatRow['id']." AND owner = ".$USER['id'].");");
- $isEnnemie = $GLOBALS['DATABASE']->getFirstCell("SELECT COUNT(*) FROM uni1_ennemies WHERE sender = ".$USER['id']." AND owner = ".$StatRow['id'].";");
- $Noob = CheckNoobProtec($CurrentUserPoints,$StatRow,$StatRow);
- if(empty($Noob['NoobPlayer']) && empty($Noob['StrongPlayer'])){
- $isNoob = 0;
- }else{
- if($Noob['NoobPlayer'] )
- $isNoob = 1;
- elseif($Noob['StrongPlayer'])
- $isNoob = 2;
- }
- $RangeList[] = array(
- 'id' => $StatRow['id'],
- 'name' => $StatRow['username'],
- 'race' => $StatRow['race'],
- 'points' => pretty_number($StatRow[$Points]),
- 'fraction2' => $fraction,
- 'allyid' => $StatRow['ally_id'],
- 'level' => $StatRow['FraLevel'],
- 'fraction' => $StatRow['fraction'] ? $fra1 : '',
- 'rank' => $StatRow[$Rank],
- 'allyname' => $StatRow['ally_name'],
- 'ranking' => $StatRow[$OldRank] - $StatRow[$Rank],
- 'isFriend' => $isFriend,
- 'isEnnemie' => $isEnnemie,
- 'isnoob' => $isNoob,
- 'isVac' => ($StatRow['urlaubs_modus'] == 1) ? 0 : 1,
- 'isInac' => ($StatRow['onlinetime'] < TIMESTAMP - 7 * 24 * 60 * 60) ? 0 : 1,
- );
- }
- $GLOBALS['DATABASE']->free_result($query);
- break;
- case 2:
- $MaxAllys = $GLOBALS['DATABASE']->getFirstCell("SELECT COUNT(*) FROM ".ALLIANCE." WHERE `ally_universe` = '".$UNI."';");
- $range = min($range, $MaxAllys);
- $LastPage = max(1, ceil($MaxAllys / 100));
- for ($Page = 0; $Page < $LastPage; $Page++)
- {
- $PageValue = ($Page * 100) + 1;
- $PageRange = $PageValue + 99;
- $Selector['range'][$PageValue] = $PageValue."-".$PageRange;
- }
- $start = max(floor(($range - 1) / 100) * 100, 0);
- $stats_sql = 'SELECT DISTINCT s.*, a.id, a.ally_members, a.ally_name FROM '.STATPOINTS.' as s
- INNER JOIN '.ALLIANCE.' as a ON a.id = s.id_owner
- WHERE `universe` = '.$UNI.' AND `stat_type` = 2
- ORDER BY `'. $Order .'` ASC LIMIT '. $start .',100;';
- $query = $GLOBALS['DATABASE']->query($stats_sql);
- while ($StatRow = $GLOBALS['DATABASE']->fetch_array($query))
- {
- $isWar = $GLOBALS['DATABASE']->getFirstCell("SELECT COUNT(*) FROM ".DIPLO." WHERE (owner_1 = ".$USER['ally_id']." AND owner_2 = ".$StatRow['id'].") OR (owner_1 = ".$StatRow['id']." AND owner_2 = ".$USER['ally_id'].") AND accept = '1' AND level = '5';");
- $isUnion = $GLOBALS['DATABASE']->getFirstCell("SELECT COUNT(*) FROM ".DIPLO." WHERE (owner_1 = ".$USER['ally_id']." AND owner_2 = ".$StatRow['id'].") OR (owner_1 = ".$StatRow['id']." AND owner_2 = ".$USER['ally_id'].") AND accept = '1' AND level = '2';");
- $RangeList[] = array(
- 'id' => $StatRow['id'],
- 'name' => $StatRow['ally_name'],
- 'members' => $StatRow['ally_members'],
- 'rank' => $StatRow[$Rank],
- 'mppoints' => pretty_number(floor($StatRow[$Points] / $StatRow['ally_members'])),
- 'points' => pretty_number($StatRow[$Points]),
- 'ranking' => $StatRow[$OldRank] - $StatRow[$Rank],
- 'isWar' => $isWar,
- 'isUnion' => $isUnion,
- );
- }
- $GLOBALS['DATABASE']->free_result($query);
- break;
- }
- $Selector['who'] = array(1 => $LNG['st_player'], 2 => $LNG['st_alliance']);
- $Selector['type'] = array(1 => $LNG['st_points'], 2 => $LNG['st_fleets'], 3 => $LNG['st_researh'], 4 => $LNG['st_buildings'], 5 => $LNG['st_defenses'], 6 => 'Achievements');
- $statkai = $GLOBALS['DATABASE']->uniquequery("SELECT nextTime FROM ".CRONJOBS." WHERE cronjobID = 2;");
- $this->tplObj->loadscript("jquery.countdown.js");
- $this->tplObj->assign_vars(array(
- 'Selectors' => $Selector,
- 'who' => $who,
- 'type' => $type,
- 'range' => floor(($range - 1) / 100) * 100 + 1,
- 'RangeList' => $RangeList,
- 'CUser_ally' => $USER['ally_id'],
- 'CUser_id' => $USER['id'],
- 'stat_date' => _date($LNG['php_tdformat'], Config::get('stat_last_update'), $USER['timezone']),
- 'st_out' => $statkai['nextTime'] - TIMESTAMP,
- ));
- $this->display('page.statistics.default.tpl');
- }
- }
-
-
i see here statistics from xterium
-
link?
-
xterium.space
-
florin21 wrote:
i see here statistics from xterium
The post was edited 1 time, last by zombi87 ().
-
I presume this is old stats vs new stats, correct me if wrong.
At my view this sould be pretty simple to do through class.statbuilder adding new column like tech_points_old after tech and store old points on database through Database->update command.
then on class.ShowStatisticsPage you just do $smth['points'] - $smth['points_old'] [since statspage runs through cases and each case has it's vars defined]
and to finish on shared.player.stats you add {if ($RangeInfo.points - $RangeInfo.old_points < 0}<font color="red">{$Rangeinfo.diff}</font>{else}<font color="lime">...{/if}
Pretty simple. -
sorrt this old 1.7.3....he/she asked for older script so i posted it
-
Russoll wrote:
sorrt this old 1.7.3....he/she asked for older script so i posted it
My bad -
Qwa wrote:
I presume this is old stats vs new stats, correct me if wrong.
At my view this sould be pretty simple to do through class.statbuilder adding new column like tech_points_old after tech and store old points on database through Database->update command.
then on class.ShowStatisticsPage you just do $smth['points'] - $smth['points_old'] [since statspage runs through cases and each case has it's vars defined]
and to finish on shared.player.stats you add {if ($RangeInfo.points - $RangeInfo.old_points < 0}<font color="red">{$Rangeinfo.diff}</font>{else}<font color="lime">...{/if}
Pretty simple.
I using xterium version ,you have the complete code?
thanks -
the code i posted is for xterium
-
Russoll wrote:
the code i posted is for xterium
I try but get some error -
this needs alot of editing to work with the xterium version
-
Somebody can help please
-
Qwa wrote:
I presume this is old stats vs new stats, correct me if wrong.
At my view this sould be pretty simple to do through class.statbuilder adding new column like tech_points_old after tech and store old points on database through Database->update command.
then on class.ShowStatisticsPage you just do $smth['points'] - $smth['points_old'] [since statspage runs through cases and each case has it's vars defined]
and to finish on shared.player.stats you add {if ($RangeInfo.points - $RangeInfo.old_points < 0}<font color="red">{$Rangeinfo.diff}</font>{else}<font color="lime">...{/if}
Pretty simple.
-
Share
- Facebook 0
- Twitter 0
- Google Plus 0
- Reddit 0