mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-29 10:49:22 +02:00
* fixed some php fatal error on spells page
* changed spells.vocations field in db size to 300 * please reload your spells after this update!
This commit is contained in:
parent
2b6d65e955
commit
87a3d1e5d1
@ -28,7 +28,7 @@ session_start();
|
|||||||
|
|
||||||
define('MYAAC', true);
|
define('MYAAC', true);
|
||||||
define('MYAAC_VERSION', '0.6.5');
|
define('MYAAC_VERSION', '0.6.5');
|
||||||
define('DATABASE_VERSION', 15);
|
define('DATABASE_VERSION', 16);
|
||||||
define('TABLE_PREFIX', 'myaac_');
|
define('TABLE_PREFIX', 'myaac_');
|
||||||
define('START_TIME', microtime(true));
|
define('START_TIME', microtime(true));
|
||||||
define('MYAAC_OS', (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') ? 'WINDOWS' : (strtoupper(PHP_OS) == 'DARWIN' ? 'MAC' : 'LINUX'));
|
define('MYAAC_OS', (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') ? 'WINDOWS' : (strtoupper(PHP_OS) == 'DARWIN' ? 'MAC' : 'LINUX'));
|
||||||
|
@ -11,27 +11,25 @@
|
|||||||
defined('MYAAC') or die('Direct access not allowed!');
|
defined('MYAAC') or die('Direct access not allowed!');
|
||||||
|
|
||||||
class Usage_Statistics {
|
class Usage_Statistics {
|
||||||
public static function report() {
|
private static $report_url = 'http://my-aac.org/report_usage.php';
|
||||||
$url = 'http://my-acc.org/report_usage.php';
|
|
||||||
//$url = BASE_URL . 'report_usage.php';
|
|
||||||
|
|
||||||
|
public static function report() {
|
||||||
$data = json_encode(self::getStats());
|
$data = json_encode(self::getStats());
|
||||||
|
|
||||||
$options = array(
|
$options = array(
|
||||||
'http' => array(
|
'http' => array(
|
||||||
'header' => 'Content-type: application/json',
|
'header' => 'Content-type: application/json' . "\r\n"
|
||||||
|
. 'Content-Length: ' . strlen($data) . "\r\n",
|
||||||
'method' => 'POST',
|
'method' => 'POST',
|
||||||
'content' => $data
|
'content' => $data
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
$context = stream_context_create($options);
|
$context = stream_context_create($options);
|
||||||
$result = file_get_contents($url, false, $context);
|
$result = file_get_contents(self::$report_url, false, $context);
|
||||||
if ($result === false) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
//var_dump($result);
|
//var_dump($result);
|
||||||
|
return $result !== false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getStats() {
|
public static function getStats() {
|
||||||
|
5
system/migrations/16.php
Normal file
5
system/migrations/16.php
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// change size of spells.vocations
|
||||||
|
$db->query("ALTER TABLE `" . TABLE_PREFIX . "spells` MODIFY `vocations` VARCHAR(300) NOT NULL DEFAULT '';");
|
||||||
|
?>
|
@ -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');
|
$spells_db = $db->query('SELECT * FROM `' . TABLE_PREFIX . 'spells` WHERE `hidden` != 1 AND `type` < 3 ORDER BY ' . $order . ', level');
|
||||||
|
|
||||||
if((string)$vocation_id != 'all') {
|
if((string)$vocation_id != 'all') {
|
||||||
foreach($spells_db->fetchAll() as &$spell) {
|
foreach($spells_db->fetchAll() as $spell) {
|
||||||
$spell_vocations = json_decode($spell['vocations'], true);
|
$spell_vocations = json_decode($spell['vocations'], true);
|
||||||
if(in_array($vocation_id, $spell_vocations) || count($spell_vocations) == 0) {
|
if(in_array($vocation_id, $spell_vocations) || count($spell_vocations) == 0) {
|
||||||
$spell['vocations'] = null;
|
$spell['vocations'] = null;
|
||||||
@ -62,7 +62,7 @@ if((string)$vocation_id != 'all') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
foreach($spells_db->fetchAll() as &$spell) {
|
foreach($spells_db->fetchAll() as $spell) {
|
||||||
$vocations = json_decode($spell['vocations'], true);
|
$vocations = json_decode($spell['vocations'], true);
|
||||||
|
|
||||||
foreach($vocations as &$tmp_vocation) {
|
foreach($vocations as &$tmp_vocation) {
|
||||||
@ -72,7 +72,7 @@ else {
|
|||||||
$tmp_vocation = 'Unknown';
|
$tmp_vocation = 'Unknown';
|
||||||
}
|
}
|
||||||
|
|
||||||
$spell['vocations'] = implode('</br>', $vocations);
|
$spell['vocations'] = implode('<br/>', $vocations);
|
||||||
$spells[] = $spell;
|
$spells[] = $spell;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user