SMF Support > SMF 2.0.x Support
I need help in MessageIndex.template
b0t:
Hello all, I need help with a code to insert into my MessageIndex.template, I need to take the text of the topic automatically, this may show the topics with the first text, I just need to know the code, I can then edit the theme.
Thank you! O:)
K@:
Sorry, b0t, but I don't get what you're asking. :(
Can you go into a bit more detail about what you want to achieve?
b0t:
k@ , sorry and thank you, I need to make a modification in the MessageIndex.template.php,so that it is like the attached picture.
--- Code: ---// Some columns require a different shade of the color class.
$alternate_class = $color_class . '2';
echo '
<tr class="', $color_class, '">
<td class="icon1">
<img src="', $settings['images_url'], '/topic/', $topic['class'], '.gif" alt="" />
</td>
<td class="icon2">
<img src="', $topic['first_post']['icon_url'], '" alt="" />
</td>
<td class="subject">
<div ', (!empty($topic['quick_mod']['modify']) ? 'id="topic_' . $topic['first_post']['id'] . '" onmouseout="mouse_on_div = 0;" onmouseover="mouse_on_div = 1;" ondblclick="modify_topic(\'' . $topic['id'] . '\', \'' . $topic['first_post']['id'] . '\');"' : ''), '>
', $topic['is_sticky'] ? '<strong>' : '', '<span id="msg_' . $topic['first_post']['id'] . '">', $topic['first_post']['link'], (!$context['can_approve_posts'] && !$topic['approved'] ? ' <em>(' . $txt['awaiting_approval'] . ')</em>' : ''), '</span>', $topic['is_sticky'] ? '</strong>' : '';
// Is this topic new? (assuming they are logged in!)
if ($topic['new'] && $context['user']['is_logged'])
echo '
<a href="', $topic['new_href'], '" id="newicon' . $topic['first_post']['id'] . '"><img src="', $settings['lang_images_url'], '/new.gif" alt="', $txt['new'], '" /></a>';
echo '
<p>', $txt['started_by'], ' ', $topic['first_post']['member']['link'], '
<small id="pages' . $topic['first_post']['id'] . '">', $topic['pages'], '</small>' . (!empty($modSettings['topic_descriptions_enable']) && $topic['description'] != "" ? '<hr class="topicdesc" /><small id="topicdesc_' . $topic['first_post']['id'] . '">' . $topic['description'] . '</small>' : '') . '
</p>
</div>
</td>
<td class="stats">
', $topic['replies'], ' ', $txt['replies'], '
<br />
', $topic['views'], ' ', $txt['views'], '
</td>
<td class="lastpost">
<a href="', $topic['last_post']['href'], '"><img src="', $settings['images_url'], '/icons/last_post.gif" alt="', $txt['last_post'], '" title="', $txt['last_post'], '" /></a>
', $topic['last_post']['time'], '<br />
', $txt['by'], ' ', $topic['last_post']['member']['link'], '
</td>';
// Show the quick moderation options?
--- End code ---
the modification would be in this part of the file, I have installed the mod TOPIC DESCRIPTION, but I need the description is generated automatically. in this mod is generated manually.
I hope I've managed to understand
Regards O:)
K@:
That'll be better, thanks!
I'm no coder, sadly. But, with what you'd just added, I'm sure somebody will be able to help you, with that. :)
Arantor:
Um, what exactly do you hope to put as an automatic description? Where is that going to come from?
Navigation
[0] Message Index
[#] Next page
Go to full version