From 89a775c23f37bbd12a38a45842ed8876fc055079 Mon Sep 17 00:00:00 2001 From: Stefan Brannfjell Date: Mon, 1 Sep 2014 22:44:44 +0200 Subject: [PATCH] Fix #152 Added forum config; Allow thread bumping (true/false). --- LUA/TFS_10/talkaction shopsystem/znoteshop.lua | 2 +- config.php | 3 ++- forum.php | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/LUA/TFS_10/talkaction shopsystem/znoteshop.lua b/LUA/TFS_10/talkaction shopsystem/znoteshop.lua index 3841348..518fc03 100644 --- a/LUA/TFS_10/talkaction shopsystem/znoteshop.lua +++ b/LUA/TFS_10/talkaction shopsystem/znoteshop.lua @@ -1,4 +1,4 @@ --- Znote Shop v1.0 for Znote AAC on TFS 0.2.13+ Mystic Spirit. +-- Znote Shop v1.0 for Znote AAC on TFS 1.0+. function onSay(cid, words, param) local storage = 54073 -- Make sure to select non-used storage. This is used to prevent SQL load attacks. local cooldown = 15 -- in seconds. diff --git a/config.php b/config.php index 1033c5f..2d6c843 100644 --- a/config.php +++ b/config.php @@ -232,7 +232,7 @@ $config['level'] = 8; $config['health'] = 185; - $config['mana'] = 35; + $config['mana'] = 40; $config['cap'] = 470; $config['soul'] = 100; @@ -348,6 +348,7 @@ 'level' => 5, 'cooldownPost' => 1,//60, 'cooldownCreate' => 1,//180, + 'newPostsBumpThreads' => true, 'hidden' => '[H]', 'closed' => '[C]', 'sticky' => '[S]', diff --git a/forum.php b/forum.php index 9888ee3..c5e02f7 100644 --- a/forum.php +++ b/forum.php @@ -369,6 +369,7 @@ if (!empty($_GET)) { if ($access) { mysql_insert("INSERT INTO `znote_forum_posts` (`thread_id`, `player_id`, `player_name`, `text`, `created`, `updated`) VALUES ('$reply_thread', '$reply_cid', '". $charData[$reply_cid]['name'] ."', '$reply_text', '". time() ."', '". time() ."');"); + if ($config['forum']['newPostsBumpThreads']) mysql_update("UPDATE `znote_forum_threads` SET `updated`='". time() ."' WHERE `id`='$reply_thread';"); } else echo '

You don\'t have permission to post on this thread. [Thread: Closed]

'; } else { ?> @@ -434,7 +435,7 @@ if (!empty($_GET)) { //if ($thread === false) $access = false; if ($access) { - mysql_update("UPDATE `znote_forum_posts` SET `text`='$update_post_text' WHERE `id`='$update_post_id';"); + mysql_update("UPDATE `znote_forum_posts` SET `text`='$update_post_text', `updated`='". time() ."' WHERE `id`='$update_post_id';"); echo '

post has been updated.

'; } else echo "

Your permission to edit this post has been denied.

"; }