News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Discepancey in Function bd - removeMessage()

Started by Kays, September 08, 2009, 11:04:54 AM

Previous topic - Next topic

Kays

Not quite a bug, so I thought I'd post it here.

According to the function database you are suppose to be able to input an array of message ids.

removeMessage (mixed $messages[, bool $decreasePostCount])

But I don't see anyway that it can handle an array. It's specifically designed to handle only one deletion at a time.

RemoveTopic.php


// Remove a specific message (including permission checks).
function removeMessage($message, $decreasePostCount = true)
{
global $db_prefix, $board, $sourcedir, $modSettings, $ID_MEMBER, $user_info;

if (empty($message) || !is_numeric($message))
return false;

$request = db_query("
SELECT
m.ID_MEMBER, m.icon, m.posterTime, m.subject," . (empty($modSettings['search_custom_index_config']) ? '' : ' m.body,') . "
t.ID_TOPIC, t.ID_FIRST_MSG, t.ID_LAST_MSG, t.numReplies, t.ID_BOARD,
t.ID_MEMBER_STARTED AS ID_MEMBER_POSTER,
b.countPosts
FROM ({$db_prefix}messages AS m, {$db_prefix}topics AS t, {$db_prefix}boards AS b)
WHERE m.ID_MSG = $message
AND t.ID_TOPIC = m.ID_TOPIC
AND b.ID_BOARD = t.ID_BOARD
LIMIT 1", __FILE__, __LINE__);
if (mysql_num_rows($request) == 0)
return false;
$row = mysql_fetch_assoc($request);
mysql_free_result($request);




If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

Oldiesmann

Thanks for catching that. Will fix it shortly.

Advertisement: