My issue is what changes is needed to make in below code so just 300 characters will appear and not whole last message
please guide changes in code
2.0.7 Default theme
global $smcFunc, $scripturl;// Topic ID
$topic = XXXX;
$request = $smcFunc['db_query']('', '
SELECT t.id_topic, m.subject, m.body
FROM {db_prefix}topics AS t
INNER JOIN {db_prefix}messages AS m ON (m.id_msg = t.id_last_msg)
WHERE t.id_topic = {int:topic}
LIMIT 1',
array(
'topic' => $topic,
)
);
list($id_topic, $subject, $body) = $smcFunc['db_fetch_row']($request);
$smcFunc['db_free_result']($request);
$body = parse_bbc($body);
echo '
<strong><a href="', $scripturl, '?topic=', $id_topic, '.0">', $subject, '</a></strong>
<p>', $body, '</p>';
0 commentaires:
Enregistrer un commentaire