diff --git a/common.php b/common.php index f392e103..e833c6b6 100644 --- a/common.php +++ b/common.php @@ -28,7 +28,7 @@ session_start(); define('MYAAC', true); define('MYAAC_VERSION', '0.6.5'); -define('DATABASE_VERSION', 15); +define('DATABASE_VERSION', 16); define('TABLE_PREFIX', 'myaac_'); define('START_TIME', microtime(true)); define('MYAAC_OS', (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') ? 'WINDOWS' : (strtoupper(PHP_OS) == 'DARWIN' ? 'MAC' : 'LINUX')); diff --git a/system/libs/usage_statistics.php b/system/libs/usage_statistics.php index e888b064..2b76c841 100644 --- a/system/libs/usage_statistics.php +++ b/system/libs/usage_statistics.php @@ -11,29 +11,27 @@ defined('MYAAC') or die('Direct access not allowed!'); class Usage_Statistics { + private static $report_url = 'http://my-aac.org/report_usage.php'; + public static function report() { - $url = 'http://my-acc.org/report_usage.php'; - //$url = BASE_URL . 'report_usage.php'; - $data = json_encode(self::getStats()); + $options = array( 'http' => array( - 'header' => 'Content-type: application/json', + 'header' => 'Content-type: application/json' . "\r\n" + . 'Content-Length: ' . strlen($data) . "\r\n", 'method' => 'POST', 'content' => $data ) ); $context = stream_context_create($options); - $result = file_get_contents($url, false, $context); - if ($result === false) { - return false; - } - - return true; + $result = file_get_contents(self::$report_url, false, $context); + //var_dump($result); + return $result !== false; } - + public static function getStats() { global $config, $db; diff --git a/system/migrations/16.php b/system/migrations/16.php new file mode 100644 index 00000000..ad0112a2 --- /dev/null +++ b/system/migrations/16.php @@ -0,0 +1,5 @@ +query("ALTER TABLE `" . TABLE_PREFIX . "spells` MODIFY `vocations` VARCHAR(300) NOT NULL DEFAULT '';"); +?> \ No newline at end of file diff --git a/system/pages/spells.php b/system/pages/spells.php index 8e7edda0..a209b15e 100644 --- a/system/pages/spells.php +++ b/system/pages/spells.php @@ -53,7 +53,7 @@ $spells = array(); $spells_db = $db->query('SELECT * FROM `' . TABLE_PREFIX . 'spells` WHERE `hidden` != 1 AND `type` < 3 ORDER BY ' . $order . ', level'); if((string)$vocation_id != 'all') { - foreach($spells_db->fetchAll() as &$spell) { + foreach($spells_db->fetchAll() as $spell) { $spell_vocations = json_decode($spell['vocations'], true); if(in_array($vocation_id, $spell_vocations) || count($spell_vocations) == 0) { $spell['vocations'] = null; @@ -62,7 +62,7 @@ if((string)$vocation_id != 'all') { } } else { - foreach($spells_db->fetchAll() as &$spell) { + foreach($spells_db->fetchAll() as $spell) { $vocations = json_decode($spell['vocations'], true); foreach($vocations as &$tmp_vocation) { @@ -72,7 +72,7 @@ else { $tmp_vocation = 'Unknown'; } - $spell['vocations'] = implode('
', $vocations); + $spell['vocations'] = implode('
', $vocations); $spells[] = $spell; } }