diff --git a/system/functions.php b/system/functions.php index b6d42500..3069e161 100644 --- a/system/functions.php +++ b/system/functions.php @@ -232,7 +232,7 @@ function fetchDatabaseConfig($name, &$value) */ function getDatabaseConfig($name) { - $value = NULL; + $value = null; fetchDatabaseConfig($name, $value); return $value; } diff --git a/system/libs/pot/OTS_Account.php b/system/libs/pot/OTS_Account.php index d32e38ce..37d26356 100644 --- a/system/libs/pot/OTS_Account.php +++ b/system/libs/pot/OTS_Account.php @@ -878,7 +878,7 @@ class OTS_Account extends OTS_Row_DAO implements IteratorAggregate, Countable $access = 0; // finds ranks of all characters - foreach($account as $player) + foreach($this->getPlayersList() as $player) { $rank = $player->getRank(); diff --git a/system/pages/forum.php b/system/pages/forum.php index 08346e04..630de9a1 100644 --- a/system/pages/forum.php +++ b/system/pages/forum.php @@ -472,7 +472,7 @@ if($action == 'new_post') if(count($errors) == 0) { $saved = true; - $db->query("INSERT INTO `" . TABLE_PREFIX . "forum` (`id` ,`first_post` ,`last_post` ,`section` ,`replies` ,`views` ,`author_aid` ,`author_guid` ,`post_text` ,`post_topic` ,`post_smile` ,`post_date` ,`last_edit_aid` ,`edit_date`, `post_ip`) VALUES ('null', '".$thread['id']."', '0', '".$thread['section']."', '0', '0', '".$account_logged->getId()."', '".(int) $char_id."', ".$db->quote($text).", ".$db->quote($post_topic).", '".(int) $smile."', '".time()."', '0', '0', '".$_SERVER['REMOTE_ADDR']."')"); + $db->query("INSERT INTO `" . TABLE_PREFIX . "forum` (`id` ,`first_post` ,`last_post` ,`section` ,`replies` ,`views` ,`author_aid` ,`author_guid` ,`post_text` ,`post_topic` ,`post_smile` ,`post_date` ,`last_edit_aid` ,`edit_date`, `post_ip`) VALUES (NULL, '".$thread['id']."', '0', '".$thread['section']."', '0', '0', '".$account_logged->getId()."', '".(int) $char_id."', ".$db->quote($text).", ".$db->quote($post_topic).", '".(int) $smile."', '".time()."', '0', '0', '".$_SERVER['REMOTE_ADDR']."')"); $db->query("UPDATE `" . TABLE_PREFIX . "forum` SET `replies`=`replies`+1, `last_post`=".time()." WHERE `id` = ".(int) $thread_id); $post_page = $db->query("SELECT COUNT(`" . TABLE_PREFIX . "forum`.`id`) AS posts_count FROM `players`, `" . TABLE_PREFIX . "forum` WHERE `players`.`id` = `" . TABLE_PREFIX . "forum`.`author_guid` AND `" . TABLE_PREFIX . "forum`.`post_date` <= ".time()." AND `" . TABLE_PREFIX . "forum`.`first_post` = ".(int) $thread['id'])->fetch(); $_page = (int) ceil($post_page['posts_count'] / $config['forum_threads_per_page']) - 1;