Fix #152 Added forum config; Allow thread bumping (true/false).

This commit is contained in:
Stefan Brannfjell 2014-09-01 22:44:44 +02:00
parent 5e21a2b8a9
commit 89a775c23f
3 changed files with 5 additions and 3 deletions

View File

@ -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) function onSay(cid, words, param)
local storage = 54073 -- Make sure to select non-used storage. This is used to prevent SQL load attacks. local storage = 54073 -- Make sure to select non-used storage. This is used to prevent SQL load attacks.
local cooldown = 15 -- in seconds. local cooldown = 15 -- in seconds.

View File

@ -232,7 +232,7 @@
$config['level'] = 8; $config['level'] = 8;
$config['health'] = 185; $config['health'] = 185;
$config['mana'] = 35; $config['mana'] = 40;
$config['cap'] = 470; $config['cap'] = 470;
$config['soul'] = 100; $config['soul'] = 100;
@ -348,6 +348,7 @@
'level' => 5, 'level' => 5,
'cooldownPost' => 1,//60, 'cooldownPost' => 1,//60,
'cooldownCreate' => 1,//180, 'cooldownCreate' => 1,//180,
'newPostsBumpThreads' => true,
'hidden' => '<font color="orange">[H]</font>', 'hidden' => '<font color="orange">[H]</font>',
'closed' => '<font color="red">[C]</font>', 'closed' => '<font color="red">[C]</font>',
'sticky' => '<font color="green">[S]</font>', 'sticky' => '<font color="green">[S]</font>',

View File

@ -369,6 +369,7 @@ if (!empty($_GET)) {
if ($access) { 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() ."');"); 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 '<p><b><font color="red">You don\'t have permission to post on this thread. [Thread: Closed]</font></b></p>'; } else echo '<p><b><font color="red">You don\'t have permission to post on this thread. [Thread: Closed]</font></b></p>';
} else { } else {
?> ?>
@ -434,7 +435,7 @@ if (!empty($_GET)) {
//if ($thread === false) $access = false; //if ($thread === false) $access = false;
if ($access) { 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 '<h1>post has been updated.</h1>'; echo '<h1>post has been updated.</h1>';
} else echo "<p><font color='red'>Your permission to edit this post has been denied.</font></p>"; } else echo "<p><font color='red'>Your permission to edit this post has been denied.</font></p>";
} }