News:

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

Main Menu

cbi v0.5 (Custom Board Icons)

Started by Bigguy, November 11, 2006, 11:59:46 AM

Previous topic - Next topic

Bigguy

Ah, so sorry I misunderstood that. thanks for posting that code. When I get a minute I will look it over and update the mod. I will also see what can be done about the other problem. Thanks for clearing that up. :)

Yahmez


Blah blah

Quote from: Yahmez on September 24, 2009, 11:16:56 PM
Quote from: glennk on September 23, 2009, 05:09:56 PM
Im having problems on the default theme. Getting this message :

*     1.     Execute Modification     ./Themes/default/BoardIndex.template.php     Test failed
      1.    Replace    ./Themes/default/BoardIndex.template.php    Test failed
*    2.    Execute Modification    ./Themes/default/MessageIndex.template.php    Test failed
      1.    Replace    ./Themes/default/MessageIndex.template.php    Test failed
*    3.    Execute Modification    ./Themes/default/languages/Modifications.english.php    Test successful

Quote from: Blah blah on September 24, 2009, 01:46:31 AM
That's the problem I've been having too...could I post/send my templates to someone to point out what needs to be done so this can be added with my other mods? I'm lost

Post up your BoardIndex.template.php & MessageIndex.template.php files and you will have a better chance of someone looking at them ;)

Ok here is...if someone could add the code in for me to enable this I would be in debt forever :)

Board index template


<?php
// Version: 2.0 Beta 4; 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'] ? 0');
      smfNewsFadeToggle.setOptions("collapse_news_fader", "'
$context['session_id'], '");
      smfNewsFadeToggle.addToggleImage("newsupshrink", "/collapse.gif", "/expand.gif");
      smfNewsFadeToggle.addTogglePanel("smfNewsFader");
   // ]]></script>
   <div class="tborder marginbottom">
      <h4 id="newsfader" class="catbg headerpadding">
         <a href="#" onclick="smfNewsFadeToggle.toggle(); return false;">'
$txt['news'], '</a>
      </h4>
      <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">
      <h4 class="catbg headerpadding">'
;

      
// If this category even can collapse, show a link to collapse it.      

      
echo $category['link'];

      echo 
'
      </h4>'
;

      
// Assuming the category hasn't been collapsed...
      
if (!$category['is_collapsed'])
      {
         echo 
'
      <table cellspacing="0" 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 class="windowbg4">
            <td class="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''.png" 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.png" alt="*" title="*" border="0" />';
            
// No new posts at all! The agony!!
            
else
               echo 
'
                  <img src="'
$settings['images_url'], '/off.png" alt="'$txt['old_posts'], '" title="'$txt['old_posts'], '" />';

            echo 
'
               </a>
            </td>
            <td class="info">
               <h3><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'] ? 'topics' 'posts'), ';brd='$board['id'], ';sesc='$context['session_id'], '" title="'sprintf($txt['unapproved_posts'], $board['unapproved_topics'], $board['unapproved_posts']), '" class="moderation_link">(!)</a>';

            echo 
'
               
               <br/><span class="listings">'
$board['description'] , '';

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

            
// Show some basic information about the number of posts, etc.
               
echo '
            </td>
            <td class="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 
'
               '
$board['posts'], ' '$board['is_redirect'] ? $txt['redirects'] : $txt['posts'], ' ',$txt['in'],' &nbsp;'$board['is_redirect'] ? '' $board['topics'] . ' ' $txt['board_topics'];               
               if (!
$context['user']['is_guest'] && !empty($board['last_post']['id']))
         echo 
'
         <a class="smalltext up1" href="'
$scripturl'?action=unread;board='$board['id'], '">&nbsp;('$txt['view_unread_category'], ')</a>';
         if (!empty(
$board['last_post']['id']))
               echo 
'
               <br /><strong>'
$txt['latest'],':</strong>&nbsp;',$board['last_post']['time'], ' <br />
               '
$board['last_post']['link'], ' '$txt['by'], ' '$board['last_post']['member']['link'];            
            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'] ? 'topics' 'posts') . ';brd=' $child['id'] . ';sesc=' $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 colspan="3" class="windowbg4 smalltext childlist"><strong>'
$txt['subforums'], ':&nbsp;</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.png" alt="" align="middle" style="margin-left: 1ex;" /> '$txt['new_posts'], '
         <img src="' 
$settings['images_url'] . '/new_none.png" alt="" align="middle" style="margin-left: 3ex;" /> '$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;sesc=' $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'] ? 0');
      infoHeader.setOptions("collapse_header_ic", "'
$context['session_id'], '");
      infoHeader.addToggleImage("upshrink_ic", "/collapse.gif", "/expand.gif");
      infoHeader.addTogglePanel("upshrinkHeaderIC");
   // ]]></script>'
;

   
// Here's where the "Info Center" starts...
   
echo '
   <div class="tborder clearfix" id="infocenterframe">
      <h4 class="catbg headerpadding">
         <a href="#" onclick="infoHeader.toggle(); return false;">'
$txt['information'], '</a>
         </h4>
      <div id="upshrinkHeaderIC"'
, empty($options['collapse_header_ic']) ? '' ' style="display: none;"''>';

    
// If they are logged in show a personal message bar.
   
if ($context['user']['is_logged'])
   {
      echo 
'
         <div class="infocenter_section">
            <div class="windowbg5">
               <p class="section">
                  '
$context['allow_pm'] ? '<a href="' $scripturl '?action=pm">' '''<img src="'$settings['images_url'], '/message_sm.png" alt="'$txt['personal_message'], '" />'$context['allow_pm'] ? '</a>' '''
               </p>
               <div class="sectionbody"><table width="100%"><tr><td class="smalltext">
                  <strong>'
$txt['hello_member_ndt'], ' '$context['user']['name'], ',&nbsp;</strong>';
                  
// Only tell them about their messages if they can read their messages!
            
if ($context['allow_pm'])
               echo 
$txt['msg_alert_you_have'], ' <a href="'$scripturl'?action=pm">'$context['user']['messages'], ' '$context['user']['messages'] != $txt['msg_alert_messages'] : $txt['message_lowercase'], '</a>'$txt['newmessages4'], ' '$context['user']['unread_messages'], ' '$context['user']['unread_messages'] == $txt['newmessages0'] : $txt['newmessages1'] , '.<br />
               <a href="'
$scripturl'?action=unread">'$txt['unread_since'], '</a>&nbsp;<a href="'$scripturl'?action=unreadreplies">'$txt['new_since'], '</a>';
            echo 
'   
                </td><td class="smalltext" width="244">
            <form action="'
$scripturl'?action=search2" method="post" accept-charset="'$context['character_set'], '">
               <input type="text" id="infosearch" name="search" value="'
$txt['search'], '..." onfocus="this.value = \'\';" onblur="if(this.value==\'\') this.value=\''$txt['search'], '...\';" />
            </form>&nbsp;<a href="'
$scripturl'?action=search">',$txt['search_advanced_op'],'</a>&nbsp;&nbsp;<img src="'$settings['images_url'], '/buttons/search.gif" alt="" />
            </td></tr></table>               
               
               </div>
            </div>
         </div>'
;
   }      
   
   
// Show statistical style information...
   
if ($settings['show_stats_index'])
   {
      echo 
'
         <div class="infocenter_section">
            
            <div class="windowbg5">
               <p class="section">
                  <a href="'
$scripturl'?action=stats"><img src="'$settings['images_url'], '/info.png" alt="'$txt['forum_stats'], '" /></a>
               </p>
               <div class="sectionbody"><table width="100%"><tr><td class="smalltext">
                  '
, !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><br />' ''), '';
            echo 
'      
                  '
$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'], '
               </td><td class="smalltext" width="242">
                        <a href="'
$scripturl'?action=mlist">'$txt['view_mlist'], '</a><br />                
                  <a href="'
$scripturl'?action=recent">'$txt['view_posts'], '</a>'$context['show_stats'] ? '<br />
                  <a href="' 
$scripturl '?action=stats">' $txt['view_stats']  . '</a>' '''
               </td></tr></table>   
               </div>
            </div>
         </div>'
;
   }
   
   
// "Users online" - in order of activity.
   
echo '
         <div class="infocenter_section">
            <div class="windowbg5">
               <p class="section">
                  '
$context['show_who'] ? '<a href="' $scripturl '?action=who' '">' '''<img src="'$settings['images_url'], '/online.png''" alt="'$txt['online_users'], '" />'$context['show_who'] ? '</a>' '''
               </p>'
;

   
// Assuming there ARE users online... each user in users_online has an id, username, name, group, href, and link.
       
echo '
                  <div  id="onlineIC">   
                     <span class="smalltext">&nbsp;'
sprintf($txt['active_15'], $modSettings['lastActive']), '&nbsp;';
   
   if (!empty(
$context['users_online']))
   {
      echo 
'
                  '
,implode(', '$context['list_users_online']);

      
// Showing membergroups?
      
if (!empty($settings['show_group_key']) && !empty($context['membergroups']))
         echo 
'
                     <br />[' 
implode(']&nbsp;&nbsp;['$context['membergroups']) . ']';
   }
   
   echo 
'         
                     </span></div>'
;

   echo 
'
               <span class="smalltext">   
                  &nbsp;'
,$txt['on_now'],''$context['show_who'] ? '<a href="' $scripturl '?action=who">' ''$context['num_guests'], ' '$context['num_guests'] == $txt['guest'] : $txt['guests'], ', ' $context['num_users_online'], ' '$context['num_users_online'] == $txt['user'] : $txt['users'];
                   
   
// Handle hidden users and buddies.
   
$bracketList = array();
   if (
$context['show_buddies'])
      
$bracketList[] = $context['num_buddies'] . ' ' . ($context['num_buddies'] == $txt['buddy'] : $txt['buddies']);
   if (!empty(
$context['num_spiders']))
      
$bracketList[] = $context['num_spiders'] . ' ' . ($context['num_spiders'] == $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>' '''
   
                     &nbsp;&nbsp;&nbsp;'
$txt['most_online_today'], ': <b>'$modSettings['mostOnlineToday'], '</b>.
                     &nbsp;&nbsp;'
$txt['most_online_ever'], ': '$modSettings['mostOnline'], ' (' timeformat($modSettings['mostDate']), ')
               </span>   
            </div>
         </div>'
;   
         
   
// Show information about events, birthdays, and holidays on the calendar.
   
if ($context['show_calendar'])
   {
      echo 
'
         <div class="infocenter_section">
         <h4 class="headerpadding catbg">'
,$txt['calendar_upcoming'],'</h4>
            <div class="windowbg2 smalltext">   

            <p class="section">
                  <a href="'
$scripturl'?action=calendar' '"><img src="'$settings['images_url'], '/icons/calendar.png''" alt="'$context['calendar_only_today'] ? $txt['calendar_today'] : $txt['calendar_upcoming'], '" /></a>
               </p> 
            
               <div class="sectionbody">'
;
               
         
// Holidays like "Christmas", "Chanukah", and "We Love [Unknown] Day" :P.
      
echo'   
                 <span class="holiday"><strong> '
,$txt['holidays'],' </strong>';
            
      if (!empty(
$context['calendar_holidays']))
            echo 
'
                     '
implode(', '$context['calendar_holidays']);
            echo
'         
                  </span>'
;            
               
      
// People's birthdays. Like mine. And yours, I guess. Kidding.
      
echo '
               <br /><span class="birthday"><strong>&nbsp;'
$context['calendar_only_today'] ? $txt['birthdays'] : $txt['birthdays_upcoming'], '</strong></span> ';
      
      if (!empty(
$context['calendar_birthdays']))
      {
            
/* 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>' ''$member['name'], $member['is_today'] ? '</b>' '', isset($member['age']) ? ' (' $member['age'] . ')' '''</a>'$member['is_last'] ? '<br />' ', ';
      }
      
// Events like community get-togethers.
      
echo '
               <br /><span class="event"><strong>&nbsp;'
$context['calendar_only_today'] ? $txt['events'] : $txt['events_upcoming'], '</strong></span> ';
      
      if (!empty(
$context['calendar_events']))
      {
         
/* 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>'
;
   }      
         
   
// This is the "Recent Posts" bar.
   
if (!empty($settings['number_recent_posts']))
   {
      echo 
'
         <div class="infocenter_section">
            <h4 class="headerpadding catbg">'
$txt['recent_posts'], '</h4>
            <div class="windowbg2">
               <p class="section">
                  <a href="'
$scripturl'?action=recent"><img src="'$settings['images_url'], '/recent.png" alt="'$txt['recent_posts'], '" /></a>
               </p>
               <div class="sectionbody hslice" 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 '                  
               <br />   
                  <p id="infocenter_onepost" class="smalltext" align="center">
                        <strong>&quot;'
$context['latest_post']['link'], '&quot;</strong> '$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'], ' &nbsp;&nbsp;&nbsp;('$post['board']['link'], ')&nbsp;&nbsp;&nbsp;&nbsp;</dt>
                     <dd>'
$post['time'], '</dd>';
         echo 
'
                  </dl>'
;
      }
      echo 
'
               </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 catbg">'
$txt['login'], ' <a href="'$scripturl'?action=reminder" class="smalltext">('$txt['forgot_your_password'], ')</a></h4>
               <div class="windowbg4 sectionbody2">
                  <form id="infocenter_login" action="'
$scripturl'?action=login2" method="post" accept-charset="'$context['character_set'], '">
                     <ul class="horizlist clearfix">
                        <li>                            
                           <label for="user">&nbsp;&nbsp;&nbsp;&nbsp;'
$txt['username'], ':&nbsp;
                           <input type="text" name="user" id="user" size="14" /></label>
                        </li>
                        <li>
                           <label for="passwrd">'
$txt['password'], ':&nbsp;
                           <input type="password" name="passwrd" id="passwrd" size="14" /></label>
                        </li>
                        <li>
                           <label for="cookielength">'
$txt['mins_logged_in'] , ':&nbsp;
                           <input type="text" name="cookielength" id="cookielength" size="4" maxlength="4" value="'
$modSettings['cookieTime'], '" /></label>
                        </li>
                        <li>
                           &nbsp;&nbsp;&nbsp;&nbsp;<input type="submit" class="smalltext" id="botlog" value="'
$txt['login'], '" />
                        </li>
                     </ul>
                  </form>
               </div>
            </div>'
;
   }
   echo 

      </div>
   </div>'
;
}
?>



Blah blah

Message index template


<?php
// Version: 2.0 Beta 4; MessageIndex
function template_main()
{
   global 
$context$settings$options$scripturl$modSettings$txt;

   if (!empty(
$context['boards']) && (!empty($options['show_children']) || $context['start'] == 0))
   {
      echo 
'
   <div class="tborder marginbottom" id="childboards">            
         <h4 class="headerpadding catbg">'
$txt['subforums'], '';
         echo 
'
      </h4>'
;
   echo
'   
     <table cellspacing="0" class="bordercolor boardsframe">'
;
      foreach (
$context['boards'] as $board)
      {
         echo 
'
         
         <tr class="windowbg4">
            <td class="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''.png" 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.png" alt="*" title="*" border="0" />';
            
// No new posts at all! The agony!!
            
else
               echo 
'
                  <img src="'
$settings['images_url'], '/off.png" alt="'$txt['old_posts'], '" title="'$txt['old_posts'], '" />';

            echo 
'
               </a>
            </td>
            <td class="info">
               <h3><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'] ? 'topics' 'posts'), ';brd='$board['id'], ';sesc='$context['session_id'], '" title="'sprintf($txt['unapproved_posts'], $board['unapproved_topics'], $board['unapproved_posts']), '" class="moderation_link">(!)</a>';

            echo 
'
               
               <br/><span class="listings">'
$board['description'] , '';

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

            
// Show some basic information about the number of posts, etc.
               
echo '
            </td>
            <td class="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 
'
               '
$board['posts'], ' '$board['is_redirect'] ? $txt['redirects'] : $txt['posts'], ' ',$txt['in'],' &nbsp;'$board['is_redirect'] ? '' $board['topics'] . ' ' $txt['board_topics'];               
               if (!
$context['user']['is_guest'] && !empty($board['last_post']['id']))
         echo 
'
         <a class="smalltext up1" href="'
$scripturl'?action=unread;board='$board['id'], '">&nbsp;('$txt['view_unread_category'], ')</a>';
         if (!empty(
$board['last_post']['id']))
               echo 
'
               <br /><strong>'
$txt['latest'],':</strong>&nbsp;',$board['last_post']['time'], ' <br />
               '
$board['last_post']['link'], ' '$txt['by'], ' '$board['last_post']['member']['link'];            
            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'] ? 'topics' 'posts') . ';brd=' $child['id'] . ';sesc=' $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 colspan="3" class="windowbg4 smalltext childlist"><strong>'
$txt['subforums'], ':&nbsp;</strong> 'implode(', '$children), '</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;sesc=' $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'] . ';sesc=' $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="0" class="bordercolor boardsframe">
               <thead>
                  <tr>'
;

      
// Are there actually any topics to show?
      
if (!empty($context['topics']))
      {
         echo 
'
                     <th width="6%" colspan="1" class="windowbgS2 headerpadding">&nbsp;</th>
                     <th class="windowbgS3 headerpadding" align="left"><a href="'
$scripturl'?board='$context['current_board'], '.'$context['start'], ';sort=starter'$context['sort_by'] == 'starter' && $context['sort_direction'] == 'up' ';desc' '''">' ,$txt['sort_topic_starter'],' </a></th>                     
                     <th class="windowbgS4 headerpadding" width="230" align="left"><a href="'
$scripturl'?board='$context['current_board'], '.'$context['start'], ';sort=last_post'$context['sort_by'] == 'last_post' && $context['sort_direction'] == 'up' ';desc' '''">',$txt['sort_last_poster'],'</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>'
;
      }
      
// No topics.... just say, "sorry bub".
      
else
         echo 
'
                     <th class="catbg3" colspan="3"><strong>'
$txt['msg_alert_none'], '</strong></th>';

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

      if (!empty(
$settings['display_who_viewing']))
      {
         echo 
'
                  <tr>
                     <td colspan="' 
, !empty($options['display_quick_mod']) ? '8' '7' '" class="windowbg5 headerpadding smalltext">';
         if (
$settings['display_who_viewing'] == 1)
            echo 
count($context['view_members']), ' 'count($context['view_members']) == $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'] == $txt['guest'] : $txt['guests'], $txt['who_viewing_board'], '
                     </td>
                  </tr>'
;
      }

      
// If this person can approve items and we have some awaiting approval tell them.
      //NOTE: TEST THE COLSPAN HERE. New SMF 2 feature that needs to be checked.
      
if (!empty($context['unapproved_posts_message']))
      {
         echo 
'
                  <tr class="windowbg">
                     <td colspan="' 
, !empty($options['display_quick_mod']) ? '8' '7' '" class="smalltext headerpadding">
                           <span style="color: red;">!</span> '
$context['unapproved_posts_message'], '
                     </td>
                  </tr>'
;
      }

      foreach (
$context['topics'] as $topic)
      {
         
// 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'], 0strrpos($topic['class'], '_sticky'));
         if (!empty(
$settings['separate_sticky_lock']) && strpos($topic['class'], 'locked') !== false)
            
$topic['class'] = substr($topic['class'], 0strrpos($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'] ? 'windowbgS' 'windowbg4';

         echo 
'
                  <tr>
                                           
                     <td class="windowbg4 icon2">
                        <img src="'
$topic['first_post']['icon_url'], '" alt="" />
                     </td>
                     <td class="subject '
$color_class'" ', (!empty($topic['quick_mod']['remove']) ? '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'] . '\');"' ''), '>';

         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>' '
                        ' 
$topic['is_sticky'] ? '<img src="' $settings['images_url'] . '/icons/show_sticky.gif" align="right" alt="" id="stickyicon' $topic['first_post']['id'] . '" style="margin: 0;" />' '';

         
// 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 
'
                        <span id="pages' 
$topic['first_post']['id'] . '">'$topic['pages'], '</span><br />
                        <span class="smalltext">'
$txt['started_by'],'<strong>&nbsp;'$topic['first_post']['member']['link'], '</strong>
                        &nbsp;&nbsp;&nbsp;<strong>'
$topic['replies'], '</strong>&nbsp;'$txt['replies'],'&nbsp;&nbsp;&nbsp;<strong>'$topic['views'], '</strong>&nbsp;'$txt['views'],'</span>
                     </td>
                     
                     
                     
                     <td class="windowbg4 replies">'
;
                     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;" />' '' '';

            echo
'         
                         <span class="smalltext">
                        <a href="'
$topic['last_post']['href'], '"><strong>'$txt['latest'],'</strong>&nbsp;</a>',$txt['by'],'&nbsp;'$topic['last_post']['member']['link'], '<br />
                           '
$topic['last_post']['time'], '
                        </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;sesc='$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;sesc='$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;sesc='$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'] == && !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'] > 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="sc" 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="catbg clearfix">
         <p class="floatright" id="message_index_jump_to">&nbsp;</p>'
;

   if (!
$context['no_topic_listing'])
         echo 
'
         
         <span class="smalltext" >&nbsp;&nbsp;&nbsp;&nbsp;
            <img src="' 
$settings['images_url'] . '/icons/quick_lock.gif" alt="" align="middle" /> ' $txt['locked_topic'] . ' &nbsp;&nbsp;&nbsp;&nbsp;' . ($modSettings['enableStickyTopics'] == '1' '
            <img src="' 
$settings['images_url'] . '/icons/quick_sticky.gif" alt="" align="middle" /> ' $txt['sticky_topic'] . '&nbsp;&nbsp;&nbsp;&nbsp;' '') . ($modSettings['pollMode'] == '1' '
            <img src="' 
$settings['images_url'] . '/topic/normal_poll.gif" alt="" align="middle" /> ' $txt['poll'] : '') . '
         </span>'
;

   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;sesc=' $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'] . ';sesc=' $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);
}

?>



Yahmez

Quote from: Blah blah on September 25, 2009, 02:43:55 AM
Ok here is...if someone could add the code in for me to enable this I would be in debt forever :)

Here try these:


Blah blah

K thanks I'll add these soon :) ....where do I need to put the icons though (folder) ?

Yahmez

/Themes/default/icons/BOARD ID/off.png
board id should be a number... like 1

Blah blah

Ok thx but dont I need to add it to my custom theme folder instead of the default folder?

Yahmez

Quote from: Blah blah on September 25, 2009, 04:01:58 PM
Ok thx but dont I need to add it to my custom theme folder instead of the default folder?

Not too sure on that... I use it on the default theme.

Blah blah

Quote from: Yahmez on September 25, 2009, 06:11:52 PM
Quote from: Blah blah on September 25, 2009, 04:01:58 PM
Ok thx but dont I need to add it to my custom theme folder instead of the default folder?

Not too sure on that... I use it on the default theme.

Well I figured it out thanks for all your help  :D

My theme got a tad bit messed up in the process lol but Ill figure out how to fix it :)

Blah blah

Ok I added the same board icons for the child boards as the parent boards have but if there is unread topics in the child and not the parent boards the default icon shows? Any fix for that?

dyrome

its a good mod but can some one make it possible that if you make a new board you can choose directly a image as board icon or upload it when you create a board.

this is beter than creating for every board a map with off,on and on2.png image.

i will like this very much to be possible

sorry for my bad english i am dutch.

i have version SMF 2.0 RC1.2
greetings,

Dyrome

Kindred

dyrome,

almost anything is POSSIBLE. However, this is actually a very simple mod.... and what you are asking for is MUCH more involved.
Слова
Украина

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

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

Blah blah

Quote from: Blah blah on September 28, 2009, 12:54:52 PM
Ok I added the same board icons for the child boards as the parent boards have but if there is unread topics in the child and not the parent boards the default icon shows? Any fix for that?

Yahmez

Quote from: Blah blah on September 28, 2009, 12:54:52 PM
Ok I added the same board icons for the child boards as the parent boards have but if there is unread topics in the child and not the parent boards the default icon shows? Any fix for that?
Are you saying that in board 3 for instance you have a

.../icons/3/on.png
.../icons/3/on2.png

where your on.png is the parent board, on2.png is the child and a duplicate of on.png? If you have it set up like that it should work.

If not you could always change this part of the code:
                    if (file_exists($settings['theme_dir'] . '/icons/' . $board['id'] . '/on2.png'))
                        $childboard_new_img=$settings['theme_url']. '/icons/' . $board['id'] . '/on2.png';
                    else
                        $childboard_new_img=$settings['images_url']. '/on2.png';
       
                        echo '<img src="', $childboard_new_img,'" alt="', $txt['new_posts'], '" title="', $txt['new_posts'], '" border="0" />';   
                }

to this
                    if (file_exists($settings['theme_dir'] . '/icons/' . $board['id'] . '/on.png'))
                        $childboard_new_img=$settings['theme_url']. '/icons/' . $board['id'] . '/on.png';
                    else
                        $childboard_new_img=$settings['images_url']. '/on2.png';
       
                        echo '<img src="', $childboard_new_img,'" alt="', $txt['new_posts'], '" title="', $txt['new_posts'], '" border="0" />';   
                }

Blah blah

Oh no I didn't have it set up like that lol

I had it like...say the parent is board 3 and the child 4 I had 2 different folders with the same on/off png's

Didn't know they needed to be in the parents folder :) thanks

Yahmez

Quote from: Blah blah on September 30, 2009, 02:23:31 AM
Oh no I didn't have it set up like that lol

I had it like...say the parent is board 3 and the child 4 I had 2 different folders with the same on/off png's

Didn't know they needed to be in the parents folder :) thanks

After getting some sleep... I think I told you wrong.
Let's assume board 3 is the parent and 4 is the child.

.../icons/3/on.png    is the new posts icon for the parent board
.../icons/3/on2.png   is the new posts icon for the child board (on the board index)

.../icons/4/on.png    is the new posts icon for the child board (in the message index)

Blah blah


Milossh

Hello,

AFAIK, same mod will work on RC1.1 and RC 2.2. So please, can you update this mode to be able to install on RC 1.2 too.

Yahmez

I have it installed on 2.0 RC 1.2
It installed without errors and afterward I edited the mod to my liking... anyways it should work for you.

Advertisement: