SMF Support > SMF 2.0.x Support

How can I add a "[Poll]" prefix for poll topics?

(1/1)

BGH:
Hello people,

I liked to add a poll prefix for each poll topic, in the topic list view only. For example I want something like this:

[Poll] Poll Topic Title => e.g.: [Poll] Do you like the new forum theme?

It seems that the solution provided here, for the MessageIndex.template.php file, worked well on the SMF 1.1.x branch; but what would be the needed modifications to make it work for 2.0.x?

Thanks in advance!

BGH:
I tried playing with the solution that I posted before, and did it! This is my solution (for those who are looking for this, please make a backup of the file, before doing the edits!).

In MessageIndex.template.php:

Find:


--- Code: --- <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 title="', $topic['first_post']['preview'], '"><span id="msg_' . $topic['first_post']['id'] . '">', $topic['first_post']['link'], (!$context['can_approve_posts'] && !$topic['approved'] ? '&nbsp;<em>(' . $txt['awaiting_approval'] . ')</em>' : ''), '</span></span>', $topic['is_sticky'] ? '</strong>' : '';

--- End code ---

Replace with:


--- Code: --- <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'] . '\');"' : ''), '>';
// Poll?
if ($topic['is_poll'])
echo '
<strong>[', $txt['poll'], ']</strong>';
echo '
', $topic['is_sticky'] ? '<strong>' : '', '<span title="', $topic['first_post']['preview'], '"><span id="msg_' . $topic['first_post']['id'] . '">', $topic['first_post']['link'], (!$context['can_approve_posts'] && !$topic['approved'] ? '&nbsp;<em>(' . $txt['awaiting_approval'] . ')</em>' : ''), '</span></span>', $topic['is_sticky'] ? '</strong>' : '';

--- End code ---

Marked solved :)!

Navigation

[0] Message Index

Go to full version