mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-26 17:29:21 +02:00
* fixed forum new post on mac os and some specific mysql versions
* fixed Account::getGuildAccess function
This commit is contained in:
parent
9aed09d250
commit
d95aea319e
@ -232,7 +232,7 @@ function fetchDatabaseConfig($name, &$value)
|
|||||||
*/
|
*/
|
||||||
function getDatabaseConfig($name)
|
function getDatabaseConfig($name)
|
||||||
{
|
{
|
||||||
$value = NULL;
|
$value = null;
|
||||||
fetchDatabaseConfig($name, $value);
|
fetchDatabaseConfig($name, $value);
|
||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
|
@ -878,7 +878,7 @@ class OTS_Account extends OTS_Row_DAO implements IteratorAggregate, Countable
|
|||||||
$access = 0;
|
$access = 0;
|
||||||
|
|
||||||
// finds ranks of all characters
|
// finds ranks of all characters
|
||||||
foreach($account as $player)
|
foreach($this->getPlayersList() as $player)
|
||||||
{
|
{
|
||||||
$rank = $player->getRank();
|
$rank = $player->getRank();
|
||||||
|
|
||||||
|
@ -472,7 +472,7 @@ if($action == 'new_post')
|
|||||||
if(count($errors) == 0)
|
if(count($errors) == 0)
|
||||||
{
|
{
|
||||||
$saved = true;
|
$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);
|
$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();
|
$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;
|
$_page = (int) ceil($post_page['posts_count'] / $config['forum_threads_per_page']) - 1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user