All pastes #735878 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-10-14 00:54 UTC
rendered paste body
   // This is the "Recent Posts" bar.
   if (!empty($settings['number_recent_posts']))
   {
      echo '
            <tr>
               <td class="titlebg" colspan="2">', $txt[214], '</td>
            </tr>
            <tr>
               <td class="windowbg" width="20" valign="middle" align="center">
                  <a href="', $scripturl, '?action=recent"><img src="', $settings['images_url'], '/post/xx.gif" alt="', $txt[214], '" /></a>
               </td>
               <td class="windowbg2">';

      // 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 '
                  <b><a href="', $scripturl, '?action=recent">', $txt[214], '</a></b>
                  <div class="smalltext">
                        ', $txt[234], ' "', $context['latest_post']['link'], '" ', $txt[235], ' (', $context['latest_post']['time'], ')<br />
                  </div>';
      }
      // Show lots of posts.
      elseif (!empty($context['latest_posts']))
      {
         echo '
                  <table cellpadding="0" cellspacing="0" width="100%">';

         /* 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 '
                     <tr>
                        <td class="windowbg" valign="middle" width="40%" style="padding-left: 10px; font-size:85%">', $post['link'], '</td>
                        <td class="windowbg" valign="middle" width="15%" style="padding-left: 10px; font-size:85%" nowrap="nowrap">', $post['poster']['link'], '</td>
                        <td class="windowbg" valign="middle" width="25%" style="padding-left: 10px; font-size:85%" nowrap="nowrap">', $post['board']['link'], '</td>
                        <td class="windowbg" valign="middle" width="20%" style="padding-left: 10px; font-size:85%" nowrap="nowrap">', $post['time'], '</td>

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