Файл: ewar/cronjobs/arena_and_duel_opponents_update.php
Строк: 47
<?php
# */10 * * * * /usr/bin/wget -q -O /dev/null http://ewar.mobi/cronjobs/arena_and_duel_opponents_update.php
include("../includes/config.php");
$query = mysql_query("SELECT `id`, `str`, `vit`, `agi`, `def`, `duel_rating` FROM `vartotojai`");
$arena_and_duel_opponents = array();
while($row = mysql_fetch_assoc($query)) {
$sum = $row['str'] + $row['vit'] + $row['agi'] + $row['def'];
$arena_and_duel_opponents[] = array($row['id'], $sum, $row['duel_rating']);
deletecache('arena_opponents'.$row['id']);
deletecache('duel_opponents'.$row['id']);
}
$arena_and_duel_opponents = json_encode($arena_and_duel_opponents);
writecache('arena_and_duel_opponents', $arena_and_duel_opponents);
if (isset($_GET['k'])) {
if (isset($_SERVER['HTTP_REFERER'])) {
header("Location: ".$_SERVER['HTTP_REFERER']."");
}
else
{
header("Location: ../index.php");
}
}
?>