Skip to content

Commit

Permalink
Merge pull request #1720 from emanuele45/go_go_queries
Browse files Browse the repository at this point in the history
Go go queries
  • Loading branch information
Spuds committed Jul 10, 2014
2 parents 7b9ac3d + b35d0c3 commit 838eaee
Show file tree
Hide file tree
Showing 14 changed files with 2,015 additions and 1,677 deletions.
2 changes: 1 addition & 1 deletion sources/Subs.php
Expand Up @@ -4302,6 +4302,7 @@ function response_prefix()
global $language, $user_info, $txt;
static $response_prefix = null;

// Get a response prefix, but in the forum's default language.
if ($response_prefix === null && !($response_prefix = cache_get_data('response_prefix')))
{
if ($language === $user_info['language'])
Expand All @@ -4312,7 +4313,6 @@ function response_prefix()
$response_prefix = $txt['response_prefix'];
loadLanguage('index');
}

cache_put_data('response_prefix', $response_prefix, 600);
}

Expand Down
13 changes: 5 additions & 8 deletions sources/controllers/Display.controller.php
Expand Up @@ -773,15 +773,15 @@ public function action_display()
*/
public function action_quickmod2()
{
global $topic, $board, $user_info, $context;
global $topic, $board, $user_info, $context, $modSettings;

// Check the session = get or post.
checkSession('request');

require_once(SUBSDIR . '/Messages.subs.php');

if (empty($_REQUEST['msgs']))
redirectexit('topic=' . $topic . '.' . $_REQUEST['start']);
redirectexit('topic=' . $topic . '.' . (int) $_REQUEST['start']);

$messages = array();
foreach ($_REQUEST['msgs'] as $dummy)
Expand Down Expand Up @@ -821,6 +821,7 @@ public function action_quickmod2()
// Get the first message in the topic - because you can't delete that!
$first_message = $topic_info['id_first_msg'];
$last_message = $topic_info['id_last_msg'];
$remover = new MessagesDelete($modSettings['recycle_enable'], $modSettings['recycle_board']);

// Delete all the messages we know they can delete. ($messages)
foreach ($messages as $message => $info)
Expand All @@ -832,14 +833,10 @@ public function action_quickmod2()
elseif ($message == $first_message)
$topicGone = true;

removeMessage($message);

// Log this moderation action ;).
if (allowedTo('delete_any') && (!allowedTo('delete_own') || $info[1] != $user_info['id']))
logAction('delete', array('topic' => $topic, 'subject' => $info[0], 'member' => $info[1], 'board' => $board));
$remover->removeMessage($message);
}

redirectexit(!empty($topicGone) ? 'board=' . $board : 'topic=' . $topic . '.' . $_REQUEST['start']);
redirectexit(!empty($topicGone) ? 'board=' . $board : 'topic=' . $topic . '.' . (int) $_REQUEST['start']);
}

/**
Expand Down

0 comments on commit 838eaee

Please sign in to comment.