Slateer - temat główny :E

Zaczęty przez AlexX, 31 Październik 2009, 00:16

0 użytkowników i 1 Gość przegląda ten wątek.

jareQ

Spróbuj teraz.

<?php
// Version: 2.0 RC1; BoardIndex

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

// Show some statistics if stat info is off.
if (!$settings['show_stats_index'])
echo '
<p id="stats">
'
, $txt['members'], ': ', $context['common_stats']['total_members'], ' &nbsp;&#38;#8226;&nbsp; ', $txt['posts_made'], ': ', $context['common_stats']['total_posts'], ' &nbsp;&#38;#8226;&nbsp; ', $txt['topics'], ': ', $context['common_stats']['total_topics'], '
'
, ($settings['show_latest_member'] ? '<br />' . $txt['welcome_member'] . ' <b>' . $context['common_stats']['latest_member']['link'] . '</b>' . $txt['newest_member'] : '') , '
</p>'
;

// Show the news fader?  (assuming there are things to show...)
if ($settings['show_newsfader'] && !empty($context['fader_news_lines']))
{
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
// Create the main header object.
var smfNewsFadeToggle = new smfToggle("smfNewsFadeScroller", '
, empty($options['collapse_news_fader']) ? 'false' : 'true', ');
smfNewsFadeToggle.useCookie('
, $context['user']['is_guest'] ? 1 : 0, ');
smfNewsFadeToggle.setOptions("collapse_news_fader", "'
, $context['session_id'], '");
smfNewsFadeToggle.addToggleImage("newsupshrink", "/collapse.gif", "/expand.gif");
smfNewsFadeToggle.addTogglePanel("smfNewsFader");
// ]]></script>
<div class="tborder marginbottom">
<h3 id="newsfader" class="catbg headerpadding">
<a href="#" onclick="smfNewsFadeToggle.toggle(); return false;">
<img id="newsupshrink" src="'
, $settings['images_url'], '/', empty($options['collapse_news_fader']) ? 'collapse.gif' : 'expand.gif', '" alt="*" title="', $txt['upshrink_description'], '" align="bottom" />
</a>&nbsp;'
, $txt['news'], '
</h3>
<div id="smfNewsFader"'
, empty($options['collapse_news_fader']) ? '' : ' style="display: none;"', '>
<div id="smfFadeScroller"><span>'
, $context['news_lines'][0], '</span></div>
</div>
</div>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
// The fading delay (in ms.)
var smfFadeDelay = '
, empty($settings['newsfader_time']) ? 5000 : $settings['newsfader_time'], ';
// Fade from... what text color? To which background color?
var smfFadeFrom = {"r": 0, "g": 0, "b": 0}, smfFadeTo = {"r": 255, "g": 255, "b": 255};
// Surround each item with... anything special?
var smfFadeBefore = "<b>", smfFadeAfter = "</b>";

var foreColor, foreEl, backEl, backColor;

if (typeof(document.getElementById(\'smfFadeScroller\').currentStyle) != "undefined")
{
foreColor = document.getElementById(\'smfFadeScroller\').currentStyle.color.match(/#([\da-f][\da-f])([\da-f][\da-f])([\da-f][\da-f])/);
smfFadeFrom = {"r": parseInt(foreColor[1]), "g": parseInt(foreColor[2]), "b": parseInt(foreColor[3])};

backEl = document.getElementById(\'smfFadeScroller\');
while (backEl.currentStyle.backgroundColor == "transparent" && typeof(backEl.parentNode) != "undefined")
backEl = backEl.parentNode;

backColor = backEl.currentStyle.backgroundColor.match(/#([\da-f][\da-f])([\da-f][\da-f])([\da-f][\da-f])/);
smfFadeTo = {"r": eval("0x" + backColor[1]), "g": eval("0x" + backColor[2]), "b": eval("0x" + backColor[3])};
}
else if (typeof(window.opera) == "undefined" && typeof(document.defaultView) != "undefined")
{

foreEl = document.getElementById(\'smfFadeScroller\');

while (document.defaultView.getComputedStyle(foreEl, null).getPropertyCSSValue("color") == null && typeof(foreEl.parentNode) != "undefined" && typeof(foreEl.parentNode.tagName) != "undefined")
foreEl = foreEl.parentNode;

foreColor = document.defaultView.getComputedStyle(foreEl, null).getPropertyValue("color").match(/rgb\((\d+), (\d+), (\d+)\)/);
smfFadeFrom = {"r": parseInt(foreColor[1]), "g": parseInt(foreColor[2]), "b": parseInt(foreColor[3])};

backEl = document.getElementById(\'smfFadeScroller\');

while (document.defaultView.getComputedStyle(backEl, null).getPropertyCSSValue("background-color") == null && typeof(backEl.parentNode) != "undefined" && typeof(backEl.parentNode.tagName) != "undefined")
backEl = backEl.parentNode;

backColor = document.defaultView.getComputedStyle(backEl, null).getPropertyValue("background-color");//.match(/rgb\((\d+), (\d+), (\d+)\)/);
smfFadeTo = {"r": parseInt(backColor[1]), "g": parseInt(backColor[2]), "b": parseInt(backColor[3])};
}

// List all the lines of the news for display.
var smfFadeContent = new Array(
"'
, implode('",
"'
, $context['fader_news_lines']), '"
);
// ]]></script>
<script language="JavaScript" type="text/javascript" src="'
, $settings['default_theme_url'], '/scripts/fader.js"></script>';
}

/* Each category in categories is made up of:
id, href, link, name, is_collapsed (is it collapsed?), can_collapse (is it okay if it is?),
new (is it new?), collapse_href (href to collapse/expand), collapse_image (up/down image),
and boards. (see below.) */
foreach ($context['categories'] as $category)
{
echo '
<div class="categoryframe tborder">
<h3 class="catbg'
, $category['new'] ? '2' : '', ' headerpadding">';

if (!$context['user']['is_guest'])
echo '
<a class="floatright" href="'
, $scripturl, '?action=unread;c=', $category['id'], '">', $txt['view_unread_category'], '</a>';

// If this category even can collapse, show a link to collapse it.
if ($category['can_collapse'])
echo '
<a href="'
, $category['collapse_href'], '">', $category['collapse_image'], '</a>&nbsp;';

echo $category['link'];

echo '
</h3>'
;

// Assuming the category hasn't been collapsed...
if (!$category['is_collapsed'])
{
echo '
<table cellspacing="1" class="bordercolor boardsframe">'
;

/* Each board in each category's boards has:
new (is it new?), id, name, description, moderators (see below), link_moderators (just a list.),
children (see below.), link_children (easier to use.), children_new (are they new?),
topics (# of), posts (# of), link, href, and last_post. (see below.) */
foreach ($category['boards'] as $board)
{
echo '
<tr>
<td'
, !empty($board['children']) ? ' rowspan="2"' : '', ' class="windowbg icon">
<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'], '/on', $board['new'] ? '' : '2', '.gif" alt="', $txt['new_posts'], '" title="', $txt['new_posts'], '" border="0" />';
// Is it a redirection board?
elseif ($board['is_redirect'])
echo '
<img src="'
, $settings['images_url'], '/redirect.gif" alt="*" title="*" border="0" />';
// No new posts at all! The agony!!
else
echo '
<img src="'
, $settings['images_url'], '/off.gif" alt="', $txt['old_posts'], '" title="', $txt['old_posts'], '" />';

echo '
</a>
</td>
<td class="windowbg2 info">
<h4><a 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'] > $board['unapproved_posts'] ? '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 '
</h4>
<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']) == 1 ? $txt['moderator'] : $txt['moderators'], ': ', implode(', ', $board['link_moderators']), '</p>';

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

/* 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 '
<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'];
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']))
{
// 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'] . '" title="' . ($child['new'] ? $txt['new_posts'] : $txt['old_posts']) . ' (' . $txt['board_topics'] . ': ' . $child['topics'] . ', ' . $txt['posts'] . ': ' . $child['posts'] . ')">' . $child['name'] . '</a>';
else
$child['link'] = '<a href="' . $child['href'] . '" title="' . $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'] > $child['unapproved_posts'] ? '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>
<td class="windowbg3 smalltext largepadding"><strong>'
, $txt['parent_boards'], '</strong>: ', implode(', ', $children), '</td>
</tr>'
;
}
}
echo '
</table>'
;
}
echo '
</div>'
;
}

if ($context['user']['is_logged'])
{
echo '
<div id="posticons" class="clearfix marginbottom">
<div class="smalltext floatleft headerpadding">
<img src="'
. $settings['images_url'] . '/new_some.gif" alt="" align="middle" /> ', $txt['new_posts'], '
<img src="'
. $settings['images_url'] . '/new_none.gif" alt="" align="middle" style="margin-left: 4ex;" /> ', $txt['old_posts'], '
</div>'
;

// Mark read button.
$mark_read_button = array(
'markread' => array('text' => 'mark_as_read', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=all;' . $context['session_var'] . '=' . $context['session_id']),
);


// Show the mark all as read button?
if ($settings['show_mark_read'] && !empty($context['categories']))
template_button_strip($mark_read_button, 'top');

echo '
</div>'
;
}

template_info_center();
}

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

// Info center collapse object.
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
// And create the info center object.
var infoHeader = new smfToggle("upshrinkIC", '
, empty($options['collapse_header_ic']) ? 'false' : 'true', ');
infoHeader.useCookie('
, $context['user']['is_guest'] ? 1 : 0, ');
infoHeader.setOptions("collapse_header_ic", "'
, $context['session_id'], '");
infoHeader.addToggleImage("upshrink_ic", "/collapse.gif", "/expand.gif");
infoHeader.addTogglePanel("upshrinkHeaderIC");
// ]]></script>'
;

  echo
'<center><div class="tborder" style="margin-top: 0; text-align: center;">
<div class="catbg" style="padding: 5px 5px 5px 10px;">
 <center>.:: Shoutbox ::.</center>
</div>
<table border="0" width="70%" cellspacing="1" cellpadding="5" class="bordercolor" style="margin-top: 1px;">
 <tr>
  <td class="windowbg">
<div id="yshout"'
, empty($options['collapse_header']) ? '>' : ' style="display: none;">',$txt['yshout_loading'],'</div>
<div class="smalltext" style="padding-left:25px;"><a href="javascript:collapse1.slidedown()">Pokaż Emotki</a> | <a href="javascript:collapse1.slideup()">Zamknij</a>'
;
                    require(
'mymod/smiley_SMF_2.php');
                   
loadSmileys();
                 echo
'
                    <div id="smiley_pic">'
;
                       
printSmileys('shout_form','shout_text');
                 echo
'
                    </div>
                    <script type="text/javascript">
                    //Syntax: var uniquevar=new animatedcollapse("DIV_id", animatetime_milisec, enablepersist(true/fase), [initialstate] )
                    var collapse1=new animatedcollapse("smiley_pic", 1000, false)
                    </script>
                 </div>
      </td>
 </tr>
</table>
   </div></center><br />'
;

  // Here's where the "Info Center" starts...
echo '
<div class="tborder clearfix" id="infocenterframe">
<h3 class="catbg headerpadding">
<a href="#" onclick="infoHeader.toggle(); return false;"><img id="upshrink_ic" src="'
, $settings['images_url'], '/', empty($options['collapse_header_ic']) ? 'collapse.gif' : 'expand.gif', '" alt="*" title="', $txt['upshrink_description'], '" style="margin-right: 2ex;" align="right" /></a>
'
, sprintf($txt['info_center_title'], $context['forum_name_html_safe']), '
</h3>
<div id="upshrinkHeaderIC"'
, empty($options['collapse_header_ic']) ? '' : ' style="display: none;"', '>';

// This is the "Recent Posts" bar.
if (!empty($settings['number_recent_posts']))
{
echo '
<div class="infocenter_section">
<h4 class="headerpadding titlebg">'
, $txt['recent_posts'], '</h4>
<div class="windowbg">
<p class="section">
<a href="'
, $scripturl, '?action=recent"><img src="', $settings['images_url'], '/post/xx.gif" alt="', $txt['recent_posts'], '" /></a>
</p>
<div class="windowbg2 sectionbody hslice clearfix" id="recent_posts_content"><div class="entry-title" style="display: none;">'
, $context['forum_name_html_safe'], ' - ', $txt['recent_posts'], '</div><div class="entry-content" style="display: none;"><a rel="feedurl" href="', $scripturl, '?action=.xml;type=webslice">', $txt['subscribe_webslice'], '</a></div>';

// Only show one post.
if ($settings['number_recent_posts'] == 1)
{
// latest_post has link, href, time, subject, short_subject (shortened with...), and topic. (its id.)
echo '
<strong><a href="'
, $scripturl, '?action=recent">', $txt['recent_posts'], '</a></strong>
<p id="infocenter_onepost" class="smalltext">
'
, $txt['recent_view'], ' &quot;', $context['latest_post']['link'], '&quot; ', $txt['recent_updated'], ' (', $context['latest_post']['time'], ')<br />
</p>'
;
}
// Show lots of posts.
elseif (!empty($context['latest_posts']))
{
echo '
<dl id="infocenter_recentposts" class="middletext">'
;

/* Each post in latest_posts has:
board (with an id, name, and link.), topic (the topic's id.), poster (with id, name, and link.),
subject, short_subject (shortened with...), time, link, and href. */
foreach ($context['latest_posts'] as $post)
echo '
<dt><strong>'
, $post['link'], '</strong> ', $txt['by'], ' ', $post['poster']['link'], ' (', $post['board']['link'], ')</dt>
<dd>'
, $post['time'], '</dd>';
echo '
</dl>'
;
}
echo '
</div>
</div>
</div>'
;
}

// Show information about events, birthdays, and holidays on the calendar.
if ($context['show_calendar'])
{
echo '
<div class="infocenter_section">
<h4 class="headerpadding titlebg">'
, $context['calendar_only_today'] ? $txt['calendar_today'] : $txt['calendar_upcoming'], '</h4>
<div class="windowbg">
<p class="section">
<a href="'
, $scripturl, '?action=calendar' . '"><img src="', $settings['images_url'], '/icons/calendar.gif', '" alt="', $context['calendar_only_today'] ? $txt['calendar_today'] : $txt['calendar_upcoming'], '" /></a>
</p>
<div class="sectionbody windowbg2 middletext">'
;

// Holidays like "Christmas", "Chanukah", and "We Love [Unknown] Day" :P.
if (!empty($context['calendar_holidays']))
echo '
<span class="holiday">'
, $txt['calendar_prompt'], ' ', implode(', ', $context['calendar_holidays']), '</span><br />';

// People's birthdays. Like mine. And yours, I guess. Kidding.
if (!empty($context['calendar_birthdays']))
{
echo '
<span class="birthday">'
, $context['calendar_only_today'] ? $txt['birthdays'] : $txt['birthdays_upcoming'], '</span> ';
/* Each member in calendar_birthdays has:
id, name (person), age (if they have one set?), is_last. (last in list?), and is_today (birthday is today?) */
foreach ($context['calendar_birthdays'] as $member)
echo '
<a href="'
, $scripturl, '?action=profile;u=', $member['id'], '">', $member['is_today'] ? '<b>' : '', (!empty($member['colored_name']) ? $member['colored_name'] : $member['name']), $member['is_today'] ? '</b>' : '', isset($member['age']) ? ' (' . $member['age'] . ')' : '', '</a>', $member['is_last'] ? '' : ', ';
}
// Events like community get-togethers.
if (!empty($context['calendar_events']))
{
echo '
<span class="event">'
, $context['calendar_only_today'] ? $txt['events'] : $txt['events_upcoming'], '</span> ';
/* Each event in calendar_events should have:
title, href, is_last, can_edit (are they allowed?), modify_href, and is_today. */
foreach ($context['calendar_events'] as $event)
echo '
'
, $event['can_edit'] ? '<a href="' . $event['modify_href'] . '" style="color: #FF0000;">*</a> ' : '', $event['href'] == '' ? '' : '<a href="' . $event['href'] . '">', $event['is_today'] ? '<b>' . $event['title'] . '</b>' : $event['title'], $event['href'] == '' ? '' : '</a>', $event['is_last'] ? '<br />' : ', ';

// Show a little help text to help them along ;).
if ($context['calendar_can_edit'])
echo '
(<a href="'
, $scripturl, '?action=helpadmin;help=calendar_how_edit" onclick="return reqWin(this.href);">', $txt['calendar_how_edit'], '</a>)';
}
echo '
</div>
</div>
</div>'
;
}


// Show statistical style information...
if ($settings['show_stats_index'])
{
echo '
<div class="infocenter_section">
<h4 class="headerpadding titlebg">'
, $txt['forum_stats'], '</h4>
<div class="windowbg">
<p class="section">
<a href="'
, $scripturl, '?action=stats"><img src="', $settings['images_url'], '/icons/info.gif" alt="', $txt['forum_stats'], '" /></a>
</p>
<div class="windowbg2 sectionbody middletext">
'
, $context['common_stats']['total_posts'], ' ', $txt['posts_made'], ' ', $txt['in'], ' ', $context['common_stats']['total_topics'], ' ', $txt['topics'], ' ', $txt['by'], ' ', $context['common_stats']['total_members'], ' ', $txt['members'], '. ', !empty($settings['show_latest_member']) ? $txt['latest_member'] . ': <b> ' . $context['common_stats']['latest_member']['link'] . '</b>' : '', '<br />
'
, (!empty($context['latest_post']) ? $txt['latest_post'] . ': <b>&quot;' . $context['latest_post']['link'] . '&quot;</b>  ( ' . $context['latest_post']['time'] . ' )<br />' : ''), '
<a href="'
, $scripturl, '?action=recent">', $txt['recent_view'], '</a>', $context['show_stats'] ? '<br />
<a href="'
. $scripturl . '?action=stats">' . $txt['more_stats'] . '</a>' : '', '
</div>
</div>
</div>'
;
}

// "Users online" - in order of activity.
echo '
<div class="infocenter_section">
<h4 class="headerpadding titlebg">'
, $txt['online_users'], '</h4>
<div class="windowbg">
<p class="section">
'
, $context['show_who'] ? '<a href="' . $scripturl . '?action=who' . '">' : '', '<img src="', $settings['images_url'], '/icons/online.gif', '" alt="', $txt['online_users'], '" />', $context['show_who'] ? '</a>' : '', '
</p>
<div class="windowbg2 sectionbody">
'
, $context['show_who'] ? '<a href="' . $scripturl . '?action=who">' : '', $context['num_guests'], ' ', $context['num_guests'] == 1 ? $txt['guest'] : $txt['guests'], ', ' . $context['num_users_online'], ' ', $context['num_users_online'] == 1 ? $txt['user'] : $txt['users'];

// Handle hidden users and buddies.
$bracketList = array();
if ($context['show_buddies'])
$bracketList[] = $context['num_buddies'] . ' ' . ($context['num_buddies'] == 1 ? $txt['buddy'] : $txt['buddies']);
if (!empty($context['num_spiders']))
$bracketList[] = $context['num_spiders'] . ' ' . ($context['num_spiders'] == 1 ? $txt['spider'] : $txt['spiders']);
if (!empty($context['num_users_hidden']))
$bracketList[] = $context['num_users_hidden'] . ' ' . $txt['hidden'];

if (!empty($bracketList))
echo ' (' . implode(', ', $bracketList) . ')';

echo $context['show_who'] ? '</a>' : '', '
<div class="smalltext">'
;

// Assuming there ARE users online... each user in users_online has an id, username, name, group, href, and link.
if (!empty($context['users_online']))
{
echo '
'
, sprintf($txt['users_active'], $modSettings['lastActive']), ':<br />', implode(', ', $context['list_users_online']);

// Showing membergroups?
if (!empty($context['membergroups']))
echo '<div style="padding-top: 2px; margin-top: 2px; border-top: 1px solid #c6c6c6;">
['
. implode(']&nbsp;&nbsp;[', $context['membergroups']) . ']', '</div>';
}

echo '
</div>
<hr class="hrcolor" />
<div class="smalltext">
'
, $txt['most_online_today'], ': <b>', $modSettings['mostOnlineToday'], '</b>.
'
, $txt['most_online_ever'], ': ', $modSettings['mostOnline'], ' (' , timeformat($modSettings['mostDate']), ')
</div>
</div>
</div>
</div>'
;

// If they are logged in, but statistical information is off... show a personal message bar.
if ($context['user']['is_logged'] && !$settings['show_stats_index'])
{
echo '
<div class="infocenter_section">
<h4 class="headerpadding titlebg">'
, $txt['personal_message'], '</h4>
<div class="windowbg">
<p class="section">
'
, $context['allow_pm'] ? '<a href="' . $scripturl . '?action=pm">' : '', '<img src="', $settings['images_url'], '/message_sm.gif" alt="', $txt['personal_message'], '" />', $context['allow_pm'] ? '</a>' : '', '
</p>
<div class="windowbg2 sectionbody">
<strong><a href="'
, $scripturl, '?action=pm">', $txt['personal_message'], '</a></strong>
<div class="smalltext">
'
, $txt['you_have'], ' ', $context['user']['messages'], ' ', $context['user']['messages'] == 1 ? $txt['message_lowercase'] : $txt['msg_alert_messages'], '.... ', $txt['click'], ' <a href="', $scripturl, '?action=pm">', $txt['here'], '</a> ', $txt['to_view'], '
</div>
</div>
</div>
</div>'
;
}

// Show the login bar. (it's only true if they are logged out anyway.)
if ($context['show_login_bar'])
{
echo '
<div class="infocenter_section">
<h4 class="headerpadding titlebg">'
, $txt['login'], ' <a href="', $scripturl, '?action=reminder" class="smalltext">', $txt['forgot_your_password'], '</a></h4>
<div class="windowbg">
<p class="section">
<a href="'
, $scripturl,  '?action=login"><img src="', $settings['images_url'], '/icons/login.gif', '" alt="', $txt['login'], '" /></a>
</p>
<div class="windowbg2 sectionbody">
<form id="infocenter_login" action="'
, $scripturl, '?action=login2" method="post" accept-charset="', $context['character_set'], '">
<ul class="horizlist clearfix">
<li>
<label for="user">'
, $txt['username'], ':<br />
<input type="text" name="user" id="user" size="15" /></label>
</li>
<li>
<label for="passwrd">'
, $txt['password'], ':<br />
<input type="password" name="passwrd" id="passwrd" size="15" /></label>
</li>
<li>
<label for="cookielength">'
, $txt['mins_logged_in'], ':<br />
<input type="text" name="cookielength" id="cookielength" size="4" maxlength="4" value="'
, $modSettings['cookieTime'], '" /></label>
</li>
<li>
<label for="cookieneverexp">'
, $txt['always_logged_in'], ':<br />
<input type="checkbox" name="cookieneverexp" id="cookieneverexp" checked="checked" class="check" /></label>
</li>
<li>
<input type="submit" value="'
, $txt['login'], '" />
</li>
</ul>
</form>
</div>
</div>
</div>'
;
}
echo '
</div>
</div>'
;
}
?>
"Wszystkie sekrety zostaną poznane, kluczem jest czas.."

AlexX

#16
jeszcze nie to...



a ma wygladac tak:


jareQ

<?php
// Version: 2.0 RC1; BoardIndex

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

// Show some statistics if stat info is off.
if (!$settings['show_stats_index'])
echo '
<p id="stats">
'
, $txt['members'], ': ', $context['common_stats']['total_members'], ' &nbsp;&#38;#38;#8226;&nbsp; ', $txt['posts_made'], ': ', $context['common_stats']['total_posts'], ' &nbsp;&#38;#38;#8226;&nbsp; ', $txt['topics'], ': ', $context['common_stats']['total_topics'], '
'
, ($settings['show_latest_member'] ? '<br />' . $txt['welcome_member'] . ' <b>' . $context['common_stats']['latest_member']['link'] . '</b>' . $txt['newest_member'] : '') , '
</p>'
;

// Show the news fader?  (assuming there are things to show...)
if ($settings['show_newsfader'] && !empty($context['fader_news_lines']))
{
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
// Create the main header object.
var smfNewsFadeToggle = new smfToggle("smfNewsFadeScroller", '
, empty($options['collapse_news_fader']) ? 'false' : 'true', ');
smfNewsFadeToggle.useCookie('
, $context['user']['is_guest'] ? 1 : 0, ');
smfNewsFadeToggle.setOptions("collapse_news_fader", "'
, $context['session_id'], '");
smfNewsFadeToggle.addToggleImage("newsupshrink", "/collapse.gif", "/expand.gif");
smfNewsFadeToggle.addTogglePanel("smfNewsFader");
// ]]></script>
<div class="tborder marginbottom">
<h3 id="newsfader" class="catbg headerpadding">
<a href="#" onclick="smfNewsFadeToggle.toggle(); return false;">
<img id="newsupshrink" src="'
, $settings['images_url'], '/', empty($options['collapse_news_fader']) ? 'collapse.gif' : 'expand.gif', '" alt="*" title="', $txt['upshrink_description'], '" align="bottom" />
</a>&nbsp;'
, $txt['news'], '
</h3>
<div id="smfNewsFader"'
, empty($options['collapse_news_fader']) ? '' : ' style="display: none;"', '>
<div id="smfFadeScroller"><span>'
, $context['news_lines'][0], '</span></div>
</div>
</div>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
// The fading delay (in ms.)
var smfFadeDelay = '
, empty($settings['newsfader_time']) ? 5000 : $settings['newsfader_time'], ';
// Fade from... what text color? To which background color?
var smfFadeFrom = {"r": 0, "g": 0, "b": 0}, smfFadeTo = {"r": 255, "g": 255, "b": 255};
// Surround each item with... anything special?
var smfFadeBefore = "<b>", smfFadeAfter = "</b>";

var foreColor, foreEl, backEl, backColor;

if (typeof(document.getElementById(\'smfFadeScroller\').currentStyle) != "undefined")
{
foreColor = document.getElementById(\'smfFadeScroller\').currentStyle.color.match(/#([\da-f][\da-f])([\da-f][\da-f])([\da-f][\da-f])/);
smfFadeFrom = {"r": parseInt(foreColor[1]), "g": parseInt(foreColor[2]), "b": parseInt(foreColor[3])};

backEl = document.getElementById(\'smfFadeScroller\');
while (backEl.currentStyle.backgroundColor == "transparent" && typeof(backEl.parentNode) != "undefined")
backEl = backEl.parentNode;

backColor = backEl.currentStyle.backgroundColor.match(/#([\da-f][\da-f])([\da-f][\da-f])([\da-f][\da-f])/);
smfFadeTo = {"r": eval("0x" + backColor[1]), "g": eval("0x" + backColor[2]), "b": eval("0x" + backColor[3])};
}
else if (typeof(window.opera) == "undefined" && typeof(document.defaultView) != "undefined")
{

foreEl = document.getElementById(\'smfFadeScroller\');

while (document.defaultView.getComputedStyle(foreEl, null).getPropertyCSSValue("color") == null && typeof(foreEl.parentNode) != "undefined" && typeof(foreEl.parentNode.tagName) != "undefined")
foreEl = foreEl.parentNode;

foreColor = document.defaultView.getComputedStyle(foreEl, null).getPropertyValue("color").match(/rgb\((\d+), (\d+), (\d+)\)/);
smfFadeFrom = {"r": parseInt(foreColor[1]), "g": parseInt(foreColor[2]), "b": parseInt(foreColor[3])};

backEl = document.getElementById(\'smfFadeScroller\');

while (document.defaultView.getComputedStyle(backEl, null).getPropertyCSSValue("background-color") == null && typeof(backEl.parentNode) != "undefined" && typeof(backEl.parentNode.tagName) != "undefined")
backEl = backEl.parentNode;

backColor = document.defaultView.getComputedStyle(backEl, null).getPropertyValue("background-color");//.match(/rgb\((\d+), (\d+), (\d+)\)/);
smfFadeTo = {"r": parseInt(backColor[1]), "g": parseInt(backColor[2]), "b": parseInt(backColor[3])};
}

// List all the lines of the news for display.
var smfFadeContent = new Array(
"'
, implode('",
"'
, $context['fader_news_lines']), '"
);
// ]]></script>
<script language="JavaScript" type="text/javascript" src="'
, $settings['default_theme_url'], '/scripts/fader.js"></script>';
}

/* Each category in categories is made up of:
id, href, link, name, is_collapsed (is it collapsed?), can_collapse (is it okay if it is?),
new (is it new?), collapse_href (href to collapse/expand), collapse_image (up/down image),
and boards. (see below.) */
foreach ($context['categories'] as $category)
{
echo '
<div class="categoryframe tborder">
<h3 class="catbg'
, $category['new'] ? '2' : '', ' headerpadding">';

if (!$context['user']['is_guest'])
echo '
<a class="floatright" href="'
, $scripturl, '?action=unread;c=', $category['id'], '">', $txt['view_unread_category'], '</a>';

// If this category even can collapse, show a link to collapse it.
if ($category['can_collapse'])
echo '
<a href="'
, $category['collapse_href'], '">', $category['collapse_image'], '</a>&nbsp;';

echo $category['link'];

echo '
</h3>'
;

// Assuming the category hasn't been collapsed...
if (!$category['is_collapsed'])
{
echo '
<table cellspacing="1" class="bordercolor boardsframe">'
;

/* Each board in each category's boards has:
new (is it new?), id, name, description, moderators (see below), link_moderators (just a list.),
children (see below.), link_children (easier to use.), children_new (are they new?),
topics (# of), posts (# of), link, href, and last_post. (see below.) */
foreach ($category['boards'] as $board)
{
echo '
<tr>
<td'
, !empty($board['children']) ? ' rowspan="2"' : '', ' class="windowbg icon">
<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'], '/on', $board['new'] ? '' : '2', '.gif" alt="', $txt['new_posts'], '" title="', $txt['new_posts'], '" border="0" />';
// Is it a redirection board?
elseif ($board['is_redirect'])
echo '
<img src="'
, $settings['images_url'], '/redirect.gif" alt="*" title="*" border="0" />';
// No new posts at all! The agony!!
else
echo '
<img src="'
, $settings['images_url'], '/off.gif" alt="', $txt['old_posts'], '" title="', $txt['old_posts'], '" />';

echo '
</a>
</td>
<td class="windowbg2 info">
<h4><a 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'] > $board['unapproved_posts'] ? '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 '
</h4>
<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']) == 1 ? $txt['moderator'] : $txt['moderators'], ': ', implode(', ', $board['link_moderators']), '</p>';

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

/* 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 '
<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'];
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']))
{
// 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'] . '" title="' . ($child['new'] ? $txt['new_posts'] : $txt['old_posts']) . ' (' . $txt['board_topics'] . ': ' . $child['topics'] . ', ' . $txt['posts'] . ': ' . $child['posts'] . ')">' . $child['name'] . '</a>';
else
$child['link'] = '<a href="' . $child['href'] . '" title="' . $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'] > $child['unapproved_posts'] ? '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>
<td class="windowbg3 smalltext largepadding"><strong>'
, $txt['parent_boards'], '</strong>: ', implode(', ', $children), '</td>
</tr>'
;
}
}
echo '
</table>'
;
}
echo '
</div>'
;
}

if ($context['user']['is_logged'])
{
echo '
<div id="posticons" class="clearfix marginbottom">
<div class="smalltext floatleft headerpadding">
<img src="'
. $settings['images_url'] . '/new_some.gif" alt="" align="middle" /> ', $txt['new_posts'], '
<img src="'
. $settings['images_url'] . '/new_none.gif" alt="" align="middle" style="margin-left: 4ex;" /> ', $txt['old_posts'], '
</div>'
;

// Mark read button.
$mark_read_button = array(
'markread' => array('text' => 'mark_as_read', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=all;' . $context['session_var'] . '=' . $context['session_id']),
);


// Show the mark all as read button?
if ($settings['show_mark_read'] && !empty($context['categories']))
template_button_strip($mark_read_button, 'top');

echo '
</div>'
;
}

template_info_center();
}

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

// Info center collapse object.
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
// And create the info center object.
var infoHeader = new smfToggle("upshrinkIC", '
, empty($options['collapse_header_ic']) ? 'false' : 'true', ');
infoHeader.useCookie('
, $context['user']['is_guest'] ? 1 : 0, ');
infoHeader.setOptions("collapse_header_ic", "'
, $context['session_id'], '");
infoHeader.addToggleImage("upshrink_ic", "/collapse.gif", "/expand.gif");
infoHeader.addTogglePanel("upshrinkHeaderIC");
// ]]></script>'
;

  echo
'<table align="center" width="80%"><tr><td><div class="tborder" style="margin-top: 0;">
<div class="catbg" style="padding: 5px 5px 5px 10px;">
 <center>.:: Shoutbox ::.</center>
</div>
<table border="0" width="70%" cellspacing="1" cellpadding="5" class="bordercolor" style="margin-top: 1px;">
 <tr>
  <td class="windowbg">
<div id="yshout"'
, empty($options['collapse_header']) ? '>' : ' style="display: none;">',$txt['yshout_loading'],'</div>
<div class="smalltext" style="padding-left:25px;"><a href="javascript:collapse1.slidedown()">Pokaż Emotki</a> | <a href="javascript:collapse1.slideup()">Zamknij</a>'
;
                    require(
'mymod/smiley_SMF_2.php');
                   
loadSmileys();
                 echo
'
                    <div id="smiley_pic">'
;
                       
printSmileys('shout_form','shout_text');
                 echo
'
                    </div>
                    <script type="text/javascript">
                    //Syntax: var uniquevar=new animatedcollapse("DIV_id", animatetime_milisec, enablepersist(true/fase), [initialstate] )
                    var collapse1=new animatedcollapse("smiley_pic", 1000, false)
                    </script>
                 </div>
      </td>
 </tr>
</table>
   </div></td></tr></table>><br />'
;

  // Here's where the "Info Center" starts...
echo '
<div class="tborder clearfix" id="infocenterframe">
<h3 class="catbg headerpadding">
<a href="#" onclick="infoHeader.toggle(); return false;"><img id="upshrink_ic" src="'
, $settings['images_url'], '/', empty($options['collapse_header_ic']) ? 'collapse.gif' : 'expand.gif', '" alt="*" title="', $txt['upshrink_description'], '" style="margin-right: 2ex;" align="right" /></a>
'
, sprintf($txt['info_center_title'], $context['forum_name_html_safe']), '
</h3>
<div id="upshrinkHeaderIC"'
, empty($options['collapse_header_ic']) ? '' : ' style="display: none;"', '>';

// This is the "Recent Posts" bar.
if (!empty($settings['number_recent_posts']))
{
echo '
<div class="infocenter_section">
<h4 class="headerpadding titlebg">'
, $txt['recent_posts'], '</h4>
<div class="windowbg">
<p class="section">
<a href="'
, $scripturl, '?action=recent"><img src="', $settings['images_url'], '/post/xx.gif" alt="', $txt['recent_posts'], '" /></a>
</p>
<div class="windowbg2 sectionbody hslice clearfix" id="recent_posts_content"><div class="entry-title" style="display: none;">'
, $context['forum_name_html_safe'], ' - ', $txt['recent_posts'], '</div><div class="entry-content" style="display: none;"><a rel="feedurl" href="', $scripturl, '?action=.xml;type=webslice">', $txt['subscribe_webslice'], '</a></div>';

// Only show one post.
if ($settings['number_recent_posts'] == 1)
{
// latest_post has link, href, time, subject, short_subject (shortened with...), and topic. (its id.)
echo '
<strong><a href="'
, $scripturl, '?action=recent">', $txt['recent_posts'], '</a></strong>
<p id="infocenter_onepost" class="smalltext">
'
, $txt['recent_view'], ' &quot;', $context['latest_post']['link'], '&quot; ', $txt['recent_updated'], ' (', $context['latest_post']['time'], ')<br />
</p>'
;
}
// Show lots of posts.
elseif (!empty($context['latest_posts']))
{
echo '
<dl id="infocenter_recentposts" class="middletext">'
;

/* Each post in latest_posts has:
board (with an id, name, and link.), topic (the topic's id.), poster (with id, name, and link.),
subject, short_subject (shortened with...), time, link, and href. */
foreach ($context['latest_posts'] as $post)
echo '
<dt><strong>'
, $post['link'], '</strong> ', $txt['by'], ' ', $post['poster']['link'], ' (', $post['board']['link'], ')</dt>
<dd>'
, $post['time'], '</dd>';
echo '
</dl>'
;
}
echo '
</div>
</div>
</div>'
;
}

// Show information about events, birthdays, and holidays on the calendar.
if ($context['show_calendar'])
{
echo '
<div class="infocenter_section">
<h4 class="headerpadding titlebg">'
, $context['calendar_only_today'] ? $txt['calendar_today'] : $txt['calendar_upcoming'], '</h4>
<div class="windowbg">
<p class="section">
<a href="'
, $scripturl, '?action=calendar' . '"><img src="', $settings['images_url'], '/icons/calendar.gif', '" alt="', $context['calendar_only_today'] ? $txt['calendar_today'] : $txt['calendar_upcoming'], '" /></a>
</p>
<div class="sectionbody windowbg2 middletext">'
;

// Holidays like "Christmas", "Chanukah", and "We Love [Unknown] Day" :P.
if (!empty($context['calendar_holidays']))
echo '
<span class="holiday">'
, $txt['calendar_prompt'], ' ', implode(', ', $context['calendar_holidays']), '</span><br />';

// People's birthdays. Like mine. And yours, I guess. Kidding.
if (!empty($context['calendar_birthdays']))
{
echo '
<span class="birthday">'
, $context['calendar_only_today'] ? $txt['birthdays'] : $txt['birthdays_upcoming'], '</span> ';
/* Each member in calendar_birthdays has:
id, name (person), age (if they have one set?), is_last. (last in list?), and is_today (birthday is today?) */
foreach ($context['calendar_birthdays'] as $member)
echo '
<a href="'
, $scripturl, '?action=profile;u=', $member['id'], '">', $member['is_today'] ? '<b>' : '', (!empty($member['colored_name']) ? $member['colored_name'] : $member['name']), $member['is_today'] ? '</b>' : '', isset($member['age']) ? ' (' . $member['age'] . ')' : '', '</a>', $member['is_last'] ? '' : ', ';
}
// Events like community get-togethers.
if (!empty($context['calendar_events']))
{
echo '
<span class="event">'
, $context['calendar_only_today'] ? $txt['events'] : $txt['events_upcoming'], '</span> ';
/* Each event in calendar_events should have:
title, href, is_last, can_edit (are they allowed?), modify_href, and is_today. */
foreach ($context['calendar_events'] as $event)
echo '
'
, $event['can_edit'] ? '<a href="' . $event['modify_href'] . '" style="color: #FF0000;">*</a> ' : '', $event['href'] == '' ? '' : '<a href="' . $event['href'] . '">', $event['is_today'] ? '<b>' . $event['title'] . '</b>' : $event['title'], $event['href'] == '' ? '' : '</a>', $event['is_last'] ? '<br />' : ', ';

// Show a little help text to help them along ;).
if ($context['calendar_can_edit'])
echo '
(<a href="'
, $scripturl, '?action=helpadmin;help=calendar_how_edit" onclick="return reqWin(this.href);">', $txt['calendar_how_edit'], '</a>)';
}
echo '
</div>
</div>
</div>'
;
}


// Show statistical style information...
if ($settings['show_stats_index'])
{
echo '
<div class="infocenter_section">
<h4 class="headerpadding titlebg">'
, $txt['forum_stats'], '</h4>
<div class="windowbg">
<p class="section">
<a href="'
, $scripturl, '?action=stats"><img src="', $settings['images_url'], '/icons/info.gif" alt="', $txt['forum_stats'], '" /></a>
</p>
<div class="windowbg2 sectionbody middletext">
'
, $context['common_stats']['total_posts'], ' ', $txt['posts_made'], ' ', $txt['in'], ' ', $context['common_stats']['total_topics'], ' ', $txt['topics'], ' ', $txt['by'], ' ', $context['common_stats']['total_members'], ' ', $txt['members'], '. ', !empty($settings['show_latest_member']) ? $txt['latest_member'] . ': <b> ' . $context['common_stats']['latest_member']['link'] . '</b>' : '', '<br />
'
, (!empty($context['latest_post']) ? $txt['latest_post'] . ': <b>&quot;' . $context['latest_post']['link'] . '&quot;</b>  ( ' . $context['latest_post']['time'] . ' )<br />' : ''), '
<a href="'
, $scripturl, '?action=recent">', $txt['recent_view'], '</a>', $context['show_stats'] ? '<br />
<a href="'
. $scripturl . '?action=stats">' . $txt['more_stats'] . '</a>' : '', '
</div>
</div>
</div>'
;
}

// "Users online" - in order of activity.
echo '
<div class="infocenter_section">
<h4 class="headerpadding titlebg">'
, $txt['online_users'], '</h4>
<div class="windowbg">
<p class="section">
'
, $context['show_who'] ? '<a href="' . $scripturl . '?action=who' . '">' : '', '<img src="', $settings['images_url'], '/icons/online.gif', '" alt="', $txt['online_users'], '" />', $context['show_who'] ? '</a>' : '', '
</p>
<div class="windowbg2 sectionbody">
'
, $context['show_who'] ? '<a href="' . $scripturl . '?action=who">' : '', $context['num_guests'], ' ', $context['num_guests'] == 1 ? $txt['guest'] : $txt['guests'], ', ' . $context['num_users_online'], ' ', $context['num_users_online'] == 1 ? $txt['user'] : $txt['users'];

// Handle hidden users and buddies.
$bracketList = array();
if ($context['show_buddies'])
$bracketList[] = $context['num_buddies'] . ' ' . ($context['num_buddies'] == 1 ? $txt['buddy'] : $txt['buddies']);
if (!empty($context['num_spiders']))
$bracketList[] = $context['num_spiders'] . ' ' . ($context['num_spiders'] == 1 ? $txt['spider'] : $txt['spiders']);
if (!empty($context['num_users_hidden']))
$bracketList[] = $context['num_users_hidden'] . ' ' . $txt['hidden'];

if (!empty($bracketList))
echo ' (' . implode(', ', $bracketList) . ')';

echo $context['show_who'] ? '</a>' : '', '
<div class="smalltext">'
;

// Assuming there ARE users online... each user in users_online has an id, username, name, group, href, and link.
if (!empty($context['users_online']))
{
echo '
'
, sprintf($txt['users_active'], $modSettings['lastActive']), ':<br />', implode(', ', $context['list_users_online']);

// Showing membergroups?
if (!empty($context['membergroups']))
echo '<div style="padding-top: 2px; margin-top: 2px; border-top: 1px solid #c6c6c6;">
['
. implode(']&nbsp;&nbsp;[', $context['membergroups']) . ']', '</div>';
}

echo '
</div>
<hr class="hrcolor" />
<div class="smalltext">
'
, $txt['most_online_today'], ': <b>', $modSettings['mostOnlineToday'], '</b>.
'
, $txt['most_online_ever'], ': ', $modSettings['mostOnline'], ' (' , timeformat($modSettings['mostDate']), ')
</div>
</div>
</div>
</div>'
;

// If they are logged in, but statistical information is off... show a personal message bar.
if ($context['user']['is_logged'] && !$settings['show_stats_index'])
{
echo '
<div class="infocenter_section">
<h4 class="headerpadding titlebg">'
, $txt['personal_message'], '</h4>
<div class="windowbg">
<p class="section">
'
, $context['allow_pm'] ? '<a href="' . $scripturl . '?action=pm">' : '', '<img src="', $settings['images_url'], '/message_sm.gif" alt="', $txt['personal_message'], '" />', $context['allow_pm'] ? '</a>' : '', '
</p>
<div class="windowbg2 sectionbody">
<strong><a href="'
, $scripturl, '?action=pm">', $txt['personal_message'], '</a></strong>
<div class="smalltext">
'
, $txt['you_have'], ' ', $context['user']['messages'], ' ', $context['user']['messages'] == 1 ? $txt['message_lowercase'] : $txt['msg_alert_messages'], '.... ', $txt['click'], ' <a href="', $scripturl, '?action=pm">', $txt['here'], '</a> ', $txt['to_view'], '
</div>
</div>
</div>
</div>'
;
}

// Show the login bar. (it's only true if they are logged out anyway.)
if ($context['show_login_bar'])
{
echo '
<div class="infocenter_section">
<h4 class="headerpadding titlebg">'
, $txt['login'], ' <a href="', $scripturl, '?action=reminder" class="smalltext">', $txt['forgot_your_password'], '</a></h4>
<div class="windowbg">
<p class="section">
<a href="'
, $scripturl,  '?action=login"><img src="', $settings['images_url'], '/icons/login.gif', '" alt="', $txt['login'], '" /></a>
</p>
<div class="windowbg2 sectionbody">
<form id="infocenter_login" action="'
, $scripturl, '?action=login2" method="post" accept-charset="', $context['character_set'], '">
<ul class="horizlist clearfix">
<li>
<label for="user">'
, $txt['username'], ':<br />
<input type="text" name="user" id="user" size="15" /></label>
</li>
<li>
<label for="passwrd">'
, $txt['password'], ':<br />
<input type="password" name="passwrd" id="passwrd" size="15" /></label>
</li>
<li>
<label for="cookielength">'
, $txt['mins_logged_in'], ':<br />
<input type="text" name="cookielength" id="cookielength" size="4" maxlength="4" value="'
, $modSettings['cookieTime'], '" /></label>
</li>
<li>
<label for="cookieneverexp">'
, $txt['always_logged_in'], ':<br />
<input type="checkbox" name="cookieneverexp" id="cookieneverexp" checked="checked" class="check" /></label>
</li>
<li>
<input type="submit" value="'
, $txt['login'], '" />
</li>
</ul>
</form>
</div>
</div>
</div>'
;
}
echo '
</div>
</div>'
;
}
?>


Teraz powinno być ok.

ps. "kresek" nie robisz ?
"Wszystkie sekrety zostaną poznane, kluczem jest czas.."

AlexX

#18
WIELKIE DZIEKI

jest idealnie jak chcialem, a z paskow jednak zrezygnowalem, wiadomosci za duzo miejsca zajmowaly, ale i tak jeszcze raz wielkie dzieki

_______________________________

Mam jeszcze inne rzeczy do poprawki. =]

1. Chcialbym zeby goscie widzieli dzialy do ktorych nie moga wejsc, tutaj jest sposob:
http://www.smf.pl/index.php/topic,165.0.html

ale ja tego kodu:
$user_info[query_see_board]
na 100& nie mam

pierwsza czesc
<?php
/**********************************************************************************
* MessageIndex.php                                                                *
***********************************************************************************
* SMF: Simple Machines Forum                                                      *
* Open-Source Project Inspired by Zef Hemel (zef@zefhemel.com)                    *
* =============================================================================== *
* 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...');

/* This file is what shows the listing of topics in a board.  It's just one
function, but don't under estimate it ;).

void MessageIndex()
// !!!

void QuickModeration()
// !!!

*/

// Show the list of topics in this board, along with any child boards.
function MessageIndex()
{
global $txt, $scripturl, $board, $modSettings, $context;
global $options, $settings, $board_info, $user_info, $smcFunc, $sourcedir;

// If this is a redirection board head off.
if ($board_info['redirect'])
{
$smcFunc['db_query']('', '
UPDATE {db_prefix}boards
SET num_posts = num_posts + 1
WHERE id_board = {int:current_board}'
,
array(
'current_board' => $board,
)
);

redirectexit($board_info['redirect']);
}

if (WIRELESS)
$context['sub_template'] = WIRELESS_PROTOCOL . '_messageindex';
else
loadTemplate('MessageIndex', 'forum');

//Set some standard Variables for the MemberColorLink
$context['MemberColor_ID_MEMBER'] = array();
$context['name'] = $board_info['name'];
$context['description'] = $board_info['description'];
// How many topics do we have in total?
$board_info['total_topics'] = allowedTo('approve_posts') ? $board_info['num_topics'] + $board_info['unapproved_topics'] : $board_info['num_topics'] + $board_info['unapproved_user_topics'];

// View all the topics, or just a few?
$context['topics_per_page'] = empty($modSettings['disableCustomPerPage']) && !empty($options['topics_per_page']) && !WIRELESS ? $options['topics_per_page'] : $modSettings['defaultMaxTopics'];
$context['messages_per_page'] = empty($modSettings['disableCustomPerPage']) && !empty($options['messages_per_page']) && !WIRELESS ? $options['messages_per_page'] : $modSettings['defaultMaxMessages'];
$maxindex = isset($_REQUEST['all']) && !empty($modSettings['enableAllMessages']) ? $board_info['total_topics'] : $context['topics_per_page'];

// Right, let's only index normal stuff!
if (count($_GET) > 1)
foreach ($_GET as $k => $v)
{
if (!in_array($k, array('board', 'start', session_name())))
$context['robot_no_index'] = true;
}
if (!empty($_REQUEST['start']) && (!is_numeric($_REQUEST['start']) || $_REQUEST['start'] % $context['messages_per_page'] != 0))
$context['robot_no_index'] = true;

// If we can view unapproved messages and there are some build up a list.
if (allowedTo('approve_posts') && ($board_info['unapproved_topics'] || $board_info['unapproved_posts']))
{
$untopics = $board_info['unapproved_topics'] ? '<a href="' . $scripturl . '?action=moderate;area=postmod;sa=topics;brd=' . $board . '">' . $board_info['unapproved_topics'] . '</a>' : 0;
$unposts = $board_info['unapproved_posts'] ? '<a href="' . $scripturl . '?action=moderate;area=postmod;sa=posts;brd=' . $board . '">' . ($board_info['unapproved_posts'] - $board_info['unapproved_topics']) . '</a>' : 0;
$context['unapproved_posts_message'] = sprintf($txt['there_are_unapproved_topics'], $untopics, $unposts, $scripturl . '?action=moderate;area=postmod;sa=' . ($board_info['unapproved_topics'] ? 'topics' : 'posts') . ';brd=' . $board);
}

// Make sure the starting place makes sense and construct the page index.
if (isset($_REQUEST['sort']))
{
$context['page_index'] = constructPageIndex($scripturl . '?board=' . $board . '.%d;sort=' . $_REQUEST['sort'] . (isset($_REQUEST['desc']) ? ';desc' : ''), $_REQUEST['start'], $board_info['total_topics'], $maxindex, true);
}
else
$context['page_index'] = constructPageIndex($scripturl . '?board=' . $board . '.%d', $_REQUEST['start'], $board_info['total_topics'], $maxindex, true);
$context['start'] = &$_REQUEST['start'];

$context['links'] = array(
'first' => $_REQUEST['start'] >= $context['topics_per_page'] ? $scripturl . '?board=' . $board . '.0' : '',
'prev' => $_REQUEST['start'] >= $context['topics_per_page'] ? $scripturl . '?board=' . $board . '.' . ($_REQUEST['start'] - $context['topics_per_page']) : '',
'next' => $_REQUEST['start'] + $context['topics_per_page'] < $board_info['total_topics'] ? $scripturl . '?board=' . $board . '.' . ($_REQUEST['start'] + $context['topics_per_page']) : '',
'last' => $_REQUEST['start'] + $context['topics_per_page'] < $board_info['total_topics'] ? $scripturl . '?board=' . $board . '.' . (floor(($board_info['total_topics'] - 1) / $context['topics_per_page']) * $context['topics_per_page']) : '',
'up' => $board_info['parent'] == 0 ? $scripturl . '?' : $scripturl . '?board=' . $board_info['parent'] . '.0'
);

$context['page_info'] = array(
'current_page' => $_REQUEST['start'] / $context['topics_per_page'] + 1,
'num_pages' => floor(($board_info['total_topics'] - 1) / $context['topics_per_page']) + 1
);

if (isset($_REQUEST['all']) && !empty($modSettings['enableAllMessages']) && $maxindex > $modSettings['enableAllMessages'])
{
$maxindex = $modSettings['enableAllMessages'];
$_REQUEST['start'] = 0;
}

// Build a list of the board's moderators.
$context['moderators'] = &$board_info['moderators'];
$context['link_moderators'] = array();
if (!empty($board_info['moderators']))
{
//I hate it in this way... but what should i do ;)
if(!empty($modSettings['MemberColorModeratorLinks'])) {
foreach($board_info['moderators'] as $mod)
$c[$mod['id']] = $mod['id'];
$colorDatas = load_onlineColors($c);
foreach ($board_info['moderators'] as $mod)
$context['link_moderators'][] = str_replace($txt['profile_of'], $txt['board_moderator'], $colorDatas[$mod['id']]['colored_link']);
}
else
foreach ($board_info['moderators'] as $mod)
$context['link_moderators'][] = '<a href="' . $scripturl . '?action=profile;u=' . $mod['id'] . '" title="' . $txt['board_moderator'] . '">' . $mod['name'] . '</a>';

$context['linktree'][count($context['linktree']) - 1]['extra_after'] = ' (' . (count($context['link_moderators']) == 1 ? $txt['moderator'] : $txt['moderators']) . ': ' . implode(', ', $context['link_moderators']) . ')';

$context['linktree'][count($context['linktree']) - 1]['extra_after'] = ' (' . (count($context['link_moderators']) == 1 ? $txt['moderator'] : $txt['moderators']) . ': ' . implode(', ', $context['link_moderators']) . ')';
}

// Mark current and parent boards as seen.
if (!$user_info['is_guest'])
{
// We can't know they read it if we allow prefetches.
if (isset($_SERVER['HTTP_X_MOZ']) && $_SERVER['HTTP_X_MOZ'] == 'prefetch')
{
ob_end_clean();
header('HTTP/1.1 403 Prefetch Forbidden');
die;
}

$smcFunc['db_insert']('replace',
'{db_prefix}log_boards',
array('id_msg' => 'int', 'id_member' => 'int', 'id_board' => 'int'),
array($modSettings['maxMsgID'], $user_info['id'], $board),
array('id_member', 'id_board')
);

if (!empty($board_info['parent_boards']))
{
$smcFunc['db_query']('', '
UPDATE {db_prefix}log_boards
SET id_msg = {int:id_msg}
WHERE id_member = {int:current_member}
AND id_board IN ({array_int:board_list})'
,
array(
'current_member' => $user_info['id'],
'board_list' => array_keys($board_info['parent_boards']),
'id_msg' => $modSettings['maxMsgID'],
)
);

// We've seen all these boards now!
foreach ($board_info['parent_boards'] as $k => $dummy)
if (isset($_SESSION['topicseen_cache'][$k]))
unset($_SESSION['topicseen_cache'][$k]);
}

if (isset($_SESSION['topicseen_cache'][$board]))
unset($_SESSION['topicseen_cache'][$board]);

$request = $smcFunc['db_query']('', '
SELECT sent
FROM {db_prefix}log_notify
WHERE id_board = {int:current_board}
AND id_member = {int:current_member}
LIMIT 1'
,
array(
'current_board' => $board,
'current_member' => $user_info['id'],
)
);
$context['is_marked_notify'] = $smcFunc['db_num_rows']($request) != 0;
if ($context['is_marked_notify'])
{
list ($sent) = $smcFunc['db_fetch_row']($request);
if (!empty($sent))
{
$smcFunc['db_query']('', '
UPDATE {db_prefix}log_notify
SET sent = {int:is_sent}
WHERE id_board = {int:current_board}
AND id_member = {int:current_member}'
,
array(
'current_board' => $board,
'current_member' => $user_info['id'],
'is_sent' => 0,
)
);
}
}
$smcFunc['db_free_result']($request);
}
else
$context['is_marked_notify'] = false;

// 'Print' the header and board info.
$context['page_title'] = strip_tags($board_info['name']);

// Set the variables up for the template.
$context['can_mark_notify'] = allowedTo('mark_notify') && !$user_info['is_guest'];
$context['can_post_new'] = allowedTo('post_new') || ($modSettings['postmod_active'] && allowedTo('post_unapproved_topics'));
$context['can_post_poll'] = $modSettings['pollMode'] == '1' && allowedTo('poll_post');
$context['can_moderate_forum'] = allowedTo('moderate_forum');
$context['can_approve_posts'] = allowedTo('approve_posts');

require_once($sourcedir . '/Subs-BoardIndex.php');
$boardIndexOptions = array(
'include_categories' => false,
'base_level' => $board_info['child_level'] + 1,
'parent_id' => $board_info['id'],
'set_latest_post' => false,
'countChildPosts' => !empty($modSettings['countChildPosts']),
);
$context['boards'] = getBoardIndex($boardIndexOptions);

// Nosey, nosey - who's viewing this topic?
if (!empty($settings['display_who_viewing']))
{
$context['view_members'] = array();
$context['view_members_list'] = array();
$context['view_num_hidden'] = 0;

$request = $smcFunc['db_query']('', '
SELECT
lo.id_member, lo.log_time, mem.real_name, mem.member_name, mem.show_online,
mg.online_color, mg.id_group, mg.group_name
FROM {db_prefix}log_online AS lo
LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = lo.id_member)
LEFT JOIN {db_prefix}membergroups AS mg ON (mg.id_group = CASE WHEN mem.id_group = {int:reg_member_group} THEN mem.id_post_group ELSE mem.id_group END)
WHERE INSTR(lo.url, {string:in_url_string}) OR lo.session = {string:session}'
,
array(
'reg_member_group' => 0,
'in_url_string' => 's:5:"board";i:' . $board . ';',
'session' => $user_info['is_guest'] ? 'ip' . $user_info['ip'] : session_id(),
)
);
while ($row = $smcFunc['db_fetch_assoc']($request))
{
if (empty($row['id_member']))
continue;

if (!empty($row['online_color']) && !empty($modSettings['MemberColorWhoIsOnline']))
$link = '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '" style="color: ' . $row['online_color'] . ';">' . $row['real_name'] . '</a>';
else
$link = '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['real_name'] . '</a>';

$is_buddy = in_array($row['id_member'], $user_info['buddies']);
if ($is_buddy)
$link = '<b>' . $link . '</b>';

if (!empty($row['show_online']) || allowedTo('moderate_forum'))
$context['view_members_list'][$row['log_time'] . $row['member_name']] = empty($row['show_online']) ? '<i>' . $link . '</i>' : $link;
$context['view_members'][$row['log_time'] . $row['member_name']] = array(
'id' => $row['id_member'],
'username' => $row['member_name'],
'name' => $row['real_name'],
'group' => $row['id_group'],
'href' => $scripturl . '?action=profile;u=' . $row['id_member'],
'link' => $link,
'is_buddy' => $is_buddy,
'hidden' => empty($row['show_online']),
);

if (empty($row['show_online']))
$context['view_num_hidden']++;
}
$context['view_num_guests'] = $smcFunc['db_num_rows']($request) - count($context['view_members']);
$smcFunc['db_free_result']($request);

// Put them in "last clicked" order.
krsort($context['view_members_list']);
krsort($context['view_members']);
}

// Default sort methods.
$sort_methods = array(
'subject' => 'mf.subject',
'starter' => 'IFNULL(memf.real_name, mf.poster_name)',
'last_poster' => 'IFNULL(meml.real_name, ml.poster_name)',
'replies' => 't.num_replies',
'views' => 't.num_views',
'first_post' => 't.id_topic',
'last_post' => 't.id_last_msg'
);

// They didn't pick one, default to by last post descending.
if (!isset($_REQUEST['sort']) || !isset($sort_methods[$_REQUEST['sort']]))
{
$context['sort_by'] = 'last_post';
$_REQUEST['sort'] = 'id_last_msg';
$ascending = isset($_REQUEST['asc']);
}
// Otherwise default to ascending.
else
{
$context['sort_by'] = $_REQUEST['sort'];
$_REQUEST['sort'] = $sort_methods[$_REQUEST['sort']];
$ascending = !isset($_REQUEST['desc']);
}

$context['sort_direction'] = $ascending ? 'up' : 'down';

// Calculate the fastest way to get the topics.
$start = $_REQUEST['start'];
if ($start > ($board_info['total_topics']  - 1) / 2)
{
$ascending = !$ascending;
$fake_ascending = true;
$maxindex = $board_info['total_topics'] < $start + $maxindex + 1 ? $board_info['total_topics'] - $start : $maxindex;
$start = $board_info['total_topics'] < $start + $maxindex + 1 ? 0 : $board_info['total_topics'] - $start - $maxindex;
}
else
$fake_ascending = false;

// Setup the default topic icons...
$stable_icons = array('xx', 'thumbup', 'thumbdown', 'exclamation', 'question', 'lamp', 'smiley', 'angry', 'cheesy', 'grin', 'sad', 'wink', 'moved', 'recycled', 'wireless', 'clip');
$context['icon_sources'] = array();
foreach ($stable_icons as $icon)
$context['icon_sources'][$icon] = 'images_url';

$topic_ids = array();
$context['topics'] = array();

// Sequential pages are often not optimized, so we add an additional query.
$pre_query = $start > 0;
if ($pre_query)
{
$request = $smcFunc['db_query']('', '
SELECT t.id_topic
FROM {db_prefix}topics AS t'
. ($context['sort_by'] === 'last_poster' ? '
INNER JOIN {db_prefix}messages AS ml ON (ml.id_msg = t.id_last_msg)'
: (in_array($context['sort_by'], array('starter', 'subject')) ? '
INNER JOIN {db_prefix}messages AS mf ON (mf.id_msg = t.id_first_msg)'
: '')) . ($context['sort_by'] === 'starter' ? '
LEFT JOIN {db_prefix}members AS memf ON (memf.id_member = mf.id_member)'
: '') . ($context['sort_by'] === 'last_poster' ? '
LEFT JOIN {db_prefix}members AS meml ON (meml.id_member = ml.id_member)'
: '') . '
WHERE t.id_board = {int:current_board}'
. (!$modSettings['postmod_active'] || $context['can_approve_posts'] ? '' : '
AND (t.approved = {int:is_approved}'
. ($user_info['is_guest'] ? '' : ' OR t.id_member_started = {int:current_member}') . ')') . '
ORDER BY '
. (!empty($modSettings['enableStickyTopics']) ? 'is_sticky' . ($fake_ascending ? '' : ' DESC') . ', ' : '') . $_REQUEST['sort'] . ($ascending ? '' : ' DESC') . '
LIMIT {int:start}, {int:maxindex}'
,
array(
'current_board' => $board,
'current_member' => $user_info['id'],
'is_approved' => 1,
'id_member_guest' => 0,
'start' => $start,
'maxindex' => $maxindex,
)
);
$topic_ids = array();
while ($row = $smcFunc['db_fetch_assoc']($request))
$topic_ids[] = $row['id_topic'];
}

// Grab the appropriate topic information...
if (!$pre_query || !empty($topic_ids))
{
// For search engine effectiveness we'll link guests differently.
$context['pageindex_multiplier'] = empty($modSettings['disableCustomPerPage']) && !empty($options['messages_per_page']) && !WIRELESS ? $options['messages_per_page'] : $modSettings['defaultMaxMessages'];

$result = $smcFunc['db_query']('substring', '
SELECT
t.id_topic, t.num_replies, t.locked, t.num_views, t.is_sticky, t.id_poll, t.id_previous_board,
'
. ($user_info['is_guest'] ? '0' : 'IFNULL(lt.id_msg, IFNULL(lmr.id_msg, -1)) + 1') . ' AS new_from,
t.id_last_msg, t.approved, t.unapproved_posts, ml.poster_time AS last_poster_time,
ml.id_msg_modified, ml.subject AS last_subject, ml.icon AS last_icon,
ml.poster_name AS last_member_name, ml.id_member AS last_id_member,
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
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)
LEFT JOIN {db_prefix}members AS meml ON (meml.id_member = ml.id_member)
LEFT JOIN {db_prefix}members AS memf ON (memf.id_member = mf.id_member)'
. ($user_info['is_guest'] ? '' : '
LEFT JOIN {db_prefix}log_topics AS lt ON (lt.id_topic = t.id_topic AND lt.id_member = {int:current_member})
LEFT JOIN {db_prefix}log_mark_read AS lmr ON (lmr.id_board = {int:current_board} AND lmr.id_member = {int:current_member})'
). '
WHERE '
. ($pre_query ? 't.id_topic IN ({array_int:topic_list})' : 't.id_board = {int:current_board}') . (!$modSettings['postmod_active'] || $context['can_approve_posts'] ? '' : '
AND (t.approved = {int:is_approved}'
. ($user_info['is_guest'] ? '' : ' OR t.id_member_started = {int:current_member}') . ')') . '
ORDER BY '
. ($pre_query ? 'FIND_IN_SET(t.id_topic, {string:find_set_topics})' : (!empty($modSettings['enableStickyTopics']) ? 'is_sticky' . ($fake_ascending ? '' : ' DESC') . ', ' : '') . $_REQUEST['sort'] . ($ascending ? '' : ' DESC')) . '
LIMIT '
. ($pre_query ? '' : '{int:start}, ') . '{int:maxindex}',
array(
'current_board' => $board,
'current_member' => $user_info['id'],
'topic_list' => $topic_ids,
'is_approved' => 1,
'find_set_topics' => implode(',', $topic_ids),
'start' => $start,
'maxindex' => $maxindex,
)
);

// Begin 'printing' the message index for current board.
while ($row = $smcFunc['db_fetch_assoc']($result))
{
if ($row['id_poll'] > 0 && $modSettings['pollMode'] == '0')
continue;

if (!$pre_query)
$topic_ids[] = $row['id_topic'];

//I need to collect some IDs for the MemberColor :).
if (!empty($modSettings['MemberColorThreadOwner']) && !empty($row['first_id_member']))
$context['MemberColor_ID_MEMBER'][$row['first_id_member']] = $row['first_id_member'];
//Oh i need the Last Post ID, too ;)
if (!empty($modSettings['MemberColorThreadLastPost']) && !empty($row['last_id_member']))
$context['MemberColor_ID_MEMBER'][$row['last_id_member']] = $row['last_id_member'];

if (!empty($settings['message_index_preview']))
{
// Limit them to 128 characters - do this FIRST because it's a lot of wasted censoring otherwise.
$row['first_body'] = strip_tags(strtr(parse_bbc($row['first_body'], $row['first_smileys'], $row['id_first_msg']), array('<br />' => '&#38;#10;')));
if ($smcFunc['strlen']($row['first_body']) > 128)
$row['first_body'] = $smcFunc['substr']($row['first_body'], 0, 128) . '...';
$row['last_body'] = strip_tags(strtr(parse_bbc($row['last_body'], $row['last_smileys'], $row['id_last_msg']), array('<br />' => '&#38;#10;')));
if ($smcFunc['strlen']($row['last_body']) > 128)
$row['last_body'] = $smcFunc['substr']($row['last_body'], 0, 128) . '...';

// Censor the subject and message preview.
censorText($row['first_subject']);
censorText($row['first_body']);

// Don't censor them twice!
if ($row['id_first_msg'] == $row['id_last_msg'])
{
$row['last_subject'] = $row['first_subject'];
$row['last_body'] = $row['first_body'];
}
else
{
censorText($row['last_subject']);
censorText($row['last_body']);
}
}
else
{
$row['first_body'] = '';
$row['last_body'] = '';
censorText($row['first_subject']);

if ($row['id_first_msg'] == $row['id_last_msg'])
$row['last_subject'] = $row['first_subject'];
else
censorText($row['last_subject']);
}

// Decide how many pages the topic should have.
$topic_length = $row['num_replies'] + 1;
if ($topic_length > $context['messages_per_page'])
{
$tmppages = array();
$tmpa = 1;
for ($tmpb = 0; $tmpb < $topic_length; $tmpb += $context['messages_per_page'])
{
$tmppages[] = '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.' . $tmpb . '">' . $tmpa . '</a>';
$tmpa++;
}
// Show links to all the pages?
if (count($tmppages) <= 5)
$pages = '&#38;#171; ' . implode(' ', $tmppages);
// Or skip a few?
else
$pages = '&#38;#171; ' . $tmppages[0] . ' ' . $tmppages[1] . ' ... ' . $tmppages[count($tmppages) - 2] . ' ' . $tmppages[count($tmppages) - 1];

if (!empty($modSettings['enableAllMessages']) && $topic_length < $modSettings['enableAllMessages'])
$pages .= ' &nbsp;<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.0;all">' . $txt['all'] . '</a>';
$pages .= ' &#38;#187;';
}
else
$pages = '';

// We need to check the topic icons exist...
if (empty($modSettings['messageIconChecks_disable']))
{
if (!isset($context['icon_sources'][$row['first_icon']]))
$context['icon_sources'][$row['first_icon']] = file_exists($settings['theme_dir'] . '/images/post/' . $row['first_icon'] . '.gif') ? 'images_url' : 'default_images_url';
if (!isset($context['icon_sources'][$row['last_icon']]))
$context['icon_sources'][$row['last_icon']] = file_exists($settings['theme_dir'] . '/images/post/' . $row['last_icon'] . '.gif') ? 'images_url' : 'default_images_url';
}
else
{
if (!isset($context['icon_sources'][$row['first_icon']]))
$context['icon_sources'][$row['first_icon']] = 'images_url';
if (!isset($context['icon_sources'][$row['last_icon']]))
$context['icon_sources'][$row['last_icon']] = 'images_url';
}

// 'Print' the topic info.
$context['topics'][$row['id_topic']] = array(
'id' => $row['id_topic'],
'first_post' => array(
'id' => $row['id_first_msg'],
'member' => array(
'username' => $row['first_member_name'],
'name' => $row['first_display_name'],
'id' => $row['first_id_member'],
'href' => !empty($row['first_id_member']) ? $scripturl . '?action=profile;u=' . $row['first_id_member'] : '',
'link' => !empty($row['first_id_member']) ? '<a href="' . $scripturl . '?action=profile;u=' . $row['first_id_member'] . '" title="' . $txt['profile_of'] . ' ' . $row['first_display_name'] . '">' . $row['first_display_name'] . '</a>' : (!empty($modSettings['MemberColorGuests']) ? '<span style="color:'.$modSettings['MemberColorGuests'].';">' : '').$row['first_display_name'].(!empty($modSettings['MemberColorGuests']) ? '</span>' : '')
),
'time' => timeformat($row['first_poster_time']),
'timestamp' => forum_time(true, $row['first_poster_time']),
'subject' => $row['first_subject'],
'preview' => $row['first_body'],
'icon' => $row['first_icon'],
'icon_url' => $settings[$context['icon_sources'][$row['first_icon']]] . '/post/' . $row['first_icon'] . '.gif',
'href' => $scripturl . '?topic=' . $row['id_topic'] . '.0',
'link' => '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.0">' . $row['first_subject'] . '</a>'
),
'last_post' => array(
'id' => $row['id_last_msg'],
'member' => array(
'username' => $row['last_member_name'],
'name' => $row['last_display_name'],
'id' => $row['last_id_member'],
'href' => !empty($row['last_id_member']) ? $scripturl . '?action=profile;u=' . $row['last_id_member'] : '',
'link' => !empty($row['last_id_member']) ? '<a href="' . $scripturl . '?action=profile;u=' . $row['last_id_member'] . '">' . $row['last_display_name'] . '</a>' : (!empty($modSettings['MemberColorGuests']) ? '<span style="color:'.$modSettings['MemberColorGuests'].';">' : '').$row['last_display_name'].(!empty($modSettings['MemberColorGuests']) ? '</span>' : '')
),
'time' => timeformat($row['last_poster_time']),
'timestamp' => forum_time(true, $row['last_poster_time']),
'subject' => $row['last_subject'],
'preview' => $row['last_body'],
'icon' => $row['last_icon'],
'icon_url' => $settings[$context['icon_sources'][$row['last_icon']]] . '/post/' . $row['last_icon'] . '.gif',
'href' => $scripturl . '?topic=' . $row['id_topic'] . ($user_info['is_guest'] ? ('.' . (!empty($options['view_newest_first']) ? 0 : ((int) (($row['num_replies']) / $context['pageindex_multiplier'])) * $context['pageindex_multiplier']) . '#msg' . $row['id_last_msg']) : (($row['num_replies'] == 0 ? '.0' : '.msg' . $row['id_last_msg']) . '#new')),
'link' => '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . ($user_info['is_guest'] ? ('.' . (!empty($options['view_newest_first']) ? 0 : ((int) (($row['num_replies']) / $context['pageindex_multiplier'])) * $context['pageindex_multiplier']) . '#msg' . $row['id_last_msg']) : (($row['num_replies'] == 0 ? '.0' : '.msg' . $row['id_last_msg']) . '#new')) . '" ' . ($row['num_replies'] == 0 ? '' : 'rel="nofollow"') . '>' . $row['last_subject'] . '</a>'
),
'is_sticky' => !empty($modSettings['enableStickyTopics']) && !empty($row['is_sticky']),
'is_locked' => !empty($row['locked']),
'is_poll' => $modSettings['pollMode'] == '1' && $row['id_poll'] > 0,
'is_hot' => $row['num_replies'] >= $modSettings['hotTopicPosts'],
'is_very_hot' => $row['num_replies'] >= $modSettings['hotTopicVeryPosts'],
'is_posted_in' => false,
'icon' => $row['first_icon'],
'icon_url' => $settings[$context['icon_sources'][$row['first_icon']]] . '/post/' . $row['first_icon'] . '.gif',
'subject' => $row['first_subject'],
'new' => $row['new_from'] <= $row['id_msg_modified'],
'new_from' => $row['new_from'],
'newtime' => $row['new_from'],
'new_href' => $scripturl . '?topic=' . $row['id_topic'] . '.msg' . $row['new_from'] . '#new',
'pages' => $pages,
'replies' => $row['num_replies'],
'views' => $row['num_views'],
'approved' => $row['approved'],
'unapproved_posts' => $row['unapproved_posts'],
);

determineTopicClass($context['topics'][$row['id_topic']]);
}
$smcFunc['db_free_result']($result);

//Now let's replace the orginal link to the Color Link ;)
if (!empty($context['MemberColor_ID_MEMBER'])) {
$colorDatas = load_onlineColors($context['MemberColor_ID_MEMBER']);
//You are not know what you do ;P Colors allready loaded :D
if(!empty($modSettings['MemberColorModeratorLinks']) && !empty($context['boards'])) {
//Okay now... do a heavy serach for moderators... only jokeing... but you know... it look so ugly ;)
$onlineColor = load_mod_color(true);
foreach($context['boards'] as $ID_BOARD => $boardid_memcolor) {
//Reset it :D
$context['boards'][$ID_BOARD]['link_moderators'] = array();
global $color_profile;
foreach($context['boards'][$ID_BOARD]['moderators'] as $moderators) {
$cmemcolid = $moderators['id'];
//Replace "Profil of" with "Moderator" ;D
$link = str_replace($txt['profile_of'], $txt['board_moderator'], $colorDatas[$cmemcolid]['colored_link']);
if(empty($colorDatas[$cmemcolid]['online_color']) && !empty($onlineColor))
$link = '<a href="' . $scripturl . '?action=profile;u=' . $color_profile[$cmemcolid]['id_member'] . '" title="' . $txt['board_moderator'] . ' ' . $color_profile[$cmemcolid]['real_name'] . '"'.(!empty($modSettings['MemberColorLinkOldSpanStyle']) ? '><span style="color:'.$onlineColor.';">' : ' style="color:'.$onlineColor.';">') . $color_profile[$cmemcolid]['real_name'] . (!empty($modSettings['MemberColorLinkOldSpanStyle']) ? '</span>' : '').'</a>';
//Standard Color ;)
$context['boards'][$ID_BOARD]['moderators'][$cmemcolid]['link'] = $link;
//Creat the new list...
$context['boards'][$ID_BOARD]['link_moderators'][] = $link;
}
}
}

AlexX

druga czesc

//Need the Childs some Colors XD
if (!empty($modSettings['MemberColorThreadChild']) && !empty($context['boards'])) {
foreach($context['boards'] as $ID_BOARD => $boardid_memcolor) {
if(empty($context['boards'][$ID_BOARD]['last_post']['member']['id']))
continue;
//My Childs need a Member Color ;)
$cmemcolid = $context['boards'][$ID_BOARD]['last_post']['member']['id'];
if(!empty($colorDatas[$cmemcolid]['colored_link']))
$context['boards'][$ID_BOARD]['last_post']['member']['link'] = $colorDatas[$cmemcolid]['colored_link'];
}
}
//The Owner or the Last Post of the thread
if (!empty($modSettings['MemberColorThreadOwner']) || !empty($modSettings['MemberColorThreadLastPost'])) {
foreach($topic_ids as $topicid_memcolor) {
if (empty($context['topics'][$topicid_memcolor]))
continue;
//First the Thread Owner Link
if (!empty($modSettings['MemberColorThreadOwner'])) {
$cmemcolid = $context['topics'][$topicid_memcolor]['first_post']['member']['id'];
if(!empty($colorDatas[$cmemcolid]['colored_link']))
$context['topics'][$topicid_memcolor]['first_post']['member']['link'] = $colorDatas[$cmemcolid]['colored_link'];
}
//Or the Last Post Link ;)
if (!empty($modSettings['MemberColorThreadLastPost'])) {
$cmemcolid = $context['topics'][$topicid_memcolor]['last_post']['member']['id'];
if(!empty($colorDatas[$cmemcolid]['colored_link']))
$context['topics'][$topicid_memcolor]['last_post']['member']['link'] = $colorDatas[$cmemcolid]['colored_link'];
}
}
}
}

// Fix the sequence of topics if they were retrieved in the wrong order. (for speed reasons...)
if ($fake_ascending)
$context['topics'] = array_reverse($context['topics'], true);

if (!empty($modSettings['enableParti***tion']) && !$user_info['is_guest'] && !empty($topic_ids))
{
$result = $smcFunc['db_query']('', '
SELECT id_topic
FROM {db_prefix}messages
WHERE id_topic IN ({array_int:topic_list})
AND id_member = {int:current_member}
GROUP BY id_topic
LIMIT ' . count($topic_ids),
array(
'current_member' => $user_info['id'],
'topic_list' => $topic_ids,
)
);
while ($row = $smcFunc['db_fetch_assoc']($result))
{
$context['topics'][$row['id_topic']]['is_posted_in'] = true;
$context['topics'][$row['id_topic']]['class'] = 'my_' . $context['topics'][$row['id_topic']]['class'];
}
$smcFunc['db_free_result']($result);
}
}

$context['jump_to'] = array(
'label' => addslashes(un_htmlspecialchars($txt['jump_to'])),
'board_name' => htmlspecialchars(strtr($board_info['name'], array('&amp;' => '&'))),
'child_level' => $board_info['child_level'],
);

// Is Quick Moderation active?
if (!empty($options['display_quick_mod']))
{
$context['can_lock'] = allowedTo('lock_any');
$context['can_sticky'] = allowedTo('make_sticky') && !empty($modSettings['enableStickyTopics']);
$context['can_move'] = allowedTo('move_any');
$context['can_remove'] = allowedTo('remove_any');
$context['can_merge'] = allowedTo('merge_any');
// Ignore approving own topics as it's unlikely to come up...
$context['can_approve'] = allowedTo('approve_posts');
// Can we restore topics?
$context['can_restore'] = allowedTo('move_any') && !empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] == $board;

// Set permissions for all the topics.
foreach ($context['topics'] as $t => $topic)
{
$started = $topic['first_post']['member']['id'] == $user_info['id'];
$context['topics'][$t]['quick_mod'] = array(
'lock' => allowedTo('lock_any') || ($started && allowedTo('lock_own')),
'sticky' => allowedTo('make_sticky') && !empty($modSettings['enableStickyTopics']),
'move' => allowedTo('move_any') || ($started && allowedTo('move_own')),
'modify' => allowedTo('modify_any') || ($started && allowedTo('modify_own')),
'remove' => allowedTo('remove_any') || ($started && allowedTo('remove_own')),
'approve' => $context['can_approve'] && $topic['unapproved_posts']
);
$context['can_lock'] |= ($started && allowedTo('lock_own'));
$context['can_move'] |= ($started && allowedTo('move_own'));
$context['can_remove'] |= ($started && allowedTo('remove_own'));
}

// Find the boards/cateogories they can move their topic to.
if ($options['display_quick_mod'] == 1 && $context['can_move'] && !empty($context['topics']))
{
require_once($sourcedir . '/Subs-MessageIndex.php');
$boardListOptions = array(
'excluded_boards' => array($board),
'not_redirection' => true,
'use_permissions' => true,
'selected_board' => empty($_SESSION['move_to_topic']) ? null : $_SESSION['move_to_topic'],
);
$context['move_to_boards'] = getBoardList($boardListOptions);

// Make the boards safe for display.
foreach ($context['move_to_boards'] as $id_cat => $cat)
{
$context['move_to_boards'][$id_cat]['name'] = strip_tags($cat['name']);
foreach ($cat['boards'] as $id_board => $board)
$context['move_to_boards'][$id_cat]['boards'][$id_board]['name'] = strip_tags($board['name']);
}

// With no other boards to see, it's useless to move.
if (empty($context['move_to_boards']))
$context['can_move'] = false;
}
}

// If there are children, but no topics and no ability to post topics...
$context['no_topic_listing'] = !empty($context['boards']) && empty($context['topics']) && !$context['can_post_new'];
}

// Allows for moderation from the message index.
function QuickModeration()
{
global $sourcedir, $board, $user_info, $modSettings, $sourcedir, $smcFunc, $context;

// Check the session = get or post.
checkSession('request');

// Lets go straight to the restore area.
if (isset($_REQUEST['qaction']) && $_REQUEST['qaction'] == 'restore' && !empty($_REQUEST['topics']))
redirectexit('action=restoretopic;topics=' . implode(',', $_REQUEST['topics']) . ';' . $context['session_var'] . '=' . $context['session_id']);

if (isset($_SESSION['topicseen_cache']))
$_SESSION['topicseen_cache'] = array();

// This is going to be needed to send off the notifications and for updateLastMessages().
require_once($sourcedir . '/Subs-Post.php');

// Remember the last board they moved things to.
if (isset($_REQUEST['move_to']))
$_SESSION['move_to_topic'] = $_REQUEST['move_to'];

// Only a few possible actions.
$possibleActions = array('markread');

if (!empty($board))
{
$boards_can = array(
'make_sticky' => allowedTo('make_sticky') ? array($board) : array(),
'move_any' => allowedTo('move_any') ? array($board) : array(),
'move_own' => allowedTo('move_own') ? array($board) : array(),
'remove_any' => allowedTo('remove_any') ? array($board) : array(),
'remove_own' => allowedTo('remove_own') ? array($board) : array(),
'lock_any' => allowedTo('lock_any') ? array($board) : array(),
'lock_own' => allowedTo('lock_own') ? array($board) : array(),
'merge_any' => allowedTo('merge_any') ? array($board) : array(),
'approve_posts' => allowedTo('approve_posts') ? array($board) : array(),
);

$redirect_url = 'board=' . $board . '.' . $_REQUEST['start'];
}
else
{
// !!! Ugly.  There's no getting around this, is there?
// !!! Maybe just do this on the actions people want to use?
$boards_can = array(
'make_sticky' => boardsAllowedTo('make_sticky'),
'move_any' => boardsAllowedTo('move_any'),
'move_own' => boardsAllowedTo('move_own'),
'remove_any' => boardsAllowedTo('remove_any'),
'remove_own' => boardsAllowedTo('remove_own'),
'lock_any' => boardsAllowedTo('lock_any'),
'lock_own' => boardsAllowedTo('lock_own'),
'merge_any' => boardsAllowedTo('merge_any'),
'approve_posts' => boardsAllowedTo('approve_posts'),
);

$redirect_url = isset($_POST['redirect_url']) ? $_POST['redirect_url'] : (isset($_SESSION['old_url']) ? $_SESSION['old_url'] : '');
}

if (!empty($boards_can['make_sticky']) && !empty($modSettings['enableStickyTopics']))
$possibleActions[] = 'sticky';
if (!empty($boards_can['move_any']) || !empty($boards_can['move_own']))
$possibleActions[] = 'move';
if (!empty($boards_can['remove_any']) || !empty($boards_can['remove_own']))
$possibleActions[] = 'remove';
if (!empty($boards_can['lock_any']) || !empty($boards_can['lock_own']))
$possibleActions[] = 'lock';
if (!empty($boards_can['merge_any']))
$possibleActions[] = 'merge';
if (!empty($boards_can['approve_posts']))
$possibleActions[] = 'approve';

// Two methods: $_REQUEST['actions'] (id_topic => action), and $_REQUEST['topics'] and $_REQUEST['qaction'].
// (if action is 'move', $_REQUEST['move_to'] or $_REQUEST['move_tos'][$topic] is used.)
if (!empty($_REQUEST['topics']))
{
// If the action isn't valid, just quit now.
if (empty($_REQUEST['qaction']) || !in_array($_REQUEST['qaction'], $possibleActions))
redirectexit($redirect_url);

// Merge requires all topics as one parameter and can be done at once.
if ($_REQUEST['qaction'] == 'merge')
{
// Merge requires at least two topics.
if (empty($_REQUEST['topics']) || count($_REQUEST['topics']) < 2)
redirectexit($redirect_url);

require_once($sourcedir . '/SplitTopics.php');
return MergeExecute($_REQUEST['topics']);
}

// Just convert to the other method, to make it easier.
foreach ($_REQUEST['topics'] as $topic)
$_REQUEST['actions'][(int) $topic] = $_REQUEST['qaction'];
}

// Weird... how'd you get here?
if (empty($_REQUEST['actions']))
redirectexit($redirect_url);

// Validate each action.
$temp = array();
foreach ($_REQUEST['actions'] as $topic => $action)
{
if (in_array($action, $possibleActions))
$temp[(int) $topic] = $action;
}
$_REQUEST['actions'] = $temp;

if (!empty($_REQUEST['actions']))
{
// Find all topics...
$request = $smcFunc['db_query']('', '
SELECT id_topic, id_member_started, id_board, locked, approved, unapproved_posts
FROM {db_prefix}topics
WHERE id_topic IN ({array_int:action_topic_ids})
LIMIT ' . count($_REQUEST['actions']),
array(
'action_topic_ids' => array_keys($_REQUEST['actions']),
)
);
while ($row = $smcFunc['db_fetch_assoc']($request))
{
if (!empty($board))
{
if ($row['id_board'] != $board || ($modSettings['postmod_active'] && !$row['approved'] && !allowedTo('approve_posts')))
unset($_REQUEST['actions'][$row['id_topic']]);
}
else
{
// Don't allow them to act on unapproved posts they can't see...
if ($modSettings['postmod_active'] && !$row['approved'] && !in_array(0, $boards_can['approve_posts']) && !in_array($row['id_board'], $boards_can['approve_posts']))
unset($_REQUEST['actions'][$row['id_topic']]);
// Goodness, this is fun.  We need to validate the action.
elseif ($_REQUEST['actions'][$row['id_topic']] == 'sticky' && !in_array(0, $boards_can['make_sticky']) && !in_array($row['id_board'], $boards_can['make_sticky']))
unset($_REQUEST['actions'][$row['id_topic']]);
elseif ($_REQUEST['actions'][$row['id_topic']] == 'move' && !in_array(0, $boards_can['move_any']) && !in_array($row['id_board'], $boards_can['move_any']) && ($row['id_member_started'] != $user_info['id'] || (!in_array(0, $boards_can['move_own']) && !in_array($row['id_board'], $boards_can['move_own']))))
unset($_REQUEST['actions'][$row['id_topic']]);
elseif ($_REQUEST['actions'][$row['id_topic']] == 'remove' && !in_array(0, $boards_can['remove_any']) && !in_array($row['id_board'], $boards_can['remove_any']) && ($row['id_member_started'] != $user_info['id'] || (!in_array(0, $boards_can['remove_own']) && !in_array($row['id_board'], $boards_can['remove_own']))))
unset($_REQUEST['actions'][$row['id_topic']]);
elseif ($_REQUEST['actions'][$row['id_topic']] == 'lock' && !in_array(0, $boards_can['lock_any']) && !in_array($row['id_board'], $boards_can['lock_any']) && ($row['id_member_started'] != $user_info['id'] || $locked == 1 || (!in_array(0, $boards_can['lock_own']) && !in_array($row['id_board'], $boards_can['lock_own']))))
unset($_REQUEST['actions'][$row['id_topic']]);
// If the topic is approved then you need permission to approve the posts within.
elseif ($_REQUEST['actions'][$row['id_topic']] == 'approve' && (!$row['unapproved_posts'] || (!in_array(0, $boards_can['approve_posts']) && !in_array($row['id_board'], $boards_can['approve_posts']))))
unset($_REQUEST['actions'][$row['id_topic']]);
}
}
$smcFunc['db_free_result']($request);
}

$stickyCache = array();
$moveCache = array(0 => array(), 1 => array());
$removeCache = array();
$lockCache = array();
$markCache = array();
$approveCache = array();

// Separate the actions.
foreach ($_REQUEST['actions'] as $topic => $action)
{
$topic = (int) $topic;

if ($action == 'markread')
$markCache[] = $topic;
elseif ($action == 'sticky')
$stickyCache[] = $topic;
elseif ($action == 'move')
{
// $moveCache[0] is the topic, $moveCache[1] is the board to move to.
$moveCache[1][$topic] = (int) (isset($_REQUEST['move_tos'][$topic]) ? $_REQUEST['move_tos'][$topic] : $_REQUEST['move_to']);

if (empty($moveCache[1][$topic]))
continue;

$moveCache[0][] = $topic;
}
elseif ($action == 'remove')
$removeCache[] = $topic;
elseif ($action == 'lock')
$lockCache[] = $topic;
elseif ($action == 'approve')
$approveCache[] = $topic;
}

if (empty($board))
$affectedBoards = array();
else
$affectedBoards = array($board => array(0, 0));

// Do all the stickies...
if (!empty($stickyCache))
{
$smcFunc['db_query']('', '
UPDATE {db_prefix}topics
SET is_sticky = CASE WHEN is_sticky = {int:is_sticky} THEN 0 ELSE 1 END
WHERE id_topic IN ({array_int:sticky_topic_ids})',
array(
'sticky_topic_ids' => $stickyCache,
'is_sticky' => 1,
)
);

// Get the board IDs
$request = $smcFunc['db_query']('', '
SELECT id_topic, id_board
FROM {db_prefix}topics
WHERE id_topic IN ({array_int:sticky_topic_ids})
LIMIT ' . count($stickyCache),
array(
'sticky_topic_ids' => $stickyCache,
)
);
$stickyCacheBoards = array();
while ($row = $smcFunc['db_fetch_assoc']($request))
$stickyCacheBoards[$row['id_topic']] = $row['id_board'];
$smcFunc['db_free_result']($request);
}

// Move sucka! (this is, by the by, probably the most complicated part....)
if (!empty($moveCache[0]))
{
// I know - I just KNOW you're trying to beat the system.  Too bad for you... we CHECK :P.
$request = $smcFunc['db_query']('', '
SELECT t.id_topic, t.id_board, b.count_posts
FROM {db_prefix}topics AS t
LEFT JOIN {db_prefix}boards AS b ON (t.id_board = b.id_board)
WHERE t.id_topic IN ({array_int:move_topic_ids})' . (!empty($board) && !allowedTo('move_any') ? '
AND t.id_member_started = {int:current_member}' : '') . '
LIMIT ' . count($moveCache[0]),
array(
'current_member' => $user_info['id'],
'move_topic_ids' => $moveCache[0],
)
);
$moveTos = array();
$moveCache2 = array();
$countPosts = array();
while ($row = $smcFunc['db_fetch_assoc']($request))
{
$to = $moveCache[1][$row['id_topic']];

if (empty($to))
continue;

// Does this topic's board count the posts or not?
$countPosts[$row['id_topic']] = empty($row['count_posts']);

if (!isset($moveTos[$to]))
$moveTos[$to] = array();

$moveTos[$to][] = $row['id_topic'];

// For reporting...
$moveCache2[] = array($row['id_topic'], $row['id_board'], $to);
}
$smcFunc['db_free_result']($request);

$moveCache = $moveCache2;

require_once($sourcedir . '/MoveTopic.php');

// Do the actual moves...
foreach ($moveTos as $to => $topics)
moveTopics($topics, $to);

// Does the post counts need to be updated?
if (!empty($moveTos))
{
$topicRecounts = array();
$request = $smcFunc['db_query']('', '
SELECT id_board, count_posts
FROM {db_prefix}boards
WHERE id_board IN ({array_int:move_boards})',
array(
'move_boards' => array_keys($moveTos),
)
);

while ($row = $smcFunc['db_fetch_assoc']($request))
{
$cp = empty($row['count_posts']);

// Go through all the topics that are being moved to this board.
foreach ($moveTos[$row['id_board']] as $topic)
{
// If both boards have the same value for post counting then no adjustment needs to be made.
if ($countPosts[$topic] != $cp)
{
// If the board being moved to does count the posts then the other one doesn't so add to their post count.
$topicRecounts[$topic] = $cp ? '+' : '-';
}
}
}

$smcFunc['db_free_result']($request);

if (!empty($topicRecounts))
{
$members = array();

// Get all the members who have posted in the moved topics.
$request = $smcFunc['db_query']('', '
SELECT id_member, id_topic
FROM {db_prefix}messages
WHERE id_topic IN ({array_int:moved_topic_ids})',
array(
'moved_topic_ids' => array_keys($topicRecounts),
)
);

while ($row = $smcFunc['db_fetch_assoc']($request))
{
if (!isset($members[$row['id_member']]))
$members[$row['id_member']] = 0;

if ($topicRecounts[$row['id_topic']] === '+')
$members[$row['id_member']] += 1;
else
$members[$row['id_member']] -= 1;
}

$smcFunc['db_free_result']($request);

// And now update them member's post counts
foreach ($members as $id_member => $post_adj)
updateMemberData($id_member, array('posts' => 'posts + ' . $post_adj));

}
}
}

// Now delete the topics...
if (!empty($removeCache))
{
// They can only delete their own topics. (we wouldn't be here if they couldn't do that..)
$result = $smcFunc['db_query']('', '
SELECT id_topic, id_board
FROM {db_prefix}topics
WHERE id_topic IN ({array_int:removed_topic_ids})' . (!empty($board) && !allowedTo('remove_any') ? '
AND id_member_started = {int:current_member}' : '') . '
LIMIT ' . count($removeCache),
array(
'current_member' => $user_info['id'],
'removed_topic_ids' => $removeCache,
)
);

$removeCache = array();
$removeCacheBoards = array();
while ($row = $smcFunc['db_fetch_assoc']($result))
{
$removeCache[] = $row['id_topic'];
$removeCacheBoards[$row['id_topic']] = $row['id_board'];
}
$smcFunc['db_free_result']($result);

// Maybe *none* were their own topics.
if (!empty($removeCache))
{
// Gotta send the notifications *first*!
foreach ($removeCache as $topic)
{
// Only log the topic ID if it's not in the recycle board.
logAction('remove', array((empty($modSettings['recycle_enable']) || $modSettings['recycle_board'] != $removeCacheBoards[$topic] ? 'topic' : 'old_topic_id') => $topic, 'board' => $removeCacheBoards[$topic]));
sendNotifications($topic, 'remove');
}

require_once($sourcedir . '/RemoveTopic.php');
removeTopics($removeCache);
}
}

// And (almost) lastly, lock the topics...
if (!empty($lockCache))
{
$lockStatus = array();

// Gotta make sure they CAN lock/unlock these topics...
if (!empty($board) && !allowedTo('lock_any'))
{
// Make sure they started the topic AND it isn't already locked by someone with higher priv's.
$result = $smcFunc['db_query']('', '
SELECT id_topic, locked, id_board
FROM {db_prefix}topics
WHERE id_topic IN ({array_int:locked_topic_ids})
AND id_member_started = {int:current_member}
AND locked IN (2, 0)
LIMIT ' . count($lockCache),
array(
'current_member' => $user_info['id'],
'locked_topic_ids' => $lockCache,
)
);
$lockCache = array();
$lockCacheBoards = array();
while ($row = $smcFunc['db_fetch_assoc']($result))
{
$lockCache[] = $row['id_topic'];
$lockCacheBoards[$row['id_topic']] = $row['id_board'];
$lockStatus[$row['id_topic']] = empty($row['locked']);
}
$smcFunc['db_free_result']($result);
}
else
{
$result = $smcFunc['db_query']('', '
SELECT id_topic, locked, id_board
FROM {db_prefix}topics
WHERE id_topic IN ({array_int:locked_topic_ids})
LIMIT ' . count($lockCache),
array(
'locked_topic_ids' => $lockCache,
)
);
$lockCacheBoards = array();
while ($row = $smcFunc['db_fetch_assoc']($result))
{
$lockStatus[$row['id_topic']] = empty($row['locked']);
$lockCacheBoards[$row['id_topic']] = $row['id_board'];
}
$smcFunc['db_free_result']($result);
}

// It could just be that *none* were their own topics...
if (!empty($lockCache))
{
// Alternate the locked value.
$smcFunc['db_query']('', '
UPDATE {db_prefix}topics
SET locked = CASE WHEN locked = {int:is_locked} THEN ' . (allowedTo('lock_any') ? '1' : '2') . ' ELSE 0 END
WHERE id_topic IN ({array_int:locked_topic_ids})',
array(
'locked_topic_ids' => $lockCache,
'is_locked' => 0,
)
);
}
}

// Topics/posts to approve, eh?
if (!empty($approveCache))
{
// This function returns the outcome...
//!!! Add logging!
$approveCache = approveTopics($approveCache);
}

if (!empty($markCache))
{
$markArray = array();
foreach ($markCache as $topic)
$markArray[] = array($modSettings['maxMsgID'], $user_info['id'], $topic);

$smcFunc['db_insert']('replace',
'{db_prefix}log_topics',
array('id_msg' => 'int', 'id_member' => 'int', 'id_topic' => 'int'),
$markArray,
array('id_member', 'id_topic')
);
}

foreach ($moveCache as $topic)
{
// Didn't actually move anything!
if (!isset($topic[0]))
break;

logAction('move', array('topic' => $topic[0], 'board_from' => $topic[1], 'board_to' => $topic[2]));
sendNotifications($topic[0], 'move');
}
foreach ($lockCache as $topic)
{
logAction('lock', array('topic' => $topic, 'board' => $lockCacheBoards[$topic]));
sendNotifications($topic, $lockStatus[$topic] ? 'lock' : 'unlock');
}
foreach ($stickyCache as $topic)
{
logAction('sticky', array('topic' => $topic, 'board' => $stickyCacheBoards[$topic]));
sendNotifications($topic, 'sticky');
}

updateStats('topic');
updateStats('message');
updateSettings(array(
'calendar_updated' => time(),
));

if (!empty($affectedBoards))
updateLastMessages(array_keys($affectedBoards));

redirectexit($redirect_url);
}

?>

AlexX

fajne tu macie wsparcie, userzy wiecej pomagaja niz administracja, extra

sorry ze post pod postem ale tamten kod z byt wiele miejsca zajmował

tutaj mam jeszcze jeden problem

nie moge ustawic swoich przyciskow, a w ustawieniach stylu mam ustawione jak trzeba, no i wrzucilem obrazki do folderu polish... wie ktos co trzeba zrobic?...

jareQ

Cytat1. Chcialbym zeby goscie widzieli dzialy do ktorych nie moga wejsc, tutaj jest sposob:
http://www.smf.pl/index.php/topic,165.0.html
- z tym to nie wiem
Cytatnie moge ustawic swoich przyciskow, a w ustawieniach stylu mam ustawione jak trzeba, no i wrzucilem obrazki do folderu polish... wie ktos co trzeba zrobic?...
Daj kod z MessageIndex.template.php Twojej skórki.
"Wszystkie sekrety zostaną poznane, kluczem jest czas.."

AlexX

<?php
// Version: 2.0 RC1; MessageIndex

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

if (!empty($context['boards']) && (!empty($options['show_children']) || $context['start'] == 0))
{
echo '
<a name="top"></a>
<div class="tborder marginbottom" id="childboards">
<table cellspacing="1" class="bordercolor boardsframe">
<tr>
<td colspan="4" class="catbg headerpadding">'
, $txt['parent_boards'], '</td>
</tr>'
;

foreach ($context['boards'] as $board)
{
echo '
<tr>
<td class="windowbg icon">
<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'], '/on', $board['new'] ? '' : '2', '.gif" alt="', $txt['new_posts'], '" title="', $txt['new_posts'], '" border="0" />';
// Is it a redirection board?
elseif ($board['is_redirect'])
echo '
<img src="'
, $settings['images_url'], '/redirect.gif" alt="*" title="*" border="0" />';
// No new posts at all! The agony!!
else
echo '
<img src="'
, $settings['images_url'], '/off.gif" alt="', $txt['old_posts'], '" title="', $txt['old_posts'], '" />';

echo '
</a>
</td>
<td class="windowbg2 info">
<h4><a 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'] > $board['unapproved_posts'] ? '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 '
</h4>
<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']) == 1 ? $txt['moderator'] : $txt['moderators'], ': ', implode(', ', $board['link_moderators']), '</p>';

// Show the "Child Boards: ". (there's a link_children but we're going to bold the new ones...)
if (!empty($board['children']))
{
// 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'] . '" title="' . ($child['new'] ? $txt['new_posts'] : $txt['old_posts']) . ' (' . $txt['board_topics'] . ': ' . $child['topics'] . ', ' . $txt['posts'] . ': ' . $child['posts'] . ')">' . $child['name'] . '</a>';
else
$child['link'] = '<a href="' . $child['href'] . '" title="' . $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'] > $child['unapproved_posts'] ? '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 '
<p class="windowbg3 smalltext children"><strong>'
, $txt['parent_boards'], '</strong>: ', implode(', ', $children), '</p>';
}

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

/* 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 '
<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'];
echo '
</td>
</tr>'
;
}
echo '
</table>
</div>'
;
}


if (!empty($options['show_board_desc']) && $context['description'] != '')
{
echo '
<div id="description" class="tborder">
<div class="titlebg2 largepadding smalltext">'
, $context['description'], '</div>
</div>'
;
}

// Create the button set...
$normal_buttons = array(
'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']),
'notify' => array('test' => 'can_mark_notify', 'text' => 'notify', 'image' => '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']),
'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'),
'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'),
);

// 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']);

if (!$context['no_topic_listing'])
{
echo '
<div id="modbuttons_top" class="modbuttons clearfix margintop">
<div class="floatleft middletext">'
, $txt['pages'], ': ', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . '&nbsp;&nbsp;<a href="#bot"><b>' . $txt['go_down'] . '</b></a>' : '', '</div>
'
, template_button_strip($normal_buttons, 'bottom'), '
</div>'
;

// If Quick Moderation is enabled start the form.
if (!empty($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'], '" name="quickModForm" id="quickModForm">';

echo '
<div class="tborder" id="messageindex">
<table cellspacing="1" class="bordercolor boardsframe">'
;

// Are there actually any topics to show?
if (!empty($context['topics']))
{
echo '
<thead>
<tr>
<th width="9%" colspan="2" class="catbg3 headerpadding">&nbsp;</th>
<th class="catbg3 headerpadding"><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></th>
<th class="catbg3 headerpadding" width="11%"><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 class="catbg3 headerpadding" width="4%" align="center"><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></th>
<th class="catbg3 headerpadding" width="4%" align="center"><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>
<th class="catbg3 headerpadding" width="22%"><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($options['display_quick_mod']) && $options['display_quick_mod'] == 1)
echo '
<th class="catbg3 headerpadding" width="24">
<input type="checkbox" onclick="invertAll(this, this.form, \'topics[]\');" class="check" />
</th>'
;
// If it's on in "image" mode, don't show anything but the column.
elseif (!empty($options['display_quick_mod']))
echo '
<th class="catbg3 headerpadding" width="4%"></th>'
;
echo '
</tr>
</thead>'
;
}
echo '
<tbody>'
;

if (!empty($settings['display_who_viewing']))
{
echo '
<tr class="windowbg2">
<td colspan="'
, !empty($options['display_quick_mod']) ? '8' : '7' , '" class="headerpadding 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>'
;
}

// 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($options['display_quick_mod']) ? '8' : '7' , '" class="smalltext headerpadding">
<span class="alert">!</span> '
, $context['unapproved_posts_message'], '
</td>
</tr>'
;
}

// No topics.... just say, "sorry bub".
if (empty($context['topics']))
echo '
<tr class="windowbg2">
<td class="catbg3" colspan="'
, !empty($options['display_quick_mod']) ? '8' : '7' , '"><strong>', $txt['msg_alert_none'], '</strong></td>
</tr>'
;

foreach ($context['topics'] as $topic)
{
if(
$topic['is_sticky'] && !$stickybar)
{
echo
'<tr class="titlebg"><td colspan="', empty($options['display_quick_mod']) ? '7' : '8', '"> Przyklejone</td></tr>';
$stickybar = true;
}
else if(!
$topic['is_sticky'] && $stickybar && !$normalbar)
{
echo
'<tr class="titlebg"><td colspan="', empty($options['display_quick_mod']) ? '7' : '8', '"> Normalne</td></tr>';
$normalbar = true;
}
// Do we want to seperate the sticky and lock status out?
if (!empty($settings['separate_sticky_lock']) && strpos($topic['class'], 'sticky') !== false)
$topic['class'] = substr($topic['class'], 0, strrpos($topic['class'], '_sticky'));
if (!empty($settings['separate_sticky_lock']) && strpos($topic['class'], 'locked') !== false)
$topic['class'] = substr($topic['class'], 0, strrpos($topic['class'], '_locked'));

// Calculate the colour class of the topic.
if ($context['can_approve_posts'] && $topic['unapproved_posts'])
$color_class = $topic['approved'] ? 'approvebg' : 'approvetbg';
else
$color_class = !empty($settings['separate_sticky_lock']) && $topic['is_sticky'] ? 'windowbg3' : 'windowbg';

echo '
<tr>
<td class="windowbg2 icon1">
<img src="'
, $settings['images_url'], '/topic/', $topic['class'], '.gif" alt="" />
</td>
<td class="windowbg2 icon2">
<img src="'
, $topic['first_post']['icon_url'], '" alt="" />
</td>
<td class="subject '
, $color_class, '" ', (!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'] . '\', \'' . $context['session_id'] . '\');"' : ''), '>';

if (!empty($settings['separate_sticky_lock']))
echo '
'
, $topic['is_locked'] ? '<img src="' . $settings['images_url'] . '/icons/quick_lock.gif" align="right" alt="" id="lockicon' . $topic['first_post']['id'] . '" style="margin: 0;" />' : '' , '
'
, $topic['is_sticky'] ? '<img src="' . $settings['images_url'] . '/icons/show_sticky.gif" align="right" alt="" id="stickyicon' . $topic['first_post']['id'] . '" style="margin: 0;" />' : '';

echo '
'
, $topic['is_sticky'] ? '<b>' : '' , '<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'] ? '</b>' : '';

// 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 '
<small id="pages'
. $topic['first_post']['id'] . '">', $topic['pages'], '</small>
</td>
<td class="windowbg2 starter">
'
, $topic['first_post']['member']['link'], '
</td>
<td class="windowbg'
, $topic['is_sticky'] ? '3' : '' , ' replies">
'
, $topic['replies'], '
</td>
<td class="windowbg'
, $topic['is_sticky'] ? '3' : '' , ' views">
'
, $topic['views'], '
</td>
<td class="windowbg2 lastpost">
<a href="'
, $topic['last_post']['href'], '"><img src="', $settings['images_url'], '/icons/last_post.gif" alt="', $txt['last_post'], '" title="', $txt['last_post'], '" style="float: right;" /></a>
<span class="smalltext">
'
, $topic['last_post']['time'], '<br />
'
, $txt['by'], ' ', $topic['last_post']['member']['link'], '
</span>
</td>'
;

// Show the quick moderation options?
if (!empty($options['display_quick_mod']))
{
echo '
<td class="windowbg'
, $topic['is_sticky'] ? '3' : '' , ' moderation">';
if ($options['display_quick_mod'] == 1)
echo '
<input type="checkbox" name="topics[]" value="'
, $topic['id'], '" class="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($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']))
{
echo '
<tr class="catbg headerpadding">
<td colspan="8" align="right">
<select name="qaction"'
, $context['can_move'] ? ' onchange="this.form.moveItTo.disabled = (this.options[this.selectedIndex].value != \'move\');"' : '', '>
<option value="">--------</option>
'
, $context['can_approve'] ? '<option value="approve">' . $txt['quick_mod_approve'] . '</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>' : '', '
<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 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'] > 0 ? 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'], '\');" />
</td>
</tr>'
;
}

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

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

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


// Show breadcrumbs at the bottom too?
echo '
<div class="marginbottom">'
, theme_linktree(), '</div>';

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

if (!$context['no_topic_listing'])
echo '
<p class="floatleft smalltext">
'
, !empty($modSettings['enableParti***tion']) ? '
<img src="'
. $settings['images_url'] . '/topic/my_normal_post.gif" alt="" align="middle" /> ' . $txt['parti***tion_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 language="JavaScript" 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['go'], '"
});
// ]]></script>
</div>
</div>'
;

// Javascript for inline editing.
echo '
<script language="JavaScript" type="text/javascript" src="'
. $settings['default_theme_url'] . '/scripts/xml_board.js"></script>
<script language="JavaScript" 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'], '");
}

function modify_topic_keypress(oEvent)
{
if (typeof(oEvent.keyCode) != "undefined" && oEvent.keyCode == 13)
{
modify_topic_save("'
, $context['session_id'], '");
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)" /><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
theme_show_buttons()
{
global $context, $settings, $options, $txt, $scripturl;

$buttonArray = array();

// If they are logged in, and the mark read buttons are enabled..
if ($context['user']['is_logged'] && $settings['show_mark_read'])
$buttonArray[] = '<a href="' . $scripturl . '?action=markasread;sa=board;board=' . $context['current_board'] . '.0;' . $context['session_var'] . '=' . $context['session_id'] . '">' . $txt['mark_read_short'] . '</a>';

// If the user has permission to show the notification button... ask them if they're sure, though.
if ($context['can_mark_notify'])
$buttonArray[] = '<a href="' . $scripturl . '?action=notifyboard;sa=' . ($context['is_marked_notify'] ? 'off' : 'on') . ';board=' . $context['current_board'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '" onclick="return confirm(\'' . ($context['is_marked_notify'] ? $txt['notification_disable_board'] : $txt['notification_enable_board']) . '\');">' . $txt['notify'] . '</a>';

// Are they allowed to post new topics?
if ($context['can_post_new'])
$buttonArray[] = '<a href="' . $scripturl . '?action=post;board=' . $context['current_board'] . '.0">' . $txt['new_topic'] . '</a>';

// How about new polls, can the user post those?
if ($context['can_post_poll'])
$buttonArray[] = '<a href="' . $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll">' . $txt['new_poll'] . '</a>';

return implode(' &nbsp;|&nbsp; ', $buttonArray);
}

?>

jareQ

<?php
// Version: 2.0 RC1; MessageIndex

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

if (!empty($context['boards']) && (!empty($options['show_children']) || $context['start'] == 0))
{
echo '
<a name="top"></a>
<div class="tborder marginbottom" id="childboards">
<table cellspacing="1" class="bordercolor boardsframe">
<tr>
<td colspan="4" class="catbg headerpadding">'
, $txt['parent_boards'], '</td>
</tr>'
;

foreach ($context['boards'] as $board)
{
echo '
<tr>
<td class="windowbg icon">
<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'], '/on', $board['new'] ? '' : '2', '.gif" alt="', $txt['new_posts'], '" title="', $txt['new_posts'], '" border="0" />';
// Is it a redirection board?
elseif ($board['is_redirect'])
echo '
<img src="'
, $settings['images_url'], '/redirect.gif" alt="*" title="*" border="0" />';
// No new posts at all! The agony!!
else
echo '
<img src="'
, $settings['images_url'], '/off.gif" alt="', $txt['old_posts'], '" title="', $txt['old_posts'], '" />';

echo '
</a>
</td>
<td class="windowbg2 info">
<h4><a 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'] > $board['unapproved_posts'] ? '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 '
</h4>
<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']) == 1 ? $txt['moderator'] : $txt['moderators'], ': ', implode(', ', $board['link_moderators']), '</p>';

// Show the "Child Boards: ". (there's a link_children but we're going to bold the new ones...)
if (!empty($board['children']))
{
// 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'] . '" title="' . ($child['new'] ? $txt['new_posts'] : $txt['old_posts']) . ' (' . $txt['board_topics'] . ': ' . $child['topics'] . ', ' . $txt['posts'] . ': ' . $child['posts'] . ')">' . $child['name'] . '</a>';
else
$child['link'] = '<a href="' . $child['href'] . '" title="' . $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'] > $child['unapproved_posts'] ? '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 '
<p class="windowbg3 smalltext children"><strong>'
, $txt['parent_boards'], '</strong>: ', implode(', ', $children), '</p>';
}

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

/* 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 '
<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'];
echo '
</td>
</tr>'
;
}
echo '
</table>
</div>'
;
}


if (!empty($options['show_board_desc']) && $context['description'] != '')
{
echo '
<div id="description" class="tborder">
<div class="titlebg2 largepadding smalltext">'
, $context['description'], '</div>
</div>'
;
}

// Create the button set...
$normal_buttons = array(
'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']),
'notify' => array('test' => 'can_mark_notify', 'text' => 'notify', 'image' => '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']),
'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'),
'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'),
);

// 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']);

if (!$context['no_topic_listing'])
{
echo '
<div id="modbuttons_top" class="modbuttons clearfix margintop">
<div class="floatleft middletext">'
, $txt['pages'], ': ', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . '&nbsp;&nbsp;<a href="#bot"><b>' . $txt['go_down'] . '</b></a>' : '', '</div>
'
, theme_show_buttons(), '
</div>'
;

// If Quick Moderation is enabled start the form.
if (!empty($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'], '" name="quickModForm" id="quickModForm">';

echo '
<div class="tborder" id="messageindex">
<table cellspacing="1" class="bordercolor boardsframe">'
;

// Are there actually any topics to show?
if (!empty($context['topics']))
{
echo '
<thead>
<tr>
<th width="9%" colspan="2" class="catbg3 headerpadding">&nbsp;</th>
<th class="catbg3 headerpadding"><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></th>
<th class="catbg3 headerpadding" width="11%"><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 class="catbg3 headerpadding" width="4%" align="center"><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></th>
<th class="catbg3 headerpadding" width="4%" align="center"><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>
<th class="catbg3 headerpadding" width="22%"><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($options['display_quick_mod']) && $options['display_quick_mod'] == 1)
echo '
<th class="catbg3 headerpadding" width="24">
<input type="checkbox" onclick="invertAll(this, this.form, \'topics[]\');" class="check" />
</th>'
;
// If it's on in "image" mode, don't show anything but the column.
elseif (!empty($options['display_quick_mod']))
echo '
<th class="catbg3 headerpadding" width="4%"></th>'
;
echo '
</tr>
</thead>'
;
}
echo '
<tbody>'
;

if (!empty($settings['display_who_viewing']))
{
echo '
<tr class="windowbg2">
<td colspan="'
, !empty($options['display_quick_mod']) ? '8' : '7' , '" class="headerpadding 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>'
;
}

// 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($options['display_quick_mod']) ? '8' : '7' , '" class="smalltext headerpadding">
<span class="alert">!</span> '
, $context['unapproved_posts_message'], '
</td>
</tr>'
;
}

// No topics.... just say, "sorry bub".
if (empty($context['topics']))
echo '
<tr class="windowbg2">
<td class="catbg3" colspan="'
, !empty($options['display_quick_mod']) ? '8' : '7' , '"><strong>', $txt['msg_alert_none'], '</strong></td>
</tr>'
;

foreach ($context['topics'] as $topic)
{
if(
$topic['is_sticky'] && !$stickybar)
{
echo
'<tr class="titlebg"><td colspan="', empty($options['display_quick_mod']) ? '7' : '8', '"> Przyklejone</td></tr>';
$stickybar = true;
}
else if(!
$topic['is_sticky'] && $stickybar && !$normalbar)
{
echo
'<tr class="titlebg"><td colspan="', empty($options['display_quick_mod']) ? '7' : '8', '"> Normalne</td></tr>';
$normalbar = true;
}
// Do we want to seperate the sticky and lock status out?
if (!empty($settings['separate_sticky_lock']) && strpos($topic['class'], 'sticky') !== false)
$topic['class'] = substr($topic['class'], 0, strrpos($topic['class'], '_sticky'));
if (!empty($settings['separate_sticky_lock']) && strpos($topic['class'], 'locked') !== false)
$topic['class'] = substr($topic['class'], 0, strrpos($topic['class'], '_locked'));

// Calculate the colour class of the topic.
if ($context['can_approve_posts'] && $topic['unapproved_posts'])
$color_class = $topic['approved'] ? 'approvebg' : 'approvetbg';
else
$color_class = !empty($settings['separate_sticky_lock']) && $topic['is_sticky'] ? 'windowbg3' : 'windowbg';

echo '
<tr>
<td class="windowbg2 icon1">
<img src="'
, $settings['images_url'], '/topic/', $topic['class'], '.gif" alt="" />
</td>
<td class="windowbg2 icon2">
<img src="'
, $topic['first_post']['icon_url'], '" alt="" />
</td>
<td class="subject '
, $color_class, '" ', (!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'] . '\', \'' . $context['session_id'] . '\');"' : ''), '>';

if (!empty($settings['separate_sticky_lock']))
echo '
'
, $topic['is_locked'] ? '<img src="' . $settings['images_url'] . '/icons/quick_lock.gif" align="right" alt="" id="lockicon' . $topic['first_post']['id'] . '" style="margin: 0;" />' : '' , '
'
, $topic['is_sticky'] ? '<img src="' . $settings['images_url'] . '/icons/show_sticky.gif" align="right" alt="" id="stickyicon' . $topic['first_post']['id'] . '" style="margin: 0;" />' : '';

echo '
'
, $topic['is_sticky'] ? '<b>' : '' , '<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'] ? '</b>' : '';

// 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 '
<small id="pages'
. $topic['first_post']['id'] . '">', $topic['pages'], '</small>
</td>
<td class="windowbg2 starter">
'
, $topic['first_post']['member']['link'], '
</td>
<td class="windowbg'
, $topic['is_sticky'] ? '3' : '' , ' replies">
'
, $topic['replies'], '
</td>
<td class="windowbg'
, $topic['is_sticky'] ? '3' : '' , ' views">
'
, $topic['views'], '
</td>
<td class="windowbg2 lastpost">
<a href="'
, $topic['last_post']['href'], '"><img src="', $settings['images_url'], '/icons/last_post.gif" alt="', $txt['last_post'], '" title="', $txt['last_post'], '" style="float: right;" /></a>
<span class="smalltext">
'
, $topic['last_post']['time'], '<br />
'
, $txt['by'], ' ', $topic['last_post']['member']['link'], '
</span>
</td>'
;

// Show the quick moderation options?
if (!empty($options['display_quick_mod']))
{
echo '
<td class="windowbg'
, $topic['is_sticky'] ? '3' : '' , ' moderation">';
if ($options['display_quick_mod'] == 1)
echo '
<input type="checkbox" name="topics[]" value="'
, $topic['id'], '" class="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($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']))
{
echo '
<tr class="catbg headerpadding">
<td colspan="8" align="right">
<select name="qaction"'
, $context['can_move'] ? ' onchange="this.form.moveItTo.disabled = (this.options[this.selectedIndex].value != \'move\');"' : '', '>
<option value="">--------</option>
'
, $context['can_approve'] ? '<option value="approve">' . $txt['quick_mod_approve'] . '</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>' : '', '
<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 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'] > 0 ? 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'], '\');" />
</td>
</tr>'
;
}

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

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

echo '
<div id="modbuttons_bottom" class="modbuttons clearfix marginbottom">
<div class="floatleft middletext">'
, $txt['pages'], ': ', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . '&nbsp;&nbsp;<a href="#top"><strong>' . $txt['go_up'] . '</strong></a>' : '', '</div>
'
, theme_show_buttons(), '
</div>'
;
}


// Show breadcrumbs at the bottom too?
echo '
<div class="marginbottom">'
, theme_linktree(), '</div>';

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

if (!$context['no_topic_listing'])
echo '
<p class="floatleft smalltext">
'
, !empty($modSettings['enableParti***tion']) ? '
<img src="'
. $settings['images_url'] . '/topic/my_normal_post.gif" alt="" align="middle" /> ' . $txt['parti***tion_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 language="JavaScript" 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['go'], '"
});
// ]]></script>
</div>
</div>'
;

// Javascript for inline editing.
echo '
<script language="JavaScript" type="text/javascript" src="'
. $settings['default_theme_url'] . '/scripts/xml_board.js"></script>
<script language="JavaScript" 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'], '");
}

function modify_topic_keypress(oEvent)
{
if (typeof(oEvent.keyCode) != "undefined" && oEvent.keyCode == 13)
{
modify_topic_save("'
, $context['session_id'], '");
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)" /><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
theme_show_buttons()
{
global $context, $settings, $options, $txt, $scripturl;

$buttonArray = array();

// If they are logged in, and the mark read buttons are enabled..
if ($context['user']['is_logged'] && $settings['show_mark_read'])
$buttonArray[] = '<a href="' . $scripturl . '?action=markasread;sa=board;board=' . $context['current_board'] . '.0;' . $context['session_var'] . '=' . $context['session_id'] . '">' . $txt['mark_read_short'] . '</a>';

// If the user has permission to show the notification button... ask them if they're sure, though.
if ($context['can_mark_notify'])
$buttonArray[] = '<a href="' . $scripturl . '?action=notifyboard;sa=' . ($context['is_marked_notify'] ? 'off' : 'on') . ';board=' . $context['current_board'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '" onclick="return confirm(\'' . ($context['is_marked_notify'] ? $txt['notification_disable_board'] : $txt['notification_enable_board']) . '\');">' . $txt['notify'] . '</a>';

// Are they allowed to post new topics?
if ($context['can_post_new'])
$buttonArray[] = '<a href="' . $scripturl . '?action=post;board=' . $context['current_board'] . '.0">' . $txt['new_topic'] . '</a>';

// How about new polls, can the user post those?
if ($context['can_post_poll'])
$buttonArray[] = '<a href="' . $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll">' . $txt['new_poll'] . '</a>';

return implode(' &nbsp;|&nbsp; ', $buttonArray);
}

?>


Powinno śmigać.
"Wszystkie sekrety zostaną poznane, kluczem jest czas.."

AlexX

nie pomoglo :/

cholera, mam fajne obrazki gotowe i nie dziala...

jareQ

Daj jeszcze Display.template.php
"Wszystkie sekrety zostaną poznane, kluczem jest czas.."

AlexX

<?php
// Version: 2.0 RC1; Display

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

// 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" id="pollquestion">
'
, $context['poll']['question'], '
</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 '
<dl class="options">'
;

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

echo '
</dl>'
;

if ($context['allow_poll_view'])
echo '
<p><b>'
, $txt['poll_total_voters'], ':</b> ', $context['poll']['total_votes'], '</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="options">'
;

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

echo '
</ul>

<div class="submitbutton'
, !empty($context['poll']['expire_time']) ? ' border' : '', '">
<input type="submit" value="'
, $txt['poll_vote'], '" />
<input type="hidden" name="'
, $context['session_var'], '" value="', $context['session_id'], '" />
</div>
</form>'
;
}

// Is the clock ticking?
if (!empty($context['poll']['expire_time']))
echo '
<p><b>'
, ($context['poll']['is_expired'] ? $txt['poll_expired_on'] : $txt['poll_expires_on']), ':</b> ', $context['poll']['expire_time'], '</p>';

echo '
</div>
</div>
<div id="pollmoderation">'
;

// Build the poll moderation button array.
$poll_buttons = array(
'vote' => array('test' => 'allow_return_vote', 'text' => 'poll_return_vote', 'image' => 'poll_options.gif', 'lang' => true, 'url' => $scripturl . '?topic=' . $context['current_topic'] . '.' . $context['start']),
'results' => array('test' => 'allow_poll_view', 'text' => 'poll_results', 'image' => 'poll_results.gif', 'lang' => true, 'url' => $scripturl . '?topic=' . $context['current_topic'] . '.' . $context['start'] . ';viewResults'),
'change_vote' => array('test' => 'allow_change_vote', 'text' => 'poll_change_vote', 'image' => 'poll_change_vote.gif', 'lang' => true, 'url' => $scripturl . '?action=vote;topic=' . $context['current_topic'] . '.' . $context['start'] . ';poll=' . $context['poll']['id'] . ';' . $context['session_var'] . '=' . $context['session_id']),
'lock' => array('test' => 'allow_lock_poll', 'text' => (!$context['poll']['is_locked'] ? 'poll_lock' : 'poll_unlock'), 'image' => 'poll_lock.gif', 'lang' => true, 'url' => $scripturl . '?action=lockvoting;topic=' . $context['current_topic'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id']),
'edit' => array('test' => 'allow_edit_poll', 'text' => 'poll_edit', 'image' => 'poll_edit.gif', 'lang' => true, 'url' => $scripturl . '?action=editpoll;topic=' . $context['current_topic'] . '.' . $context['start']),
'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']),
);

template_button_strip($poll_buttons);

echo '
</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']),
'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'] . ';' . $context['session_var'] . '=' . $context['session_id']),
'mark_unread' => array('test' => 'can_mark_unread', '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'] . ';' . $context['session_var'] . '=' . $context['session_id']),
'add_poll' => array('test' => 'can_add_poll', 'text' => 'add_poll', 'image' => 'add_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=editpoll;add;topic=' . $context['current_topic'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id']),
'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'),
);

// Show the page index... "Pages: [1]".
echo '
<div class="clearfix margintop" id="postbuttons">
<div class="next">'
, $context['previous_next'], '</div>
<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="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']) == 1 ? $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'] == 1 ? $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'] . '\') : false">';

// 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();
$messageIDs = array();

// Get all the messages...
while ($message = $context['get_message']())
{
$is_first_post = !isset($is_first_post) ? true : false;
$ignoring = false;
$messageIDs[] = $message['id'];

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 '
, !$is_first_post ? 'topborder ' : '', $message['approved'] ? ($message['alternate'] == 0 ? '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></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></li>'
;
echo '
<li>'
, $message['member']['group_stars'], '</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>';

// 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'], ';', $context['session_var'], '=', $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'], ';', $context['session_var'], '=', $context['session_id'], '">', $modSettings['karmaSmiteLabel'], '</a>
</li>'
;

// Show online and offline buttons?
if (!empty($modSettings['onlineEnable']))
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 their personal text?
if (!empty($settings['show_blurb']) && $message['member']['blurb'] != '')
echo '
<li class="margintop">'
, $message['member']['blurb'], '</li>';

// This shows the popular messaging icons.
if ($message['member']['has_messenger'] && $message['member']['can_view_profile'])
echo '
<li class="margintop">
<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 class="margintop">
<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']['is_online'] ? $txt['pm_online'] : $txt['pm_offline'], '">', $settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/im_' . ($message['member']['online']['is_online'] ? 'on' : 'off') . '.gif" alt="' . ($message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline']) . '" border="0" />' : ($message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline']), '</a></li>';

echo '
</ul>
</li>'
;
}

AlexX

// 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']) && ($modSettings['warning_show'] > 1 || $message['member']['id'] == $context['user']))))
echo '
<li>', $context['can_issue_warning'] ? '<a href="' . $scripturl . '?action=profile;area=issuewarning;u=' . $message['member']['id'] . '">' : '', '<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"><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">&#171; <strong>', !empty($message['counter']) ? $txt['reply_noun'] . ' #' . $message['counter'] : '', ' ', $txt['on'], ':</strong> ', $message['time'], ' &#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'], ';', $context['session_var'], '=', $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'], ';', $context['session_var'], '=', $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'], ';', $context['session_var'], '=', $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'], ';', $context['session_var'], '=', $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'], ';', $context['session_var'], '=', $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'], ';', $context['session_var'], '=', $context['session_id'], '">', $restore_message_button, '</a></li>';

// Show a checkbox for quick moderation?
if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $message['can_remove'])
echo '
<li style="display: none;" id="in_topic_mod_check_', $message['id'], '"></li>';

// Show the post itself, finally!
echo '
</ul>';

if ($ignoring)
echo '<div id="msg_', $message['id'], '_ignored_prompt" style="display: none; clear: left">', $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'] != 0 && $message['member']['id'] == $context['user']['id'])
echo '
<div class="approve_post">
', $txt['post_awaiting_approval'], '
</div>';
echo '
<div class="inner">', $message['body'], '</div>
</div>', $message['can_modify'] ? '
<img src="' . $settings['images_url'] . '/icons/modify_inline.gif" alt="" title="' . $txt['modify_msg'] . '" 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: ', $context['browser']['is_firefox'] ? 'visible' : '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'], ';', $context['session_var'], '=', $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'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['approve'], '</a>]&nbsp;|&nbsp;[<a href="', $scripturl, '?action=attachapprove;sa=reject;aid=', $attachment['id'], ';', $context['session_var'], '=', $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 '
&#171; <em>', $txt['last_edit'], ': ', $message['modified']['time'], ' ', $txt['by'], ' ', $message['modified']['name'], '</em> &#187;';

echo '
</div>
<div class="smalltext largepadding 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;area=issuewarning;u=', $message['member']['id'], ';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 '
<div class="signature">', $message['member']['signature'], '</div>';

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

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

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;' . $context['session_var'] . '=' . $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'] . ';' . $context['session_var'] . '=' . $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'] . ';' . $context['session_var'] . '=' . $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']),
'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;' . $context['session_var'] . '=' . $context['session_id']),
);

// 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'] . ';' . $context['session_var'] . '=' . $context['session_id']);

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">
<div class="titlebg2" style="padding: 4px;" align="', !$context['right_to_left'] ? 'right' : 'left', '" id="display_jump_to">&nbsp;</div>
</div><br />';

if ($context['can_reply'] && !empty($options['display_quick_reply']))
{
echo '
<a name="quickreply"></a>
<div class="tborder" id="quickreplybox">
<h3 class="catbg headerpadding">
<a href="javascript:oQuickReply.swap();">
<img src="', $settings['images_url'], '/', $options['display_quick_reply'] == 2 ? 'collapse' : 'expand', '.gif" alt="+" id="quickReplyExpand" />
</a>
<a href="javascript:oQuickReply.swap();">', $txt['quick_reply'], '</a>
</h3>
<div class="smallpadding windowbg" id="quickReplyOptions"', $options['display_quick_reply'] == 2 ? '' : ' style="display: none"', '>
<div class="smallpadding floatleft" id="quickReplyWarning">
', $txt['quick_reply_desc'], $context['is_locked'] ? '<p><strong>' . $txt['quick_reply_warning'] . '</strong></p>' : '', $context['oldTopicError'] ? '<p><strong>' . sprintf($txt['error_old_topic'], $modSettings['oldTopicDays']) . '</strong></p>' : '', '
</div>
<div id="quickReplyContent">', $context['can_reply_approved'] ? '' : '<em>' . $txt['wait_for_approval'] . '</em>', '
', !$context['can_reply_approved'] && $context['verification_message'] ? '<br />' : '', '
', $context['verification_message'] ? '<span class="smalltext">' . $context['verification_message'] . '</span>' : '', '
<form action="', $scripturl, '?action=post2" method="post" accept-charset="', $context['character_set'], '" name="postmodify" id="postmodify" onsubmit="submitonce(this);" style="margin: 0;">
<input type="hidden" name="topic" value="', $context['current_topic'], '" />
<input type="hidden" name="subject" value="', $context['response_prefix'], $context['subject'], '" />
<input type="hidden" name="icon" value="xx" />
<input type="hidden" name="from_qr" value="1" />
<input type="hidden" name="notify" value="', $context['is_marked_notify'] || !empty($options['auto_notify']) ? '1' : '0', '" />
<input type="hidden" name="not_approved" value="', !$context['can_reply_approved'], '" />
<input type="hidden" name="goback" value="', empty($options['return_to_post']) ? '0' : '1', '" />
<input type="hidden" name="num_replies" value="', $context['num_replies'], '" />';

// Guests just need more.
if ($context['user']['is_guest'])
echo '
<strong>', $txt['name'], ':</strong> <input type="text" name="guestname" value="', $context['name'], '" size="25" />
<strong>', $txt['email'], ':</strong> <input type="text" name="email" value="', $context['email'], '" size="25" /><br />';

echo '
<textarea cols="75" rows="7" style="width: 95%; height: 100px;" name="message" tabindex="1"></textarea><br />
<input type="submit" name="post" value="', $txt['post'], '" onclick="return submitThisOnce(this);" accesskey="s" tabindex="2" />
<input type="submit" name="preview" value="', $txt['preview'], '" onclick="return submitThisOnce(this);" accesskey="p" tabindex="4" />';
if ($context['show_spellchecking'])
echo '
<input type="button" value="', $txt['spell_check'], '" onclick="spellCheck(\'postmodify\', \'message\');" tabindex="5" />';
echo '
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
<input type="hidden" name="seqnum" value="', $context['form_sequence_number'], '" />
</form>
</div>
<div style="clear: both;"></div>
</div>
</div>';
}

if ($context['show_spellchecking'])
echo '
<form action="', $scripturl, '?action=spellcheck" method="post" accept-charset="', $context['character_set'], '" name="spell_form" id="spell_form" target="spellWindow"><input type="hidden" name="spellstring" value="" /></form>
<script language="JavaScript" type="text/javascript" src="' . $settings['default_theme_url'] . '/scripts/spellcheck.js"></script>';

echo '
<script language="JavaScript" type="text/javascript" src="' . $settings['default_theme_url'] . '/scripts/xml_topic.js"></script>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[';

if (!empty($options['display_quick_reply']))
echo '
var oQuickReply = new QuickReply({
bDefaultCollapsed: ', !empty($options['display_quick_reply']) && $options['display_quick_reply'] == 2 ? 'false' : 'true', ',
iTopicId: ', $context['current_topic'], ',
iStart: ', $context['start'], ',
sScriptUrl: "', $scripturl, '",
sImagesUrl: "', $settings['images_url'], '",
sContainerId: "quickReplyOptions",
sImageId: "quickReplyExpand",
sImageCollapsed: "collapse.gif",
sImageExpanded: "expand.gif",
sJumpAnchor: "quickreply"
});';

if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $context['can_remove_post'])
echo '
var oInTopicModeration = new InTopicModeration({
sSelf: \'oInTopicModeration\',
sCheckboxContainerMask: \'in_topic_mod_check_\',
aMessageIds: [\'', implode('\', \'', $messageIDs), '\'],
sSessionId: \'', $context['session_id'], '\',
sButtonStrip: \'moderationbuttons\',
bUseImageButton: false,
bCanRemove: ', $context['can_remove_post'] ? 'true' : 'false', ',
sRemoveButtonLabel: \'', $txt['quickmod_delete_selected'], '\',
sRemoveButtonImage: \'delete_selected.gif\',
sRemoveButtonConfirm: \'', $txt['quickmod_confirm'], '\',
bCanRestore: ', $context['can_restore_msg'] ? 'true' : 'false', ',
sRestoreButtonLabel: \'', $txt['quick_mod_restore'], '\',
sRestoreButtonImage: \'restore_selected.gif\',
sRestoreButtonConfirm: \'', $txt['quickmod_confirm'], '\',
sFormId: \'quickModForm\'
});';

echo '
if (typeof(window.XMLHttpRequest) != "undefined")
{
var oQuickModify = new QuickModify({
sScriptUrl: ', JavaScriptEscape($scripturl), ',
bShowModify: ', $settings['show_modify'] ? 'true' : 'false', ',
iTopicId: ', $context['current_topic'], ',
sTemplateBodyEdit: ', JavaScriptEscape('
<div id="quick_edit_body_container">
<div id="error_box" class="error" style="padding: 4px;"></div>
<textarea class="editor" name="message" rows="12" style="width: 94%; margin-bottom: 10px;" tabindex="7">%body%</textarea><br />
<input type="hidden" name="' . $context['session_var'] . '" value="' . $context['session_id'] . '" />
<input type="hidden" name="topic" value="' . $context['current_topic'] . '" />
<input type="hidden" name="msg" value="%msg_id%" />
<div style="text-align: center;">
<input type="submit" name="post" value="' . $txt['save'] . '" tabindex="8" onclick="return oQuickModify.modifySave(\'' . $context['session_id'] . '\');" accesskey="s" />&nbsp;&nbsp;' . ($context['show_spellchecking'] ? '<input type="button" value="' . $txt['spell_check'] . '" tabindex="9" onclick="spellCheck(\'quickModForm\', \'message\');" />&nbsp;&nbsp;' : '') . '<input type="submit" name="cancel" value="' . $txt['modify_cancel'] . '" tabindex="9" onclick="return oQuickModify.modifyCancel();" />
</div>
</div>'), ',
sTemplateSubjectEdit: ', JavaScriptEscape('<input type="text" style="width: 90%" name="subject" value="%subject%" size="80" maxlength="80" tabindex="6" />'), ',
sTemplateBodyNormal: ', JavaScriptEscape('<div class="inner">%body%</div>'), ',
sTemplateSubjectNormal: ', JavaScriptEscape('<a href="' . $scripturl . '?topic=' . $context['current_topic'] . '.msg%msg_id%#msg%msg_id%">%subject%</a>'), ',
sTemplateTopSubject: ', JavaScriptEscape($txt['topic'] . ': %subject% &nbsp;(' . $txt['read'] . ' ' . $context['num_views'] . ' ' . $txt['times'] . ')'), ',
sErrorBorderStyle: ', JavaScriptEscape('1px solid red'), '
});

aJumpTo[aJumpTo.length] = new JumpTo({
sContainerId: "display_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['go'], '"
});

aIconLists[aIconLists.length] = new IconList({
sBackReference: "aIconLists[" + aIconLists.length + "]",
sIconIdPrefix: "msg_icon_",
sScriptUrl: "', $scripturl, '",
bShowModify: ', $settings['show_modify'] ? 'true' : 'false', ',
iBoardId: ', $context['current_board'], ',
iTopicId: ', $context['current_topic'], ',
sSessionId: "', $context['session_id'], '",
sLabelIconList: "', $txt['message_icon'], '",
sBoxBackground: "transparent",
sBoxBackgroundHover: "#ffffff",
iBoxBorderWidthHover: 1,
sBoxBorderColorHover: "#adadad" ,
sContainerBackground: "#ffffff",
sContainerBorder: "1px solid #adadad",
sItemBorder: "1px solid #ffffff",
sItemBorderHover: "1px dotted gray",
sItemBackground: "transparent",
sItemBackgroundHover: "#e0e0f0"
});
}';

if (!empty($ignoredMsgs))
{
echo '
var ignoreToggles = new Array()';

foreach ($ignoredMsgs as $msgid)
{
echo '
ignoreToggles[', $msgid, '] = new smfToggle("ignore_msg_', $msgid, '", false);
ignoreToggles[', $msgid, '].addTogglePanel("msg_', $msgid, '_extra_info");
ignoreToggles[', $msgid, '].addTogglePanel("msg_', $msgid, '");
ignoreToggles[', $msgid, '].addTogglePanel("msg_', $msgid, '_footer");
ignoreToggles[', $msgid, '].addTogglePanel("msg_', $msgid, '_quick_mod");
ignoreToggles[', $msgid, '].addTogglePanel("modify_button_', $msgid, '");
ignoreToggles[', $msgid, '].addTogglePanel("msg_', $msgid, '_ignored_prompt", true);
ignoreToggles[', $msgid, '].toggle()';
}
}

echo '
// ]]></script>';
}

?>

jareQ

"Wszystkie sekrety zostaną poznane, kluczem jest czas.."

AlexX

#29
wlasnie zrobilem aktualizacje do RC2 i mam troche problemow...

1. Uzytkownicy nie mogą dodać swojego avatara:
http://img263.imageshack.us/img263/985/brakavatara.png

jest takie u nich puste pole...

2. jak usunac ten panel?
http://img94.imageshack.us/img94/1349/panell.png

3. zniknal mi shout po aktualizacji, czy jak wkleje ten kod to bedzię wszystko ok?:
http://www.smf.pl/index.php/topic,5537.msg27868.html#msg27868

4. Jak zrobić, żeby goście widzieli działy do którego nie mają dotępu?

5. W edycji posta nie ma tych opcji bbc code:
http://img137.imageshack.us/img137/6755/brakopcji.png

jakby co to wgralem nowa wersje theme, ktory zostal zrobiony pod nowa wersje smf rc 2