|
@@ -365,8 +365,8 @@ function MessageIndex()
|
|
|
IFNULL(meml.real_name, ml.poster_name) AS last_display_name, t.id_first_msg,
|
|
|
mf.poster_time AS first_poster_time, mf.subject AS first_subject, mf.icon AS first_icon,
|
|
|
mf.poster_name AS first_member_name, mf.id_member AS first_id_member,
|
|
|
- IFNULL(memf.real_name, mf.poster_name) AS first_display_name, SUBSTRING(ml.body, 1, 385) AS last_body,
|
|
|
- SUBSTRING(mf.body, 1, 385) AS first_body, ml.smileys_enabled AS last_smileys, mf.smileys_enabled AS first_smileys
|
|
|
+ IFNULL(memf.real_name, mf.poster_name) AS first_display_name, SUBSTRING(ml.body, 1, ' . ($modSettings['preview_characters'] + 256) . ') AS last_body,
|
|
|
+ SUBSTRING(mf.body, 1, ' . ($modSettings['preview_characters'] + 256) . ') AS first_body, ml.smileys_enabled AS last_smileys, mf.smileys_enabled AS first_smileys
|
|
|
FROM {db_prefix}topics AS t
|
|
|
INNER JOIN {db_prefix}messages AS ml ON (ml.id_msg = t.id_last_msg)
|
|
|
INNER JOIN {db_prefix}messages AS mf ON (mf.id_msg = t.id_first_msg)
|
|
@@ -398,15 +398,17 @@ function MessageIndex()
|
|
|
if (!$pre_query)
|
|
|
$topic_ids[] = $row['id_topic'];
|
|
|
|
|
|
- if (!empty($settings['message_index_preview']))
|
|
|
+ // Does the theme support message previews?
|
|
|
+ if (!empty($settings['message_index_preview']) && !empty($modSettings['preview_characters']))
|
|
|
{
|
|
|
- // Limit them to 128 characters - do this FIRST because it's a lot of wasted censoring otherwise.
|
|
|
+ // Limit them to $modSettings['preview_characters'] characters
|
|
|
$row['first_body'] = strip_tags(strtr(parse_bbc($row['first_body'], $row['first_smileys'], $row['id_first_msg']), array('<br />' => ' ')));
|
|
|
- if ($smcFunc['strlen']($row['first_body']) > 128)
|
|
|
- $row['first_body'] = $smcFunc['substr']($row['first_body'], 0, 128) . '...';
|
|
|
+ if ($smcFunc['strlen']($row['first_body']) > $modSettings['preview_characters'])
|
|
|
+ $row['first_body'] = $smcFunc['substr']($row['first_body'], 0, $modSettings['preview_characters']) . '...';
|
|
|
+
|
|
|
$row['last_body'] = strip_tags(strtr(parse_bbc($row['last_body'], $row['last_smileys'], $row['id_last_msg']), array('<br />' => ' ')));
|
|
|
- if ($smcFunc['strlen']($row['last_body']) > 128)
|
|
|
- $row['last_body'] = $smcFunc['substr']($row['last_body'], 0, 128) . '...';
|
|
|
+ if ($smcFunc['strlen']($row['last_body']) > $modSettings['preview_characters'])
|
|
|
+ $row['last_body'] = $smcFunc['substr']($row['last_body'], 0, $modSettings['preview_characters']) . '...';
|
|
|
|
|
|
// Censor the subject and message preview.
|
|
|
censorText($row['first_subject']);
|