News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

SMF Post Prefix

Started by Diego Andrés, May 11, 2015, 10:37:35 PM

Previous topic - Next topic

Goten22

I've got this error in logs. How can I fix it?

QuoteXXXXX?topic=3.0
8: Undefined index: id_prefix
File: /home/user/public_html/Sources/Display.php

Adonix

#81
Error on following things ! ( In SMF 2.0.11 )

Find
'link' => '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.msg' . $row['id_msg'] . ';topicseen#msg' . $row['id_msg'] . '" rel="nofollow">' . $row['subject'] . '</a>'
Replace
'link' => ($row['id_msg'] == $row['id_first_msg'] ? PostPrefix::formatPrefix($row['id_prefix']) : ''). ' <a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.msg' . $row['id_msg'] . ';topicseen#msg' . $row['id_msg'] . '" rel="nofollow">' . $row['subject'] . '</a>'

Find
'link' => '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.0">' . $row['first_subject'] . '</a>'
Replace
'link' => PostPrefix::formatPrefix($row['id_prefix']). ' <a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.0">' . $row['first_subject'] . '</a>'

Excited to use this mod but have errors while installing :(

ArkServer

Hi, i just installed it and it seems to work almost fine, the prefix shows up in the topic http://blushyface.com/community/news-and-updates/test-topic/ but NOT in the message index http://blushyface.com/community/news-and-updates/ , anyone know what file i need to look at or change to fix this?

br360

Does your custom theme you are using have its own MessageIndex.template.php, and if so, do the prefixes show up on the message index of the default theme?

ArkServer

Quote from: br360 on October 27, 2015, 06:55:13 PM
Does your custom theme you are using have its own MessageIndex.template.php, and if so, do the prefixes show up on the message index of the default theme?

both no to that, all themes dont show the prefix on the message index but when u look at the post it does show there

br360

Can you go through the parse instructions and make sure the code for messageindex.template.php is there?

Find:
?>

Add before:
function template_filterPrefix()
{
global $context, $modSettings, $scripturl, $txt;

// Prefix
if (!empty($modSettings['PostPrefix_enable_filter']) && !empty($context['prefix']['post']))
{

echo'
<div class="cat_bar">
<h3 class="catbg">
', $txt['PostPrefix_filter'],'
</h3>
</div>
<div class="windowbg">
<span class="topslice"><span></span></span>
<div class="content">';

// Show all the prefixes for this board.
foreach ($context['prefix']['post'] as $prefix)
echo'
<a href="' . $scripturl . '?board=' . $context['current_board'] . '.0;prefix=' . $prefix['id'] . '">' . PostPrefix::formatPrefix($prefix['id']) . '</a>, ';

echo'
<a href="', $scripturl, '?board=', $context['current_board'], '.0;prefix=0">', $txt['PostPrefix_filter_noprefix'], '</a>,
<a href="', $scripturl, '?board=', $context['current_board'], '.0">', $txt['PostPrefix_filter_all'], '</a>
</div>
<span class="botslice"><span></span></span>
</div>
<br class="clear" />';
}
}

ArkServer

I can confirm the code is added in messageindex.template.php

//edit this is my messageindex

<?php
/**
 * Simple Machines Forum (SMF)
 *
 * @package SMF
 * @author Simple Machines
 * @copyright 2011 Simple Machines
 * @license http://www.simplemachines.org/about/smf/license.php BSD
 *
 * @version 2.0
 */

function template_main()
{
global $context$settings$options$scripturl$modSettings$txt;

echo '
<a id="top"></a>'
;

if (!empty($context['boards']) && (!empty($options['show_children']) || $context['start'] == 0))
{
echo '
<div class="tborder childboards" id="board_'
$context['current_board'], '_childboards">
<div class="cat_bar">
<h3 class="catbg">'
$txt['parent_boards'], '</h3>
</div>
<div class="table_frame">
<table class="table_list">
<tbody id="board_'
$context['current_board'], '_children" class="content">';

foreach ($context['boards'] as $board)
{
echo '
<tr id="board_'
$board['id'], '" class="windowbg2">
<td class="icon windowbg"'
, !empty($board['children']) ? ' rowspan="2"' '''>
<a href="'
, ($board['is_redirect'] || $context['user']['is_guest'] ? $board['href'] : $scripturl '?action=unread;board=' $board['id'] . '.0;children'), '">';

// If the board or children is new, show an indicator.
if ($board['new'] || $board['children_new'])
echo '
<img src="'
$settings['images_url'], '/' .$context['theme_variant_url'], 'on'$board['new'] ? '' '2''.png" alt="'$txt['new_posts'], '" title="'$txt['new_posts'], '" />';
// Is it a redirection board?
elseif ($board['is_redirect'])
echo '
<img src="'
$settings['images_url'], '/' .$context['theme_variant_url'], 'redirect.png" alt="*" title="*" />';
// No new posts at all! The agony!!
else
echo '
<img src="'
$settings['images_url'], '/' .$context['theme_variant_url'], 'off.png" alt="'$txt['old_posts'], '" title="'$txt['old_posts'], '" />';

echo '
</a>
</td>
<td class="info">
<a class="subject" href="'
$board['href'], '" name="b'$board['id'], '">'$board['name'], '</a>';

// Has it outstanding posts for approval?
if ($board['can_approve_posts'] && ($board['unapproved_posts'] || $board['unapproved_topics']))
echo '
<a href="'
$scripturl'?action=moderate;area=postmod;sa=', ($board['unapproved_topics'] > 'topics' 'posts'), ';brd='$board['id'], ';'$context['session_var'], '='$context['session_id'], '" title="'sprintf($txt['unapproved_posts'], $board['unapproved_topics'], $board['unapproved_posts']), '" class="moderation_link">(!)</a>';

echo '

<p>'
$board['description'] , '</p>';

// Show the "Moderators: ". Each has name, href, link, and id. (but we're gonna use link_moderators.)
if (!empty($board['moderators']))
echo '
<p class="moderators">'
count($board['moderators']) === $txt['moderator'] : $txt['moderators'], ': 'implode(', '$board['link_moderators']), '</p>';

// Show some basic information about the number of posts, etc.
echo '
</td>
<td class="stats windowbg">
<p>'
comma_format($board['posts']), ' '$board['is_redirect'] ? $txt['redirects'] : $txt['posts'], ' <br />
'
$board['is_redirect'] ? '' comma_format($board['topics']) . ' ' $txt['board_topics'], '
</p>
</td>
<td class="lastpost">'
;

if (!$modSettings['disable_avatar'])
echo '<div style="float: left; margin-right: 6px;">'$board['last_post']['member']['avatar'], '</div>';

/* The board's and children's 'last_post's have:
time, timestamp (a number that represents the time.), id (of the post), topic (topic id.),
link, href, subject, start (where they should go for the first unread post.),
and member. (which has id, name, link, href, username in it.) */
if (!empty($board['last_post']['id']))
echo '
<p><strong>'
$txt['last_post'], '</strong>  '$txt['by'], ' '$board['last_post']['member']['link'], '<br />
'
$txt['in'], ' '$board['last_post']['link'], '<br />
'
$txt['on'], ' '$board['last_post']['time'],'
</p>'
;

echo '
</td>
</tr>'
;

// Show the "Child Boards: ". (there's a link_children but we're going to bold the new ones...)
if (!empty($board['children']) && !$modSettings['display_childboards'])
{
// Sort the links into an array with new boards bold so it can be imploded.
$children = array();
/* Each child in each board's children has:
id, name, description, new (is it new?), topics (#), posts (#), href, link, and last_post. */
foreach ($board['children'] as $child)
{
if (!$child['is_redirect'])
$child['link'] = '<a href="' $child['href'] . '" ' . ($child['new'] ? 'class="new_posts" ' '') . 'title="' . ($child['new'] ? $txt['new_posts'] : $txt['old_posts']) . ' (' $txt['board_topics'] . ': ' comma_format($child['topics']) . ', ' $txt['posts'] . ': ' comma_format($child['posts']) . ')">' $child['name'] . ($child['new'] ? '</a> <a href="' $scripturl '?action=unread;board=' $child['id'] . '" title="' $txt['new_posts'] . ' (' $txt['board_topics'] . ': ' comma_format($child['topics']) . ', ' $txt['posts'] . ': ' comma_format($child['posts']) . ')"><img src="' $settings['lang_images_url'] . '/new.gif" class="new_posts" alt="" />' '') . '</a>';
else
$child['link'] = '<a href="' $child['href'] . '" title="' comma_format($child['posts']) . ' ' $txt['redirects'] . '">' $child['name'] . '</a>';

// Has it posts awaiting approval?
if ($child['can_approve_posts'] && ($child['unapproved_posts'] | $child['unapproved_topics']))
$child['link'] .= ' <a href="' $scripturl '?action=moderate;area=postmod;sa=' . ($child['unapproved_topics'] > 'topics' 'posts') . ';brd=' $child['id'] . ';' $context['session_var'] . '=' $context['session_id'] . '" title="' sprintf($txt['unapproved_posts'], $child['unapproved_topics'], $child['unapproved_posts']) . '" class="moderation_link">(!)</a>';

$children[] = $child['new'] ? '<strong>' $child['link'] . '</strong>' $child['link'];
}
echo '
<tr id="board_'
$board['id'], '_children"><td colspan="3" class="children windowbg"><strong>'$txt['parent_boards'], '</strong>: 'implode(', '$children), '</td></tr>';
}
}
echo '
</tbody>
</table>
</div>
</div>'
;
}

if (!empty($options['show_board_desc']) && $context['description'] != '')
echo '
<p class="description_board">'
$context['description'], '</p>';

// Create the button set...
$normal_buttons = array(
'new_topic' => array('test' => 'can_post_new''text' => 'new_topic''image' => 'new_topic.gif''lang' => true'url' => $scripturl '?action=post;board=' $context['current_board'] . '.0''active' => true),
'post_poll' => array('test' => 'can_post_poll''text' => 'new_poll''image' => 'new_poll.gif''lang' => true'url' => $scripturl '?action=post;board=' $context['current_board'] . '.0;poll'),
'notify' => array('test' => 'can_mark_notify''text' => $context['is_marked_notify'] ? 'unnotify' 'notify''image' => ($context['is_marked_notify'] ? 'un' ''). 'notify.gif''lang' => true'custom' => 'onclick="return confirm(\'' . ($context['is_marked_notify'] ? $txt['notification_disable_board'] : $txt['notification_enable_board']) . '\');"''url' => $scripturl '?action=notifyboard;sa=' . ($context['is_marked_notify'] ? 'off' 'on') . ';board=' $context['current_board'] . '.' $context['start'] . ';' $context['session_var'] . '=' $context['session_id']),
'markread' => array('text' => 'mark_read_short''image' => 'markread.gif''lang' => true'url' => $scripturl '?action=markasread;sa=board;board=' $context['current_board'] . '.0;' $context['session_var'] . '=' $context['session_id']),
);

// They can only mark read if they are logged in and it's enabled!
if (!$context['user']['is_logged'] || !$settings['show_mark_read'])
unset($normal_buttons['markread']);

// Allow adding new buttons easily.
call_integration_hook('integrate_messageindex_buttons', array(&$normal_buttons));

if (!$context['no_topic_listing'])
{
echo '
<div class="pagesection">
<div class="pagelinks floatleft">'
$txt['pages'], ': '$context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . '&nbsp;&nbsp;<a href="#bot"><strong>' $txt['go_down'] . '</strong></a>' '''</div>
'
template_button_strip($normal_buttons'right'), '
</div>'
;

// If Quick Moderation is enabled start the form.
if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] > && !empty($context['topics']))
echo '
<form action="'
$scripturl'?action=quickmod;board='$context['current_board'], '.'$context['start'], '" method="post" accept-charset="'$context['character_set'], '" class="clear" name="quickModForm" id="quickModForm">';

echo '
<div class="tborder topic_table" id="messageindex">
<table class="table_grid" cellspacing="0">
<thead>
<tr class="catbg">'
;

// Are there actually any topics to show?
if (!empty($context['topics']))
{
echo '
<th scope="col" class="first_th" width="8%" colspan="2">&nbsp;</th>
<th scope="col" class="lefttext"><a href="'
$scripturl'?board='$context['current_board'], '.'$context['start'], ';sort=subject'$context['sort_by'] == 'subject' && $context['sort_direction'] == 'up' ';desc' '''">'$txt['subject'], $context['sort_by'] == 'subject' ' <img src="' $settings['images_url'] . '/sort_' $context['sort_direction'] . '.gif" alt="" />' '''</a> / <a href="'$scripturl'?board='$context['current_board'], '.'$context['start'], ';sort=starter'$context['sort_by'] == 'starter' && $context['sort_direction'] == 'up' ';desc' '''">'$txt['started_by'], $context['sort_by'] == 'starter' ' <img src="' $settings['images_url'] . '/sort_' $context['sort_direction'] . '.gif" alt="" />' '''</a></th>
<th scope="col" width="14%"><a href="'
$scripturl'?board='$context['current_board'], '.'$context['start'], ';sort=replies'$context['sort_by'] == 'replies' && $context['sort_direction'] == 'up' ';desc' '''">'$txt['replies'], $context['sort_by'] == 'replies' ' <img src="' $settings['images_url'] . '/sort_' $context['sort_direction'] . '.gif" alt="" />' '''</a> / <a href="'$scripturl'?board='$context['current_board'], '.'$context['start'], ';sort=views'$context['sort_by'] == 'views' && $context['sort_direction'] == 'up' ';desc' '''">'$txt['views'], $context['sort_by'] == 'views' ' <img src="' $settings['images_url'] . '/sort_' $context['sort_direction'] . '.gif" alt="" />' '''</a></th>';
// Show a "select all" box for quick moderation?
if (empty($context['can_quick_mod']))
echo '
<th scope="col" class="lefttext last_th" width="26%"><a href="'
$scripturl'?board='$context['current_board'], '.'$context['start'], ';sort=last_post'$context['sort_by'] == 'last_post' && $context['sort_direction'] == 'up' ';desc' '''">'$txt['last_post'], $context['sort_by'] == 'last_post' ' <img src="' $settings['images_url'] . '/sort_' $context['sort_direction'] . '.gif" alt="" />' '''</a></th>';
else
echo '
<th scope="col" class="lefttext" width="26%"><a href="'
$scripturl'?board='$context['current_board'], '.'$context['start'], ';sort=last_post'$context['sort_by'] == 'last_post' && $context['sort_direction'] == 'up' ';desc' '''">'$txt['last_post'], $context['sort_by'] == 'last_post' ' <img src="' $settings['images_url'] . '/sort_' $context['sort_direction'] . '.gif" alt="" />' '''</a></th>';

// Show a "select all" box for quick moderation?
if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] == 1)
echo '
<th scope="col" class="last_th" width="24"><input type="checkbox" onclick="invertAll(this, this.form, \'topics[]\');" class="input_check" /></th>'
;

// If it's on in "image" mode, don't show anything but the column.
elseif (!empty($context['can_quick_mod']))
echo '
<th class="last_th" width="4%">&nbsp;</th>'
;
}
// No topics.... just say, "sorry bub".
else
echo '
<th scope="col" class="first_th" width="8%">&nbsp;</th>
<th colspan="3"><strong>'
$txt['msg_alert_none'], '</strong></th>
<th scope="col" class="last_th" width="8%">&nbsp;</th>'
;

echo '
</tr>
</thead>
<tbody>'
;

/* START COMMENT OUT BY List Of Users in Boards and Topics
if (!empty($settings['display_who_viewing']))
{
echo '
<tr class="windowbg2 whos_viewing">
<td colspan="', !empty($context['can_quick_mod']) ? '6' : '5', '" class="smalltext">';
if ($settings['display_who_viewing'] == 1)
echo count($context['view_members']), ' ', count($context['view_members']) === 1 ? $txt['who_member'] : $txt['members'];
else
echo empty($context['view_members_list']) ? '0 ' . $txt['members'] : implode(', ', $context['view_members_list']) . ((empty($context['view_num_hidden']) or $context['can_moderate_forum']) ? '' : ' (+ ' . $context['view_num_hidden'] . ' ' . $txt['hidden'] . ')');
echo $txt['who_and'], $context['view_num_guests'], ' ', $context['view_num_guests'] == 1 ? $txt['guest'] : $txt['guests'], $txt['who_viewing_board'], '
</td>
</tr>';
}
/* END COMMENT OUT BY List Of Users in Boards and Topics */

// If this person can approve items and we have some awaiting approval tell them.
if (!empty($context['unapproved_posts_message']))
{
echo '
<tr class="windowbg2">
<td colspan="'
, !empty($context['can_quick_mod']) ? '6' '5''">
<span class="alert">!</span> '
$context['unapproved_posts_message'], '
</td>
</tr>'
;
}

$stickybar false;
$normalbar false;
foreach ($context['topics'] as $topic)
{
if ($topic['is_sticky'] && !$stickybar)
{
echo '
<tr class="titlebg">
<td colspan="'
, empty($options['display_quick_mod']) ? '7' '8''">
<strong>'
$txt['costa_topico_fixo'], '</strong>
</td>
</tr>
'
;
$stickybar true;
}
elseif (!$topic['is_sticky'] && $stickybar && !$normalbar)
{
echo '
<tr class="titlebg">
<td colspan="'
, empty($options['display_quick_mod']) ? '7' '8''">
<strong>'
$txt['costa_topico_normal'], '</strong>
</td>
</tr>
'
;
$normalbar true;
}
// Is this topic pending approval, or does it have any posts pending approval?
if ($context['can_approve_posts'] && $topic['unapproved_posts'])
$color_class = !$topic['approved'] ? 'approvetbg' 'approvebg';
// We start with locked and sticky topics.
elseif ($topic['is_sticky'] && $topic['is_locked'])
$color_class 'stickybg locked_sticky';
// Sticky topics should get a different color, too.
elseif ($topic['is_sticky'])
$color_class 'stickybg';
// Locked topics get special treatment as well.
elseif ($topic['is_locked'])
$color_class 'lockedbg';
// Last, but not least: regular topics.
else
$color_class 'windowbg';

// Some columns require a different shade of the color class.
$alternate_class $color_class '2';

echo '
<tr>
<td class="icon1 '
$color_class'">
<img src="'
$settings['images_url'], '/topic/'$topic['class'], '.gif" alt="" />
</td>
<td class="icon2 '
$color_class'">
<img src="'
$topic['first_post']['icon_url'], '" alt="" />
</td>
<td class="subject '
$alternate_class'">
<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'] ? '&nbsp;<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>
</p>
</div>
</td>
<td class="stats '
$color_class'">
'
$topic['replies'], ' '$txt['replies'], '
<br />
'
$topic['views'], ' '$txt['views'], '
</td>
<td class="lastpost '
$alternate_class'">
<a href="'
$topic['last_post']['href'], '"><img src="'$settings['images_url'], '/icons/last_post.gif" alt="'$txt['last_post'], '" title="'$txt['last_post'], '" /></a>
'
;
if (!$modSettings['disable_avatar'])
echo '<div style="float: left; margin-right: 4px;">'$topic['last_post']['member']['avatar'], '</div>';
echo '
'
$topic['last_post']['time'], '<br />
'
$txt['by'], ' '$topic['last_post']['member']['link'], '
</td>'
;

// Show the quick moderation options?
if (!empty($context['can_quick_mod']))
{
echo '
<td class="moderation '
$color_class'" align="center">';
if ($options['display_quick_mod'] == 1)
echo '
<input type="checkbox" name="topics[]" value="'
$topic['id'], '" class="input_check" />';
else
{
// Check permissions on each and show only the ones they are allowed to use.
if ($topic['quick_mod']['remove'])
echo '<a href="'$scripturl'?action=quickmod;board='$context['current_board'], '.'$context['start'], ';actions['$topic['id'], ']=remove;'$context['session_var'], '='$context['session_id'], '" onclick="return confirm(\''$txt['quickmod_confirm'], '\');"><img src="'$settings['images_url'], '/icons/quick_remove.gif" width="16" alt="'$txt['remove_topic'], '" title="'$txt['remove_topic'], '" /></a>';

if ($topic['quick_mod']['lock'])
echo '<a href="'$scripturl'?action=quickmod;board='$context['current_board'], '.'$context['start'], ';actions['$topic['id'], ']=lock;'$context['session_var'], '='$context['session_id'], '" onclick="return confirm(\''$txt['quickmod_confirm'], '\');"><img src="'$settings['images_url'], '/icons/quick_lock.gif" width="16" alt="'$txt['set_lock'], '" title="'$txt['set_lock'], '" /></a>';

if ($topic['quick_mod']['lock'] || $topic['quick_mod']['remove'])
echo '<br />';

if ($topic['quick_mod']['sticky'])
echo '<a href="'$scripturl'?action=quickmod;board='$context['current_board'], '.'$context['start'], ';actions['$topic['id'], ']=sticky;'$context['session_var'], '='$context['session_id'], '" onclick="return confirm(\''$txt['quickmod_confirm'], '\');"><img src="'$settings['images_url'], '/icons/quick_sticky.gif" width="16" alt="'$txt['set_sticky'], '" title="'$txt['set_sticky'], '" /></a>';

if ($topic['quick_mod']['move'])
echo '<a href="'$scripturl'?action=movetopic;board='$context['current_board'], '.'$context['start'], ';topic='$topic['id'], '.0"><img src="'$settings['images_url'], '/icons/quick_move.gif" width="16" alt="'$txt['move_topic'], '" title="'$txt['move_topic'], '" /></a>';
}
echo '
</td>'
;
}
echo '
</tr>'
;
}

if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] == && !empty($context['topics']))
{
echo '
<tr class="titlebg">
<td colspan="6" align="right">
<select class="qaction" name="qaction"'
$context['can_move'] ? ' onchange="this.form.moveItTo.disabled = (this.options[this.selectedIndex].value != \'move\');"' '''>
<option value="">--------</option>'
$context['can_remove'] ? '
<option value="remove">' 
$txt['quick_mod_remove'] . '</option>' ''$context['can_lock'] ? '
<option value="lock">' 
$txt['quick_mod_lock'] . '</option>' ''$context['can_sticky'] ? '
<option value="sticky">' 
$txt['quick_mod_sticky'] . '</option>' ''$context['can_move'] ? '
<option value="move">' 
$txt['quick_mod_move'] . ': </option>' ''$context['can_merge'] ? '
<option value="merge">' 
$txt['quick_mod_merge'] . '</option>' ''$context['can_restore'] ? '
<option value="restore">' 
$txt['quick_mod_restore'] . '</option>' ''$context['can_approve'] ? '
<option value="approve">' 
$txt['quick_mod_approve'] . '</option>' ''$context['user']['is_logged'] ? '
<option value="markread">' 
$txt['quick_mod_markread'] . '</option>' '''
</select>'
;

// Show a list of boards they can move the topic to.
if ($context['can_move'])
{
echo '
<select class="qaction" id="moveItTo" name="move_to" disabled="disabled">'
;

foreach ($context['move_to_boards'] as $category)
{
echo '
<optgroup label="'
$category['name'], '">';
foreach ($category['boards'] as $board)
echo '
<option value="'
$board['id'], '"'$board['selected'] ? ' selected="selected"' '''>'$board['child_level'] > str_repeat('=='$board['child_level'] - 1) . '=&gt;' ''' '$board['name'], '</option>';
echo '
</optgroup>'
;
}
echo '
</select>'
;
}

echo '
<input type="submit" value="'
$txt['quick_mod_go'], '" onclick="return document.forms.quickModForm.qaction.value != \'\' &amp;&amp; confirm(\''$txt['quickmod_confirm'], '\');" class="button_submit qaction" />
</td>
</tr>'
;
}

echo '
</tbody>
</table>
</div>
<a id="bot"></a>'
;

// Finish off the form - again.
if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] > && !empty($context['topics']))
echo '
<input type="hidden" name="' 
$context['session_var'] . '" value="' $context['session_id'] . '" />
</form>'
;

echo '
<div class="pagesection">
'
template_button_strip($normal_buttons'right'), '
<div class="pagelinks">'
$txt['pages'], ': '$context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . '&nbsp;&nbsp;<a href="#top"><strong>' $txt['go_up'] . '</strong></a>' '''</div>
</div>'
;
}

// Show breadcrumbs at the bottom too.
theme_linktree();

// Show everybody who has viewed this topic within the last 15 minutes:
if (isset($context['view_members_list']))
{
echo '
<div class="cat_bar"><h3 class="catbg">' 
$txt['who_title'] . '</h3></div>
<div class="plainbox">' 
$txt['users_browsing_board'] . ':<br/>';

// Show the actual people viewing the topic
echo empty($context['view_members_list']) ? '0 ' $txt['members'] : implode(', '$context['view_members_list']) . ((empty($context['view_num_hidden']) || $context['can_moderate_forum']) ? '' ' (+ ' $context['view_num_hidden'] . ' ' $txt['hidden'] . ')');

// Now show how many guests are here too.
echo $txt['who_and'], $context['view_num_guests'], ' '$context['view_num_guests'] == $txt['guest'] : $txt['guests'];

echo '</div>';
}

echo '
<div class="tborder" id="topic_icons">
<div class="description">
<p class="floatright" id="message_index_jump_to">&nbsp;</p>'
;

if (!$context['no_topic_listing'])
echo '
<p class="floatleft smalltext">'
, !empty($modSettings['enableParticipation']) && $context['user']['is_logged'] ? '
<img src="' 
$settings['images_url'] . '/topic/my_normal_post.gif" alt="" align="middle" /> ' $txt['participation_caption'] . '<br />' '''
<img src="' 
$settings['images_url'] . '/topic/normal_post.gif" alt="" align="middle" /> ' $txt['normal_topic'] . '<br />
<img src="' 
$settings['images_url'] . '/topic/hot_post.gif" alt="" align="middle" /> ' sprintf($txt['hot_topics'], $modSettings['hotTopicPosts']) . '<br />
<img src="' 
$settings['images_url'] . '/topic/veryhot_post.gif" alt="" align="middle" /> ' sprintf($txt['very_hot_topics'], $modSettings['hotTopicVeryPosts']) . '
</p>
<p class="smalltext">
<img src="' 
$settings['images_url'] . '/icons/quick_lock.gif" alt="" align="middle" /> ' $txt['locked_topic'] . '<br />' . ($modSettings['enableStickyTopics'] == '1' '
<img src="' 
$settings['images_url'] . '/icons/quick_sticky.gif" alt="" align="middle" /> ' $txt['sticky_topic'] . '<br />' '') . ($modSettings['pollMode'] == '1' '
<img src="' 
$settings['images_url'] . '/topic/normal_poll.gif" alt="" align="middle" /> ' $txt['poll'] : '') . '
</p>'
;

echo '
<script type="text/javascript"><!-- // --><![CDATA[
if (typeof(window.XMLHttpRequest) != "undefined")
aJumpTo[aJumpTo.length] = new JumpTo({
sContainerId: "message_index_jump_to",
sJumpToTemplate: "<label class=\"smalltext\" for=\"%select_id%\">'
$context['jump_to']['label'], ':<" + "/label> %dropdown_list%",
iCurBoardId: '
$context['current_board'], ',
iCurBoardChildLevel: '
$context['jump_to']['child_level'], ',
sCurBoardName: "'
$context['jump_to']['board_name'], '",
sBoardChildLevelIndicator: "==",
sBoardPrefix: "=> ",
sCatSeparator: "-----------------------------",
sCatPrefix: "",
sGoButtonLabel: "'
$txt['quick_mod_go'], '"
});
// ]]></script>
<br class="clear" />
</div>
</div>'
;

// Javascript for inline editing.
echo '
<script type="text/javascript" src="' 
$settings['default_theme_url'] . '/scripts/topic.js"></script>
<script type="text/javascript"><!-- // --><![CDATA[

// Hide certain bits during topic edit.
hide_prefixes.push("lockicon", "stickyicon", "pages", "newicon");

// Use it to detect when we\'ve stopped editing.
document.onclick = modify_topic_click;

var mouse_on_div;
function modify_topic_click()
{
if (in_edit_mode == 1 && mouse_on_div == 0)
modify_topic_save("'
$context['session_id'], '", "'$context['session_var'], '");
}

function modify_topic_keypress(oEvent)
{
if (typeof(oEvent.keyCode) != "undefined" && oEvent.keyCode == 13)
{
modify_topic_save("'
$context['session_id'], '", "'$context['session_var'], '");
if (typeof(oEvent.preventDefault) == "undefined")
oEvent.returnValue = false;
else
oEvent.preventDefault();
}
}

// For templating, shown when an inline edit is made.
function modify_topic_show_edit(subject)
{
// Just template the subject.
setInnerHTML(cur_subject_div, \'<input type="text" name="subject" value="\' + subject + \'" size="60" style="width: 95%;" maxlength="80" onkeypress="modify_topic_keypress(event)" class="input_text" /><input type="hidden" name="topic" value="\' + cur_topic_id + \'" /><input type="hidden" name="msg" value="\' + cur_msg_id.substr(4) + \'" />\');
}

// And the reverse for hiding it.
function modify_topic_hide_edit(subject)
{
// Re-template the subject!
setInnerHTML(cur_subject_div, \'<a href="'
$scripturl'?topic=\' + cur_topic_id + \'.0">\' + subject + \'<\' +\'/a>\');
}

// ]]></script>'
;
}
function 
template_filterPrefix()
{
global $context$modSettings$scripturl$txt;

// Prefix
if (!empty($modSettings['PostPrefix_enable_filter']) && !empty($context['prefix']['post']))
{

echo'
<div class="cat_bar">
<h3 class="catbg">
'
$txt['PostPrefix_filter'],'
</h3>
</div>
<div class="windowbg">
<span class="topslice"><span></span></span>
<div class="content">'
;

// Show all the prefixes for this board.
foreach ($context['prefix']['post'] as $prefix)
echo'
<a href="' 
$scripturl '?board=' $context['current_board'] . '.0;prefix=' $prefix['id'] . '">' PostPrefix::formatPrefix($prefix['id']) . '</a>, ';

echo'
<a href="'
$scripturl'?board='$context['current_board'], '.0;prefix=0">'$txt['PostPrefix_filter_noprefix'], '</a>, 
<a href="'
$scripturl'?board='$context['current_board'], '.0">'$txt['PostPrefix_filter_all'], '</a>
</div>
<span class="botslice"><span></span></span>
</div>
<br class="clear" />'
;
}
}
?>

br360

Odd. Ok, did you have any errors when installing this? Can you go through the file edits to make sure that the code was in fact added to all of the templates and source files.

Look for "Manual Install Instructions for SMF", and then click the parse button- http://custom.simplemachines.org/mods/index.php?mod=4038

ArkServer

Quote from: br360 on October 27, 2015, 08:42:37 PM
Odd. Ok, did you have any errors when installing this? Can you go through the file edits to make sure that the code was in fact added to all of the templates and source files.

Look for "Manual Install Instructions for SMF", and then click the parse button- http://custom.simplemachines.org/mods/index.php?mod=4038

yes i did the edits that failed after i installed it but it didn't work as i hoped so i went ahead and did every file manually and its fixed now. (afaik)

Dreadaxe

SMF Post Prefix
"Fatal error: Cannot call method self::settings() or method does not exist in /home/assoston/www/taverne/Sources/PostPrefixAdmin.php on line 59"
Can you help me?

Dreadaxe

Quote from: Juvept on August 11, 2015, 08:44:38 AM
Hi,

After i install this mod (without any problem), and i go to Admin > Forum > Postprefix this error appears:


QuoteFatal error: Cannot call method self::general() or method does not exist in /home/a6532119/public_html/Sources/PostPrefixAdmin.php on line 59

Can anyone tell me who to solve please?

Same problem

piiero

I've a little problem when I want to install the mod, there is an error in the test and when I install it, I have no access on topics of my forum and I like to know how I could solve this problem... Here are two screen of my problem


Kindred

why do people continue to install mods when there are errors in the tests -- and a big red warning that continuing will cause problems?

also, why does no one actually read the FAQ/wiki?
Specifically: http://wiki.simplemachines.org/smf/Error_in_mod_installation

if you installed the mod, despite the failures and the big red warning, then you have to MANUALLY apply the change(s) in the bits that failed the test for automatic code install.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Jade Elizabeth

Just wanted to pop in and give you a huge thanks for making this. It's absolutely beautiful. You've done a really really fantastic job. I hope one day I can make mods this clean and efficient, but until then I will just stand by and appreciate your work ;D.
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

Diego Andrés


SMF Tricks - Free & Premium Responsive Themes for SMF.

Jade Elizabeth

#95
Actually there's a bit of a problem I'm having here lol. In the boards where a prefix is required (or used) replies to the first posts have "Re: <span class=" as their subject. Also the quick reply has what I am assuming is a partially hidden field showing...it's showing the title after the quick reply description. In my case it's "Free Inspirational poster "everything will be okay" coloring page" />" (or in the screenshot "paid test" but paid is the prefix)

I've also included a screenshot because I am having a hard time explaining. I've double checked the files and everything seems fine. I'm not sure what's causing this. No errors in the logs. I've tried uninstalling and reinstalling (uninstalling fixed the issue and reinstalling put it back).

I've only got these installed:
@mention members 1.1.2
SMF Post Prefix 2.0.3
Simple Audio Video Embedder 3.5.1
Social Login 3.4
httpBL 2.5.1
Stop Spammer 2.3.9
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

Jade Elizabeth

Upon further investigation it seems to only happen on the Redsy theme and it's happening no matter what I do. If you have any idea what could be causing it to play up like this I would really appreciate it :).
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

+Nachi+

Thanks for the awesome mod!

I was wondering if in future you're thinking of adding an option of adding more than one prefix to the topic (preferably I'd need at east two) and/or is that's already possible if some simple changes?

Diego Andrés

Quote from: Jade Elizabeth on December 07, 2015, 09:26:50 AM
Upon further investigation it seems to only happen on the Redsy theme and it's happening no matter what I do. If you have any idea what could be causing it to play up like this I would really appreciate it :).

Have you checked the changes in Redsy for the display?? Could be the problem  :P




Quote from: +Nachi+ on December 09, 2015, 05:48:50 PM
Thanks for the awesome mod!

I was wondering if in future you're thinking of adding an option of adding more than one prefix to the topic (preferably I'd need at east two) and/or is that's already possible if some simple changes?

I do have thought on it. Currently I'm not sure if it should be in the same mod and if it worth the effort. Anyway, this mod won't have any more features until I can work on it for SMF 2.1

Thanks

SMF Tricks - Free & Premium Responsive Themes for SMF.

Jade Elizabeth

Actually Gluz figured it out, he's pretty amazing! I edited the wrong part completely because Redsy moves the linktree into the index template and does it all there, I didn't know I was editing the wrong bit because I didn't compare where the mod should have edited on the default to where I edited...which sounds like such a blonde thing to do LOL :D

FOR ANYONE USING REDSY HERE ARE THE CUSTOMISATIONS NEEDED TO GET THIS MOD WORKING ON IT:
http://www.simplemachines.org/community/index.php?topic=541827.0
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

Advertisement: