View Only Boards

Started by Rudolf, January 31, 2007, 10:45:10 AM

Previous topic - Next topic

Dr Web

#340
Many thanks for the code, however I don't have that code in my Display.template.php, below I posted almost my entire Display.template.php file, I see just a portion of that code, so I don't know where to put the code you gave me.

Can you help me please?

<?php
// Version: 2.0 Beta 4; Display

function template_main()
{
global $context$settings$options$txt$scripturl$modSettings;
//Display ads on the thread page
if (function_exists("show_threadAds"))
{
$ads show_threadAds();
if(!empty($ads))
if($ads['type']==0)
echo $ads['content'];
else
eval($ads['content']);
unset($ads);
}


// Show the anchor for the top and for the first message. If the first message is new, say so.
echo '
<a name="top"></a>
<a name="msg'
$context['first_message'], '"></a>'$context['first_new_message'] ? '<a name="new"></a>' '';

// Is this topic also a poll?
if ($context['is_poll'])
{
echo '
<div class="tborder marginbottom" id="poll">
<h3 class="titlebg headerpadding">
<img src="'
$settings['images_url'], '/topic/'$context['poll']['is_locked'] ? 'normal_poll_locked' 'normal_poll''.gif" alt="" align="bottom" /> '$txt['poll'], '
</h3>
<h4 class="windowbg headerpadding">
'
$txt['poll_question'], ': <span class="plainstyle">'$context['poll']['question'];

if (!empty($context['poll']['expire_time']))
echo '
&nbsp;('
, ($context['poll']['is_expired'] ? $txt['poll_expired_on'] : $txt['poll_expires_on']), ': '$context['poll']['expire_time'], ')';

echo '
</span>
</h4>
<div class="windowbg clearfix" id="poll_options">'
;
// Are they not allowed to vote but allowed to view the options?
if ($context['poll']['show_results'] || !$context['allow_vote'])
{
echo '
<ul class="horizlist clearfix">
<li>
<dl class="options">'
;

// Show each option with its corresponding percentage bar.
foreach ($context['poll']['options'] as $option)
echo '
<dt'
$option['voted_this'] ? ' class="voted"' '''>'$option['option'], '</dt>
<dd>'
$context['allow_poll_view'] ? $option['bar'] . ' ' $option['votes'] . ' (' $option['percent'] . '%)' '''</dd>';

echo '
</dl>
</li>
<li>'
;

// If they are allowed to revote - show them a link!
if ($context['allow_change_vote'])
echo '
<a href="'
$scripturl'?action=vote;topic='$context['current_topic'], '.'$context['start'], ';poll='$context['poll']['id'], ';sesc='$context['session_id'], '">'$txt['poll_change_vote'], '</a><br />';

// If we're viewing the results... maybe we want to go back and vote?
if ($context['poll']['show_results'] && $context['allow_vote'])
echo '
<a href="'
$scripturl'?topic='$context['current_topic'], '.'$context['start'], '">'$txt['poll_return_vote'], '</a><br />';

// If they're allowed to lock the poll, show a link!
if ($context['poll']['lock'])
echo '
<a href="'
$scripturl'?action=lockvoting;topic='$context['current_topic'], '.'$context['start'], ';sesc='$context['session_id'], '">', !$context['poll']['is_locked'] ? $txt['poll_lock'] : $txt['poll_unlock'], '</a><br />';

// If they're allowed to edit the poll... guess what... show a link!
if ($context['poll']['edit'])
echo '
<a href="'
$scripturl'?action=editpoll;topic='$context['current_topic'], '.'$context['start'], '">'$txt['poll_edit'], '</a>';

echo '
</li>
</ul>
<p>'
$context['allow_poll_view'] ? '<strong>' $txt['poll_total_voters'] . ': ' $context['poll']['total_votes'] . '</strong>' '',  '</p>';
}
// They are allowed to vote! Go to it!
else
{
echo '
<form action="'
$scripturl'?action=vote;topic='$context['current_topic'], '.'$context['start'], ';poll='$context['poll']['id'], '" method="post" accept-charset="'$context['character_set'], '">';

// Show a warning if they are allowed more than one option.
if ($context['poll']['allowed_warning'])
echo '
<p class="smallpadding">'
$context['poll']['allowed_warning'], '</p>';

echo '
<ul class="horizlist">
<li>
<ul class="options">'
;

// Show each option with its button - a radio likely.
foreach ($context['poll']['options'] as $option)
echo '
<li>'
$option['vote_button'], ' <label for="'$option['id'], '">'$option['option'], '</label></li>';

echo '
</ul>
</li>
<li>
<p class="pollmoderation">'
;

// Allowed to view the results? (without voting!)
if ($context['allow_poll_view'])
echo '
<a href="'
$scripturl'?topic='$context['current_topic'], '.'$context['start'], ';viewResults">'$txt['poll_results'], '</a><br />';

// Show a link for locking the poll as well...
if ($context['poll']['lock'])
echo '
<a href="'
$scripturl'?action=lockvoting;topic='$context['current_topic'], '.'$context['start'], ';sesc='$context['session_id'], '">', (!$context['poll']['is_locked'] ? $txt['poll_lock'] : $txt['poll_unlock']), '</a><br />';

// Want to edit it? Click right here......
if ($context['poll']['edit'])
echo '
<a href="'
$scripturl'?action=editpoll;topic='$context['current_topic'], '.'$context['start'], '">'$txt['poll_edit'], '</a><br />';

echo '
</p>
</li>
</ul>
<p class="submitbutton">
<input type="submit" value="'
$txt['poll_vote'], '" />
<input type="hidden" name="sc" value="'
$context['session_id'], '" />
</p>
</form>'
;
}

echo '
</div>
</div>'
;
}

// Does this topic have some events linked to it?
if (!empty($context['linked_calendar_events']))
{
echo '
<div id="events" class="tborder marginbottom">
<h3 class="titlebg headerpadding"> '
$txt['calendar_linked_events'], '</h3>
<ul class="windowbg largepadding">'
;
foreach ($context['linked_calendar_events'] as $event)
echo '
<li>
'
, ($event['can_edit'] ? '<a href="' $event['modify_href'] . '" style="color: red;">*</a> ' ''), '<strong>'$event['title'], '</strong>: '$event['start_date'], ($event['start_date'] != $event['end_date'] ? ' - ' $event['end_date'] : ''), '
</li>'
;
echo '
</ul>
</div>'
;
}

// Build the normal button array.
$normal_buttons = array(
'reply' => array('test' => 'can_reply''text' => 'reply''image' => 'reply.gif''lang' => true'url' => $scripturl '?action=post;topic=' $context['current_topic'] . '.' $context['start'] . ';num_replies=' $context['num_replies']),
'bookmark' => array('test' => 'can_make_bookmarks''text' => 'bookmark_add''lang' => true'url' => $scripturl '?action=bookmarks;sa=add;topic=' $context['current_topic']),
'notify' => array('test' => 'can_mark_notify''text' => 'notify''image' => 'notify.gif''lang' => true'custom' => 'onclick="return confirm(\'' . ($context['is_marked_notify'] ? $txt['notification_disable_topic'] : $txt['notification_enable_topic']) . '\');"''url' => $scripturl '?action=notify;sa=' . ($context['is_marked_notify'] ? 'off' 'on') . ';topic=' $context['current_topic'] . '.' $context['start'] . ';sesc=' $context['session_id']),
'custom' => array(),
'send' => array('test' => 'can_send_topic''text' => 'send_topic''image' => 'sendtopic.gif''lang' => true'url' => $scripturl '?action=emailuser;sa=sendtopic;topic=' $context['current_topic'] . '.0'),
'print' => array('text' => 'print''image' => 'print.gif''lang' => true'custom' => 'rel="new_win nofollow"''url' => $scripturl '?action=printpage;topic=' $context['current_topic'] . '.0'),
);

// Special case for the custom one.
if ($context['user']['is_logged'] && $settings['show_mark_read'])
$normal_buttons['custom'] = array('text' => 'mark_unread''image' => 'markunread.gif''lang' => true'url' => $scripturl '?action=markasread;sa=topic;t=' $context['mark_unread_time'] . ';topic=' $context['current_topic'] . '.' $context['start'] . ';sesc=' $context['session_id']);
elseif ($context['can_add_poll'])
$normal_buttons['custom'] = array('text' => 'add_poll''image' => 'add_poll.gif''lang' => true'url' => $scripturl '?action=editpoll;add;topic=' $context['current_topic'] . '.' $context['start'] . ';sesc=' $context['session_id']);
else
unset($normal_buttons['custom']);

// Show the page index... "Pages: [1]".
echo '
<div class="clearfix margintop" id="postbuttons">
<div class="margintop middletext floatleft">'
$txt['pages'], ': '$context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . ' &nbsp;&nbsp;<a href="#lastPost"><strong>' $txt['go_down'] . '</strong></a>' '''</div>
<div class="next">'
$context['previous_next'], '</div>
<div class="nav floatright">'
template_button_strip($normal_buttons'bottom'), '</div>
</div>'
;

// Show the topic information - icon, subject, etc.
echo '
<div id="forumposts" class="tborder">
<h3 class="catbg3">
<img src="'
$settings['images_url'], '/topic/'$context['class'], '.gif" align="bottom" alt="" />
<span>'
$txt['author'], '</span>
<span id="top_subject">'
$txt['topic'], ': '$context['subject'], ' &nbsp;('$txt['read'], ' '$context['num_views'], ' '$txt['times'], ')</span>
</h3>'
;
if (!empty($settings['display_who_viewing']))
{
echo '
<div id="whoisviewing" class="smalltext headerpadding windowbg2">'
;

// Show just numbers...?
if ($settings['display_who_viewing'] == 1)
echo count($context['view_members']), ' 'count($context['view_members']) == $txt['who_member'] : $txt['members'];
// Or show the actual people viewing the topic?
else
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'], $txt['who_viewing_topic'], '
</div>'
;
}

echo '
<form action="'
$scripturl'?action=quickmod2;topic='$context['current_topic'], '.'$context['start'], '" method="post" accept-charset="'$context['character_set'], '" name="quickModForm" id="quickModForm" style="margin: 0;" onsubmit="return oQuickModify.bInEditMode ? oQuickModify.modifySave(\'' $context['session_id'] . '\') : confirm(\'' $txt['quickmod_confirm'] . '\');">';

// These are some cache image buttons we may want.
$reply_button create_button('quote.gif''reply_quote''quote''align="middle"');
$modify_button create_button('modify.gif''modify_msg''modify''align="middle"');
$remove_button create_button('delete.gif''remove_message''remove''align="middle"');
$split_button create_button('split.gif''split''split''align="middle"');
$approve_button create_button('approve.gif''approve''approve''align="middle"');
$restore_message_button create_button('restore_topic.gif''restore_message''restore_message''align="middle"');

$ignoredMsgs = array();

//Ad Counter
$adcounter =0;
// Get all the messages...
while ($message $context['get_message']())
{
$adcounter++;
$ignoring false;
echo '
<div class="bordercolor">'
;

if (in_array($message['member']['id'], $context['user']['ignoreusers']))
{
$ignoring true;
$ignoredMsgs[] = $message['id'];
}

// Show the message anchor and a "new" anchor if this message is new.
if ($message['id'] != $context['first_message'])
echo '
<a name="msg'
$message['id'], '"></a>'$message['first_new'] ? '<a name="new"></a>' '';

echo '
<div class="clearfix '
, !$message['first_new'] ? 'topborder ' ''$message['approved'] ? ($message['alternate'] == 'windowbg' 'windowbg2') : 'approvebg'' largepadding">';

// Show information about the poster of this message.
echo '
<div class="floatleft poster">
<h4>'
$message['member']['link'], '</h4>
<ul class="smalltext" id="msg_'
$message['id'], '_extra_info">';

// Show the member's custom title, if they have one.
if (isset($message['member']['title']) && $message['member']['title'] != '')
echo '
<li>'
$message['member']['title'], '</li>';

// Show the member's primary group (like 'Administrator') if they have one.
if (isset($message['member']['group']) && $message['member']['group'] != '')
echo '
<li>'
$message['member']['group'], '</li>';

// Don't show these things for guests.
if (!$message['member']['is_guest'])
{
// Show the post group if and only if they have no other group or the option is on, and they are in a post group.
if ((empty($settings['hide_post_group']) || $message['member']['group'] == '') && $message['member']['post_group'] != '')
echo '
<li>'
$message['member']['post_group'], '</li>';
echo '
<li>'
$message['member']['group_stars'], '</li>';

// Is karma display enabled?  Total or +/-?
if ($modSettings['karmaMode'] == '1')
echo '
<li class="margintop">'
$modSettings['karmaLabel'], ' '$message['member']['karma']['good'] - $message['member']['karma']['bad'], '</li>';
elseif ($modSettings['karmaMode'] == '2')
echo '
<li class="margintop">'
$modSettings['karmaLabel'], ' +'$message['member']['karma']['good'], '/-'$message['member']['karma']['bad'], '</li>';

// Is this user allowed to modify this member's karma?
if ($message['member']['karma']['allow'])
echo '
<li>
<a href="'
$scripturl'?action=modifykarma;sa=applaud;uid='$message['member']['id'], ';topic='$context['current_topic'], '.' $context['start'], ';m='$message['id'], ';sesc='$context['session_id'], '">'$modSettings['karmaApplaudLabel'], '</a>
<a href="'
$scripturl'?action=modifykarma;sa=smite;uid='$message['member']['id'], ';topic='$context['current_topic'], '.'$context['start'], ';m='$message['id'], ';sesc='$context['session_id'], '">'$modSettings['karmaSmiteLabel'], '</a>
</li>'
;

// Show online and offline buttons?
if (!empty($modSettings['onlineEnable']) && !$message['member']['is_guest'])
echo '
<li>'
$context['can_send_pm'] ? '<a href="' $message['member']['online']['href'] . '" title="' $message['member']['online']['label'] . '">' ''$settings['use_image_buttons'] ? '<img src="' $message['member']['online']['image_href'] . '" alt="' $message['member']['online']['text'] . '" border="0" style="margin-top: 2px;" />' $message['member']['online']['text'], $context['can_send_pm'] ? '</a>' ''$settings['use_image_buttons'] ? '<span class="smalltext"> ' $message['member']['online']['text'] . '</span>' '''</li>';

// Show the member's gender icon?
if (!empty($settings['show_gender']) && $message['member']['gender']['image'] != '' && !isset($context['disabled_fields']['gender']))
echo '
<li>'
$txt['gender'], ': '$message['member']['gender']['image'], '</li>';

// Show how many posts they have made.
if (!isset($context['disabled_fields']['posts']))
echo '
<li>'
$txt['member_postcount'], ': '$message['member']['posts'], '</li>';

// Any custom fields?
if (!empty($message['member']['custom_fields']))
{
foreach ($message['member']['custom_fields'] as $custom)
echo '
<li>'
$custom['title'], ': '$custom['value'], '</li>';
}

// Show avatars, images, etc.?
if (!empty($settings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image']))
echo '
<li class="margintop" style="overflow: auto;">'
$message['member']['avatar']['image'], '</li>';

// Show their personal text?
if (!empty($settings['show_blurb']) && $message['member']['blurb'] != '')
echo '
<li>'
$message['member']['blurb'], '</li>';

// This shows the popular messaging icons.
if ($message['member']['has_messenger'] && $message['member']['can_view_profile'])
echo '
<li>
<ul class="nolist">
'
, !isset($context['disabled_fields']['icq']) && !empty($message['member']['icq']['link']) ? '<li>' $message['member']['icq']['link'] . '</li>' '''
'
, !isset($context['disabled_fields']['msn']) && !empty($message['member']['msn']['link']) ? '<li>' $message['member']['msn']['link'] . '</li>' '''
'
, !isset($context['disabled_fields']['aim']) && !empty($message['member']['aim']['link']) ? '<li>' $message['member']['aim']['link'] . '</li>' '''
'
, !isset($context['disabled_fields']['yim']) && !empty($message['member']['yim']['link']) ? '<li>' $message['member']['yim']['link'] . '</li>' '''
</ul>
</li>'
;

// Show the profile, website, email address, and personal message buttons.
if ($settings['show_profile_buttons'])
{
echo '
<li>
<ul class="nolist">'
;
// Don't show the profile button if you're not allowed to view the profile.
if ($message['member']['can_view_profile'])
echo '
<li><a href="'
$message['member']['href'], '">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/icons/profile_sm.gif" alt="' $txt['view_profile'] . '" title="' $txt['view_profile'] . '" border="0" />' $txt['view_profile']), '</a></li>';

// Don't show an icon if they haven't specified a website.
if ($message['member']['website']['url'] != '' && !isset($context['disabled_fields']['website']))
echo '
<li><a href="'
$message['member']['website']['url'], '" title="' $message['member']['website']['title'] . '" target="_blank" class="new_win">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/www_sm.gif" alt="' $txt['www'] . '" border="0" />' $txt['www']), '</a></li>';

// Don't show the email address if they want it hidden.
if (in_array($message['member']['show_email'], array('yes''yes_permission_override''no_through_forum')))
echo '
<li><a href="'
$scripturl'?action=emailuser;sa=email;msg='$message['id'], '" rel="nofollow">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/email_sm.gif" alt="' $txt['email'] . '" title="' $txt['email'] . '" />' $txt['email']), '</a></li>';

// Since we know this person isn't a guest, you *can* message them.
if ($context['can_send_pm'])
echo '
<li><a href="'
$scripturl'?action=pm;sa=send;u='$message['member']['id'], '" title="'$message['member']['online']['label'], '">'$settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/im_' . ($message['member']['online']['is_online'] ? 'on' 'off') . '.gif" alt="' $message['member']['online']['label'] . '" border="0" />' $message['member']['online']['label'], '</a></li>';
}

echo '
</ul>
</li>'
;
// Are we showing the warning status?
if (!isset($context['disabled_fields']['warning_status']) && $message['member']['warning_status'] && ($context['user']['can_mod'] || !empty($modSettings['warning_show'])))
echo '
<li>'
$context['can_issue_warning'] ? '<a href="' $scripturl '?action=profile;u=' $message['member']['id'] . ';sa=issueWarning">' '''<img src="'$settings['images_url'], '/warning_'$message['member']['warning_status'], '.gif" alt="'$txt['user_warn_' $message['member']['warning_status']], '" />'$context['can_issue_warning'] ? '</a>' '''<span class="warn_'$message['member']['warning_status'], '">'$txt['warn_' $message['member']['warning_status']], '</span></li>';
}
// Otherwise, show the guest's email.
elseif (in_array($message['member']['show_email'], array('yes''yes_permission_override''no_through_forum')))
echo '
<li><a href="'
$scripturl'?action=emailuser;sa=email;msg='$message['id'], '" rel="nofollow">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/email_sm.gif" alt="' $txt['email'] . '" title="' $txt['email'] . '" border="0" />' $txt['email']), '</a></li>';

// Done with the information about the poster... on to the post itself.
echo '
</ul>
</div>
<div class="postarea">
<div class="keyinfo">
<div class="messageicon floatleft"><img src="'
$message['icon_url'] . '" alt="" border="0"'$message['can_modify'] ? ' id="msg_icon_' $message['id'] . '"' ''' /></div>
<h5 id="subject_'
$message['id'], '">
<a href="'
$message['href'], '" rel="nofollow">'$message['subject'], '</a>
</h5>
<div class="smalltext">&#38;#171; <strong>'
, !empty($message['counter']) ? $txt['reply'] . ' #' $message['counter'] : ''' '$txt['on'], ':</strong> '$message['time'], ' &#38;#187;</div>
<div id="msg_'
$message['id'], '_quick_mod"></div>
</div>'
;

// If this is the first post, (#0) just say when it was posted - otherwise give the reply #.
echo '
<ul class="smalltext postingbuttons">'
;

// Maybe we can approve it, maybe we should?
if ($message['can_approve'])
echo '
<li><a href="'
$scripturl'?action=moderate;area=postmod;sa=approve;topic='$context['current_topic'], '.'$context['start'], ';msg='$message['id'], ';sesc='$context['session_id'], '">'$approve_button'</a></li>';

// Can they reply? Have they turned on quick reply?
if ($context['can_reply'] && !empty($options['display_quick_reply']))
echo '
<li><a href="'
$scripturl'?action=post;quote='$message['id'], ';topic='$context['current_topic'], '.'$context['start'], ';num_replies='$context['num_replies'], ';sesc='$context['session_id'], '" onclick="return oQuickReply.quote('$message['id'], ', \''$context['session_id'], '\', true);">'$reply_button'</a></li>';

// So... quick reply is off, but they *can* reply?
elseif ($context['can_reply'])
echo '
<li><a href="'
$scripturl'?action=post;quote='$message['id'], ';topic='$context['current_topic'], '.'$context['start'], ';num_replies='$context['num_replies'], ';sesc='$context['session_id'], '">'$reply_button'</a></li>';

// Can the user modify the contents of this post?
if ($message['can_modify'])
echo '
<li><a href="'
$scripturl'?action=post;msg='$message['id'], ';topic='$context['current_topic'], '.'$context['start'], ';sesc='$context['session_id'], '">'$modify_button'</a></li>';

// How about... even... remove it entirely?!
if ($message['can_remove'])
echo '
<li><a href="'
$scripturl'?action=deletemsg;topic='$context['current_topic'], '.'$context['start'], ';msg='$message['id'], ';sesc='$context['session_id'], '" onclick="return confirm(\''$txt['remove_message'], '?\');">'$remove_button'</a></li>';

// What about splitting it off the rest of the topic?
if ($context['can_split'])
echo '
<li><a href="'
$scripturl'?action=splittopics;topic='$context['current_topic'], '.0;at='$message['id'], '">'$split_button'</a></li>';

// Can we restore topics?
if ($context['can_restore_msg'])
echo '
<li><a href="'
$scripturl'?action=restoretopic;msgs='$message['id'], ';sesc='$context['session_id'], '">'$restore_message_button'</a></li>';

// Show a checkbox for quick moderation?
if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == && $message['can_remove'])
echo '
<li><input type="checkbox" name="msgs[]" value="'
$message['id'], '" class="check" ', empty($settings['use_tabs']) ? 'onclick="document.getElementById(\'quickmodSubmit\').style.display = \'\';"' ''' /></li>';

// Show the post itself, finally!
echo '
</ul>'
;
if ($ignoring)
echo '<div id="msg_'$message['id'], '_ignored_prompt" style="display: none;">'$txt['ignoring_user'], '  <a href="#msg'$message['id'], '" onclick="return ignoreToggles['$message['id'], '].toggle()">'$txt['show_ignore_user_post'], '</a></div>';

echo '
<div class="post" id="msg_'
$message['id'], '"''>';

if (!$message['approved'] && $message['member']['id'] != && $message['member']['id'] == $context['user']['id'])
echo '
<div class="approve_post">
'
$txt['post_awaiting_approval'], '
</div>'
;
echo '
'
$message['body'], '
</div>'
$message['can_modify'] ? '
<img src="' 
$settings['images_url'] . '/icons/modify_inline.gif" alt="" class="modifybutton" id="modify_button_' $message['id'] . '" style="cursor: ' . ($context['browser']['is_ie5'] || $context['browser']['is_ie5.5'] ? 'hand' 'pointer') . '; display: none;" onclick="oQuickModify.modifyMsg(\'' $message['id'] . '\', \'' $context['session_id'] . '\')" />' '';

// Now for the attachments, signature, ip logged, etc...
echo '
<div id="msg_'
$message['id'], '_footer" class="attachments smalltext">';

// Assuming there are attachments...
if (!empty($message['attachment']))
{
echo '
<hr width="100%" size="1" class="hrcolor" />
<div style="overflow: auto; width: 100%;">'
;
$last_approved_state 1;
foreach ($message['attachment'] as $attachment)
{
// Show a special box for unapproved attachments...
if ($attachment['is_approved'] != $last_approved_state)
{
$last_approved_state 0;
echo '
<fieldset>
<legend>'
$txt['attach_awaiting_approve'], '&nbsp;[<a href="'$scripturl'?action=attachapprove;sa=all;mid='$message['id'], ';sesc='$context['session_id'], '">'$txt['approve_all'], '</a>]</legend>';
}

if ($attachment['is_image'])
{
if ($attachment['thumbnail']['has_thumb'])
echo '
<a href="'
$attachment['href'], ';image" id="link_'$attachment['id'], '" onclick="'$attachment['thumbnail']['javascript'], '"><img src="'$attachment['thumbnail']['href'], '" alt="" id="thumb_'$attachment['id'], '" border="0" /></a><br />';
else
echo '
<img src="' 
$attachment['href'] . ';image" alt="" width="' $attachment['width'] . '" height="' $attachment['height'] . '" border="0" /><br />';
}
echo '
<a href="' 
$attachment['href'] . '"><img src="' $settings['images_url'] . '/icons/clip.gif" align="middle" alt="*" border="0" />&nbsp;' $attachment['name'] . '</a> ';

if (!$attachment['is_approved'])
echo '
[<a href="'
$scripturl'?action=attachapprove;sa=approve;aid='$attachment['id'], ';sesc='$context['session_id'], '">'$txt['approve'], '</a>]&nbsp;|&nbsp;[<a href="'$scripturl'?action=attachapprove;sa=reject;aid='$attachment['id'], ';sesc='$context['session_id'], '">'$txt['delete'], '</a>] ';
echo '
('
$attachment['size'], ($attachment['is_image'] ? ', ' $attachment['real_width'] . 'x' $attachment['real_height'] . ' - ' $txt['attach_viewed'] : ' - ' $txt['attach_downloaded']) . ' ' $attachment['downloads'] . ' ' $txt['attach_times'] . '.)<br />';
}

// If we had unapproved attachments clean up.
if ($last_approved_state == 0)
echo '
</fieldset>'
;

echo '
</div>'
;
}

echo '
</div>
</div>
<div class="moderatorbar">
<div class="smalltext floatleft" id="modified_'
$message['id'], '">';

// Show "« Last Edit: Time by Person »" if this post was edited.
if ($settings['show_modify'] && !empty($message['modified']['name']))
echo '
&#38;#171; <em>'
$txt['last_edit'], ': '$message['modified']['time'], ' '$txt['by'], ' '$message['modified']['name'], '</em> &#38;#187;';

echo '
</div>
<div class="smalltext floatright">'
;

// Maybe they want to report this post to the moderator(s)?
if ($context['can_report_moderator'])
echo '
<a href="'
$scripturl'?action=reporttm;topic='$context['current_topic'], '.'$message['counter'], ';msg='$message['id'], '">'$txt['report_to_mod'], '</a> &nbsp;';

// Can we issue a warning because of this post?  Remember, we can't give guests warnings.
if ($context['can_issue_warning'] && !$message['is_message_author'] && !$message['member']['is_guest'])
echo '
<a href="'
$scripturl'?action=profile;u='$message['member']['id'], ';sa=issueWarning;msg='$message['id'], '"><img src="'$settings['images_url'], '/warn.gif" alt="'$txt['issue_warning_post'], '" title="'$txt['issue_warning_post'], '" border="0" /></a>';
echo '
<img src="'
$settings['images_url'], '/ip.gif" alt="" border="0" />';

// Show the IP to this user for this post - because you can moderate?
if ($context['can_moderate_forum'] && !empty($message['member']['ip']))
echo '
<a href="'
$scripturl'?action=trackip;searchip='$message['member']['ip'], '">'$message['member']['ip'], '</a> <a href="'$scripturl'?action=helpadmin;help=see_admin_ip" onclick="return reqWin(this.href);" class="help">(?)</a>';
// Or, should we show it because this is you?
elseif ($message['can_see_ip'])
echo '
<a href="'
$scripturl'?action=helpadmin;help=see_member_ip" onclick="return reqWin(this.href);" class="help">'$message['member']['ip'], '</a>';
// Okay, are you at least logged in?  Then we can show something about why IPs are logged...
elseif (!$context['user']['is_guest'])
echo '
<a href="'
$scripturl'?action=helpadmin;help=see_member_ip" onclick="return reqWin(this.href);" class="help">'$txt['logged'], '</a>';
// Otherwise, you see NOTHING!
else
echo '
'
$txt['logged'];

echo '
</div>'
;

// Show the member's signature?
if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled'])
echo '
<hr width="100%" size="1" style="clear: right;" class="margintop hrcolor" />
<div class="signature">'
$message['member']['signature'], '</div>';

echo '
</div>
</div>
</div>'
;
if (
function_exists("show_posts"))
{
if ($adpost show_posts($adcounter))
{
if($modSettings['ads_lookLikePosts'])
{
echo '
<div class="bordercolor">
<div class="clearfix windowbg3 largepadding">'
;

// Show information about the poster of this message.
echo '
<div class="floatleft poster">
<h4>'
$context['forum_name'], '</h4>';

// Done with the information about the poster... on to the post itself.
echo '
</div>
<div class="postarea">
<div class="keyinfo">
<h5 id="subject_'
$message['id'], '">
<a href="'
$message['href'], '" rel="nofollow">'$message['subject'], '</a>
</h5>
<div class="smalltext">&#38;#171; <strong>'
, !empty($message['counter']) ? $txt['reply'] . ' #' $message['counter'] : ''' '$txt['on'], ':</strong> '$message['time'], ' &#38;#187;</div>
<div id="msg_'
$message['id'], '_quick_mod"></div>
</div>'
;

// If this is the first post, (#0) just say when it was posted - otherwise give the reply #.
echo '
<ul class="smalltext postingbuttons">'
;

// Can they reply? Have they turned on quick reply?
if ($context['can_reply'] && !empty($options['display_quick_reply']))
echo '
<li>'
$reply_button'</li>';

// So... quick reply is off, but they *can* reply?
elseif ($context['can_reply'])
echo '
<li>'
$reply_button'</li>';

// Can the user modify the contents of this post?
if ($message['can_modify'])
echo '
<li>'
$modify_button'</li>';

// How about... even... remove it entirely?!
if ($message['can_remove'])
echo '
<li>'
$remove_button'</li>';

// What about splitting it off the rest of the topic?
if ($context['can_split'])
echo '
<li>'
$split_button'</li>';

// Can we restore topics?
if ($context['can_restore_msg'])
echo '
<li>'
$restore_message_button'</li>';

// Show the post itself, finally!
echo '
</ul>
<div class="post" id="msg_'
$message['id'], '"''>
'
$adpost['type'] == $adpost['content'] : eval($adpost['content']) ,'
</div>

</div>
</div>
</div>'
;
}
else
echo '
<div class="bordercolor">
<div class="clearfix windowbg3 largepadding">'
$adpost['type'] == $adpost['content'] : eval($adpost['content']) ,'</div>
</div>'
;
}
}
}

if(
function_exists("show_lastpostAds") && function_exists("show_posts"))
{
if(($adpost show_lastpostAds()) && !show_posts($adcounter))
{
if($modSettings['ads_lookLikePosts'])
{
echo '
<div class="bordercolor">
<div class="clearfix windowbg3 largepadding">'
;

// Show information about the poster of this message.
echo '
<div class="floatleft poster">
<h4>'
$context['forum_name'], '</h4>';

// Done with the information about the poster... on to the post itself.
echo '
</div>
<div class="postarea">
<div class="keyinfo">&nbsp;
<div id="msg_'
$message['id'], '_quick_mod">&nbsp;</div>
</div>'
;

// If this is the first post, (#0) just say when it was posted - otherwise give the reply #.
echo '
<ul class="smalltext postingbuttons">'
;

// Can they reply? Have they turned on quick reply?
if ($context['can_reply'] && !empty($options['display_quick_reply']))
echo '
<li>'
$reply_button'</li>';

// So... quick reply is off, but they *can* reply?
elseif ($context['can_reply'])
echo '
<li>'
$reply_button'</li>';

// Show the post itself, finally!
echo '
</ul>
<div class="post" id="msg_'
$message['id'], '"''>
'
$adpost['type'] == $adpost['content'] : eval($adpost['content']) ,'

</div>
</div>
</div>'
;
}
else
echo '
<div class="bordercolor">
<div class="clearfix windowbg3 largepadding">'
$adpost['type'] == $adpost['content'] : eval($adpost['content']) ,'</div>
</div>'
;
}
}
echo 
'</div>';
if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == && $context['can_remove_post'])
echo '
<input type="hidden" name="sc" value="'
$context['session_id'], '" />';

echo '
</form>'
;
echo '
</div>
<a name="lastPost"></a>'
;

// As before, build the custom button right.
if ($context['can_add_poll'])
$normal_buttons['custom'] = array('text' => 'add_poll''image' => 'add_poll.gif''lang' => true'url' => $scripturl '?action=editpoll;add;topic=' $context['current_topic'] . '.' $context['start'] . ';sesc=' $context['session_id']);
elseif ($context['user']['is_logged'] && $settings['show_mark_read'])
$normal_buttons['custom'] = array('text' => 'mark_unread''image' => 'markunread.gif''lang' => true'url' => $scripturl '?action=markasread;sa=topic;t=' $context['mark_unread_time'] . ';topic=' $context['current_topic'] . '.' $context['start'] . ';sesc=' $context['session_id']);

echo '
<div class="clearfix marginbottom" id="postbuttons_lower">
<div class="middletext floatleft">'
$txt['pages'], ': '$context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . ' &nbsp;&nbsp;<a href="#top"><strong>' $txt['go_up'] . '</strong></a>' '''</div>
<div class="nav floatright">'
template_button_strip($normal_buttons'top'), '</div>
<div style="clear: both;">'
$context['previous_next'], '</div>
</div>'
;

if ($settings['linktree_inline'])
theme_linktree();

$mod_buttons = array(
'move' => array('test' => 'can_move''text' => 'move_topic''image' => 'admin_move.gif''lang' => true'url' => $scripturl '?action=movetopic;topic=' $context['current_topic'] . '.0'),
'delete' => array('test' => 'can_delete''text' => 'remove_topic''image' => 'admin_rem.gif''lang' => true'custom' => 'onclick="return confirm(\'' $txt['are_sure_remove_topic'] . '\');"''url' => $scripturl '?action=removetopic2;topic=' $context['current_topic'] . '.0;sesc=' $context['session_id']),
'lock' => array('test' => 'can_lock''text' => empty($context['is_locked']) ? 'set_lock' 'set_unlock''image' => 'admin_lock.gif''lang' => true'url' => $scripturl '?action=lock;topic=' $context['current_topic'] . '.' $context['start'] . ';sesc=' $context['session_id']),
'sticky' => array('test' => 'can_sticky''text' => empty($context['is_sticky']) ? 'set_sticky' 'set_nonsticky''image' => 'admin_sticky.gif''lang' => true'url' => $scripturl '?action=sticky;topic=' $context['current_topic'] . '.' $context['start'] . ';sesc=' $context['session_id']),
'merge' => array('test' => 'can_merge''text' => 'merge''image' => 'merge.gif''lang' => true'url' => $scripturl '?action=mergetopics;board=' $context['current_board'] . '.0;from=' $context['current_topic']),
'remove_poll' => array('test' => 'can_remove_poll''text' => 'poll_remove''image' => 'admin_remove_poll.gif''lang' => true'custom' => 'onclick="return confirm(\'' $txt['poll_remove_warn'] . '\');"''url' => $scripturl '?action=removepoll;topic=' $context['current_topic'] . '.' $context['start']),
'calendar' => array('test' => 'calendar_post''text' => 'calendar_link''image' => 'linktocal.gif''lang' => true'url' => $scripturl '?action=post;calendar;msg=' $context['topic_first_message'] . ';topic=' $context['current_topic'] . '.0;sesc=' $context['session_id']),
);

if ($context['can_remove_post'] && !empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1)
$mod_buttons[] = array('text' => 'quickmod_delete_selected''image' => 'delete_selected.gif''lang' => true'custom' => 'onclick="return confirm(\'' $txt['quickmod_confirm'] . '\');" id="quickmodSubmit"''url' => 'javascript:document.quickModForm.submit();');

// Restore topic. eh?  No monkey business.
if ($context['can_restore_topic'])
$mod_buttons[] = array('text' => 'restore_topic''image' => '''lang' => true'url' => $scripturl '?action=restoretopic;topics=' $context['current_topic'] . ';sesc=' $context['session_id']);

// Restore messages?
if ($context['can_restore_msg'])
$mod_buttons[] = array('text' => 'quick_mod_restore''image' => '''lang' => true'url' => 'javascript:document.quickModForm.submit();''custom' => ' name="restore_selected" ');

echo '
<div id="moderationbuttons">'
template_button_strip($mod_buttons'bottom'), '</div>';

// Show the jumpto box, or actually...let Javascript do it.
echo '
<div class="tborder">
Never approach a bull from the front, a horse from the rear, or an idiot from any direction ;D

Rudolf

Code (Search) Select
      // Show the message anchor and a "new" anchor if this message is new.

Add before:
      if ($context['user']['is_guest'] && $message['id'] != $context['first_message'])
      {
         echo '
            <div class="login_message">
               To see more of this thread, please <a href="', $scripturl ,'?action=login">login</a> or <a href="', $scripturl ,'?action=register">register</a>.<br />
               Registration is quick and easy!
            </div>';
         break;
      }
I will update all my mods in the next few weeks. Thanks for your patience.

SVG-Collapse (you need an SVG compliant browser)

hansdampf

Sorry for bugging you, but do you have any idea what might be wrong with my issue explained some postings before? Would be so great... ;)

Dr Web

Many thanks, it works great, now only needs to look better, I will not make anything because I don't know css, you should really make a MOD of this, it's really a great feature.

Cheers
Never approach a bull from the front, a horse from the rear, or an idiot from any direction ;D

Rudolf

Quote from: hansdampf on January 21, 2009, 03:24:58 PM
Sorry for bugging you, but do you have any idea what might be wrong with my issue explained some postings before? Would be so great... ;)

Please re-install the mod using the View_Only_Boards_1.2a.zip package. It should temporarily fix the problem of the error logs.
Until I fix the real issue there.
I will update all my mods in the next few weeks. Thanks for your patience.

SVG-Collapse (you need an SVG compliant browser)

SergeantAsh

** SECURITY ALERT **

Guys,

Just wondering why the SSI functions don't appear to take any notice of security? I'm using the View_Only_Boards_1.2a.zip mod and although showing the board to Guests, they're not allowed access yet the SMF SSI XML feed is still grabbing the topics that should be hidden and out of view - this is a serious security flaw for anyone else using this mod!!!!

Other users of this mod should be aware of this security flaw!!

How can I resolve this ASAP besides removing the mod?

Cheers, @sh
Quote"Moderation has been called a virtue to limit the ambition of great men, and to console undistinguished people for their want of fortune and their lack of merit."

searchgr

View_Only_Boards_1.2 is ok.
I don't know for View_Only_Boards_1.2a.

SergeantAsh

So what is the difference? This is quite a worry is it not?
Quote"Moderation has been called a virtue to limit the ambition of great men, and to console undistinguished people for their want of fortune and their lack of merit."

searchgr

I use smf 1.1.7 and the mod works fine. The guest are not able to read the topics via rss.

SergeantAsh

And you've got just the righthand checkbox ticked under that boards permissions for guests?
Quote"Moderation has been called a virtue to limit the ambition of great men, and to console undistinguished people for their want of fortune and their lack of merit."

searchgr

yes, only the righthand checkbox.

SergeantAsh

Quote"Moderation has been called a virtue to limit the ambition of great men, and to console undistinguished people for their want of fortune and their lack of merit."

VLN

Several days ago I installed SMF 1.1.7 with no problem, and quickly learned how to change the colors and fonts of the forum using the default theme.

All I need now is to get your great mod working.

On my forum, Under Administration Center/ Packages, I tried to upload the one that says DB_1_x.php.

(I wasn't sure if I should upload the DB_2_x.php since I have 1.1.7, so didn't try.)

I got an error message, "The package manager currently allows only these file types: zip, tgz, tar.gz."

I see that the mod has a .php extension.

I went to the Options tab, "Cleanup Permissions", that says "This interface allows you to reset the permissions for files throughout your installation, so as to increase security or solve any permission problems you may encounter while installing packages."

I selected "Change all file permissions throughout the forum such that: All Files Are Writable".

Then I got a page that said "Some of the files the package manager needs to modify are not writable. This needs to be changed by logging into FTP and using it to chmod or create the files and folders. Your FTP information may be temporarily cached for proper operation of the package manager. "

I had a live chat with my hxxp:webhostingpad.com [nonactive]. He was perplexed and said they accept .php extension files.

So I thought I'd try asking you if there's something I need to adjust on my SMF forum control panels, and again, I'm using the default theme, 1.1.7.

Thank you.

SergeantAsh

Quote from: VLN on February 01, 2009, 11:38:35 PM
Several days ago I installed SMF 1.1.7 with no problem, and quickly learned how to change the colors and fonts of the forum using the default theme.

All I need now is to get your great mod working.

On my forum, Under Administration Center/ Packages, I tried to upload the one that says DB_1_x.php.

(I wasn't sure if I should upload the DB_2_x.php since I have 1.1.7, so didn't try.)

I got an error message, "The package manager currently allows only these file types: zip, tgz, tar.gz."

I see that the mod has a .php extension.

I went to the Options tab, "Cleanup Permissions", that says "This interface allows you to reset the permissions for files throughout your installation, so as to increase security or solve any permission problems you may encounter while installing packages."

I selected "Change all file permissions throughout the forum such that: All Files Are Writable".

Then I got a page that said "Some of the files the package manager needs to modify are not writable. This needs to be changed by logging into FTP and using it to chmod or create the files and folders. Your FTP information may be temporarily cached for proper operation of the package manager. "

I had a live chat with my Webhostingpad.com. He was perplexed and said they accept .php extension files.

So I thought I'd try asking you if there's something I need to adjust on my SMF forum control panels, and

again, I'm using the default theme, 1.1.7.

Thank you.


Dude, you're entirely misunderstanding the mod system!!! You don't upload single files from the package, you upload the ENTIRE Zip/Compressed file - SMF then intelligently picks out the file that it requires.

Try again, using the above...
Quote"Moderation has been called a virtue to limit the ambition of great men, and to console undistinguished people for their want of fortune and their lack of merit."

VLN

Thanks, @sh, that really helped. I had extracted the files out of it and put it in a folder in my desktop, thinking I had to select one and upload that to my forum.

Did it your way and it worked like a charm!

SergeantAsh

Quote from: VLN on February 03, 2009, 01:56:02 AM
Thanks, @sh, that really helped. I had extracted the files out of it and put it in a folder in my desktop, thinking I had to select one and upload that to my forum.

Did it your way and it worked like a charm!

Glad to be of help mate, hehe
Quote"Moderation has been called a virtue to limit the ambition of great men, and to console undistinguished people for their want of fortune and their lack of merit."

kimber

Hello it was recommended that I post this here.  If someone can help me out I'm receiving the following error ...


Quote
8: Undefined variable: post
Apply Filter: Only show the errors from this file
File: /home/content/c/l/o/clooneyn/html/smf/Sources/Subs-Recent.php
Line: 77

I'm running SMF 2.0 RC1 with the following mods

   SMF Gallery Lite      2.0.5      
   Advanced Contact Form    1.1    
   View Only Boards    1.2    
   Profil Moderator Managment    1.0.0    
   SMF Arcade    2.5 Beta 4.1 Public    
   Enhanced PM Warning Message    1.0    
   Top 10 Posters Today And This Week Stats

Here's the Subs-Recent.php

<?php
/**********************************************************************************
* Subs-Recent.php                                                                 *
***********************************************************************************
* SMF: Simple Machines Forum                                                      *
* Open-Source Project Inspired by Zef Hemel ([email protected])                    *
* =============================================================================== *
* Software Version:           SMF 2.0 RC1                                         *
* Software by:                Simple Machines (http://www.simplemachines.org)     *
* Copyright 2006-2009 by:     Simple Machines LLC (http://www.simplemachines.org) *
*           2001-2006 by:     Lewis Media (http://www.lewismedia.com)             *
* Support, News, Updates at:  http://www.simplemachines.org                       *
***********************************************************************************
* This program is free software; you may redistribute it and/or modify it under   *
* the terms of the provided license as published by Simple Machines LLC.          *
*                                                                                 *
* This program is distributed in the hope that it is and will be useful, but      *
* WITHOUT ANY WARRANTIES; without even any implied warranty of MERCHANTABILITY    *
* or FITNESS FOR A PARTICULAR PURPOSE.                                            *
*                                                                                 *
* See the "license.txt" file for details of the Simple Machines license.          *
* The latest version can always be found at http://www.simplemachines.org.        *
**********************************************************************************/

if (!defined('SMF'))
die('Hacking attempt...');

/* !!!

*/

// Get the latest posts of a forum.
function getLastPosts($latestPostOptions)
{
global $scripturl$txt$user_info$modSettings$smcFunc$context;

// Find all the posts.  Newer ones will have higher IDs.  (assuming the last 20 * number are accessable...)
// !!!SLOW This query is now slow, NEEDS to be fixed.  Maybe break into two?
$request $smcFunc['db_query']('substring''
SELECT
m.poster_time, m.subject, m.id_topic, m.id_member, m.id_msg,
IFNULL(mem.real_name, m.poster_name) AS poster_name, t.id_board, b.name AS board_name,
SUBSTRING(m.body, 1, 385) AS body, m.smileys_enabled
FROM {db_prefix}messages AS m
INNER JOIN {db_prefix}topics AS t ON (t.id_topic = m.id_topic)
INNER JOIN {db_prefix}boards AS b ON (b.id_board = t.id_board)
LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = m.id_member)
WHERE m.id_msg >= {int:likely_max_msg}' 
.
(!empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > '
AND b.id_board != {int:recycle_board}' 
'') . '
AND {query_wanna_see_board}' 
. ($modSettings['postmod_active'] ? '
AND t.approved = {int:is_approved}
AND m.approved = {int:is_approved}' 
'') . '
ORDER BY m.id_msg DESC
LIMIT ' 
$latestPostOptions['number_posts'],
array(
'likely_max_msg' => max(0$modSettings['maxMsgID'] - 50 $latestPostOptions['number_posts']),
'recycle_board' => $modSettings['recycle_board'],
'is_approved' => 1,
)
);
$posts = array();
while ($row $smcFunc['db_fetch_assoc']($request))
{
// Censor the subject and post for the preview ;).
censorText($row['subject']);
censorText($row['body']);

$row['body'] = strip_tags(strtr(parse_bbc($row['body'], $row['smileys_enabled'], $row['id_msg']), array('<br />' => '')));
if ($smcFunc['strlen']($row['body']) > 128)
$row['body'] = $smcFunc['substr']($row['body'], 0128) . '...';

// Build the array.
$posts[] = array(
'board' => array(
'id' => $row['id_board'],
'protected' => in_array($post['board'], $user_info['view_only_boards']), //- View Only Boards MOD-
'name' => $row['board_name'],
'href' => $scripturl '?board=' $row['id_board'] . '.0',
'link' => '<a href="' $scripturl '?board=' $row['id_board'] . '.0">' $row['board_name'] . '</a>'
),
'topic' => $row['id_topic'],
'poster' => array(
'id' => $row['id_member'],
'name' => $row['poster_name'],
'href' => empty($row['id_member']) ? '' $scripturl '?action=profile;u=' $row['id_member'],
'link' => empty($row['id_member']) ? $row['poster_name'] : '<a href="' $scripturl '?action=profile;u=' $row['id_member'] . '">' $row['poster_name'] . '</a>'
),
'subject' => $row['subject'],
'short_subject' => shorten_subject($row['subject'], 24),
'preview' => $row['body'],
'time' => timeformat($row['poster_time']),
'timestamp' => forum_time(true$row['poster_time']),
'raw_timestamp' => $row['poster_time'],
'href' => $scripturl '?topic=' $row['id_topic'] . '.msg' $row['id_msg'] . ';topicseen#msg' $row['id_msg'],
'link' => '<a href="' $scripturl '?topic=' $row['id_topic'] . '.msg' $row['id_msg'] . ';topicseen#msg' $row['id_msg'] . '" rel="nofollow">' $row['subject'] . '</a>'
);
}
$smcFunc['db_free_result']($request);

return $posts;
}

// Callback-function for the cache for getLastPosts().
function cache_getLastPosts($latestPostOptions)
{
return array(
'data' => getLastPosts($latestPostOptions),
'expires' => time() + 60,
'post_retri_eval' => '
foreach ($cache_block[\'data\'] as $k => $post)
{
$cache_block[\'data\'][$k][\'time\'] = timeformat($post[\'raw_timestamp\']);
$cache_block[\'data\'][$k][\'timestamp\'] = forum_time(true, $post[\'raw_timestamp\']);
}'
,
);
}


?>



I was told the error had to do with this line
Quote
'protected' => in_array($post['board'], $user_info['view_only_boards']), //- View Only Boards MOD-

Because $post doesn't exist.

jimmyboy88

Hi guys
Can anyone verify that this will work on 1.1.8? after i upgraded to smf 1.1.8, the next day my members reported that one of my board is not accessible anymore. i am using global permission and this board is open to all (including guests and members).

i tried downgrading to 1.1.7 and the problem still exists...

used to be fine
pls help!

searchgr

Confirmed. It works on 1.1.8.

searchgr

Rudolf, when will be the next update?

Advertisement: