Hey, is there any way to put just one post in a block? Whenever the post is edited, so will the block.
Here you go (put in php block and put the post's message number where indicated):
global $scripturl, $db_prefix, $settings, $modSettings, $context;
//////////////////// Enter message # here
$message_id = 1234;
$message_id = (int) $message_id;
$request = db_query("
SELECT m.icon, m.subject, m.body, IFNULL(mem.realName, m.posterName) AS posterName,
m.posterTime, m.ID_MSG, t.ID_TOPIC, m.ID_MEMBER, m.smileysEnabled, b.name
FROM ({$db_prefix}topics AS t, {$db_prefix}messages AS m, {$db_prefix}boards as b)
LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = m.ID_MEMBER)
WHERE m.ID_MSG = $message_id
AND m.ID_TOPIC = t.ID_TOPIC
AND t.ID_BOARD = b.ID_BOARD"
, __FILE__, __LINE__);
$return = array();
if (mysql_num_rows($request) == 0) return;
$row = mysql_fetch_assoc($request);
$row['body'] = doUBBC($row['body'], $row['smileysEnabled']);
$return[] = array(
'icon' => '<img src="' . $settings['images_url'] . '/post/' . $row['icon'] . '.gif" align="middle" valign="top" alt="' . $row['icon'] . '" />',
'subject' => '<a href="' . $scripturl . '?topic=' . $row['ID_TOPIC'] . '.msg' . $row['ID_MSG'] . '#msg' . $row['ID_MSG'] . '">'.$row['subject'].'</a>',
'time' => timeformat($row['posterTime']),
'body' => $row['body'],
'href' => $scripturl . '?topic=' . $row['ID_TOPIC'] . '.0',
'poster' => array(
'id' => $row['ID_MEMBER'],
'name' => $row['posterName'],
'href' => !empty($row['ID_MEMBER']) ? $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] : '',
'link' => !empty($row['ID_MEMBER']) ? '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">' . $row['posterName'] . '</a>' : $row['posterName']
),
);
mysql_free_result($request);
foreach ($return as $news)
echo '
<table border="0" width="100%" align="center" class="smfNews">
<tr><td>', $news['icon'], ' <b>', $news['subject'], '</b><span class="smaller"><br />', $news['time'], ' - ', $news['poster']['link'], '<br /><br /></span></td></tr>
<tr><td>', $news['body'], '<br /></td></tr>
</table>';
Major thanks!!