 |
Рейтинг: Дом Пробудившихся (между склонностями) |
 |
 |
Рейтинги
Обновление рейтингов ежесуточное.
Недельный рейтинг обнуляется каждое воскресенье.
heroesList = $this->loadHeroesList($sPath);
$this->heroesList_old = $this->loadHeroesList($sPath_old);
$this->heroesList_week = $this->loadHeroesList($sPath_week);
}
function loadHeroesList($sPath){
$rf="";
@$handle = fopen ($sPath, "r");
if( ! @$handle ) {
return $this->Error=1;
} else {
while (!feof ($handle)) {
$rf .= fgets($handle, 4096);
}
fclose ($handle);
$HeroesList = explode("\n",$rf);
}
return $HeroesList;
}
function pageQuantity(){
$this->pageQuantity = count($this->heroesList)/100;
$this->pageQuantity = (integer)$this->pageQuantity;
$quan='';
if (@$_POST['quan']==null)
$tmp2 = 1;
else
$tmp2 = $_POST['quan'];
for ($i=1;$i<=$this->pageQuantity;$i++){
$num = $i;
if ($tmp2==$i)
$num = "".$num."";
$quan .= "$num ";
}
if ($this->pageQuantity>1)
$sQuan = " |
Страницы: $quan
|
";
else
$sQuan = "";
return $sQuan;
}
function currentHeroRatingByNum($nNum,$heroesList){
return $curhero = explode("|",$heroesList[$nNum]);
}
function currentHeroRatingById($nId,$heroesList){
$nNum = 0;
$count_heroesList=count($heroesList);
do{
$curhero = explode("|",$heroesList[$nNum]);
$nNum++;
}while($curhero[0]!=$nId && $nNum< $count_heroesList);
$curhero[3] = $nNum-1;
return $curhero;
}
function compareHeroes($nId){
$curhero = $this->currentHeroRatingById($nId,$this->heroesList);
$curhero_old = $this->currentHeroRatingById($nId,$this->heroesList_old);
$curhero_week = $this->currentHeroRatingById($nId,$this->heroesList_week);
if(@$curhero_old[1]!=0){
@$this->comparedHero[0] = $curhero[1]>$curhero_old[1] ?
'+'.($curhero[1]-$curhero_old[1]) : ''.($curhero[1]-$curhero_old[1]);
}else
@$this->comparedHero[0] = 0;
if(@$curhero_week[1]!=0){
@$this->comparedHero[2] = $curhero[1]>$curhero_week[1] ?
'+'.($curhero[1]-$curhero_week[1]) : ''.($curhero[1]-$curhero_week[1]);
}else{
@$this->comparedHero[2] = 0;
}
if(@$curhero_old[3]!=count($this->heroesList_old)-1){
@$this->comparedHero[1] = $curhero[3]>$curhero_old[3] ?
$curhero_old[3]-$curhero[3] : $curhero_old[3]-$curhero[3];
}else
@$this->comparedHero[1] = -1001;
if(@$curhero_week[3]!=count($this->heroesList_week)-1){
@$this->comparedHero[3] = $curhero[3]>$curhero_week[3] ?
$curhero_week[3]-$curhero[3] : $curhero_week[3]-$curhero[3];
}else{
@$this->comparedHero[3] = -1001;
}
return $this->comparedHero;
}
function setArrowPic(){
$sArrows = "";
if ($this->comparedHero[1]==-1001)
$sArrows .= "
| {$this->comparedHero[0]} | ";
elseif ($this->comparedHero[1]>0)
$sArrows .= "![+{$this->comparedHero[1]}](http://www.news.ereality.ru/tip/rat/img/plus.gif)
+{$this->comparedHero[1]} | {$this->comparedHero[0]} | ";
elseif ($this->comparedHero[1]==0)
$sArrows .= " | {$this->comparedHero[0]} | ";
elseif ($this->comparedHero[1]<0)
$sArrows .= "![{$this->comparedHero[1]}](http://www.news.ereality.ru/tip/rat/img/minus.gif)
{$this->comparedHero[1]} | {$this->comparedHero[0]} | ";
$sArrows .= "";
if ($this->comparedHero[3]==-1001)
$sArrows .= " | | {$this->comparedHero[2]} | ";
elseif ($this->comparedHero[3]>0)
$sArrows .= "![+{$this->comparedHero[3]}](http://www.news.ereality.ru/tip/rat/img/plus.gif)
+{$this->comparedHero[3]} | {$this->comparedHero[2]} | ";
elseif ($this->comparedHero[3]==0)
$sArrows .= " | {$this->comparedHero[2]} | ";
elseif ($this->comparedHero[3]<0)
$sArrows .= "![{$this->comparedHero[3]}](http://www.news.ereality.ru/tip/rat/img/minus.gif)
{$this->comparedHero[3]} | {$this->comparedHero[2]} | ";
return $sArrows;
}
function insertName($nId){
switch ($nId){
case 2: return 'Усганоли Хоунихи | Игнесс';
break;
case 3: return 'Кэна ка Кхотсо | Раанор';
break;
case 4: return 'Тер***-о-Бисса | Тарбис';
break;
case 5: return 'Тала Иголиига | Витарра';
break;
case 6: return 'Аскиру Чуратай | Дримнир';
break;
}
}
function insertTableHead(){
@$pagenum = $_POST['quan'];
echo "
 |
 |
 |
 |