SimplePortal

Support => English Support => Topic started by: GrannyT on June 13, 2011, 05:58:09 PM

Title: Maximum number of Recent Posts
Post by: GrannyT on June 13, 2011, 05:58:09 PM
Hi - is there a maximum number of recent posts that can be displayed please? Am trying to increase from 16 to 24 but the block isn't accepting it.
Title: Re: Maximum number of Recent Posts
Post by: Old Fossil on June 18, 2011, 11:58:07 AM
Try this in a php block.

This is what I use on my portal.

Although scrolling it may help.
Title: Re: Maximum number of Recent Posts
Post by: GrannyT on June 18, 2011, 12:47:21 PM
Thanks Brack1 - but I'm not seeing a code, am I missing an attachment somewhere?

I did try the scrolling code but couldn't figure out how to block some boards from showing on it so went back to the standard layout. :)
Title: Re: Maximum number of Recent Posts
Post by: Old Fossil on June 18, 2011, 02:09:28 PM
Not a coder though I expect the board numbers may need to be removed.
Title: Re: Maximum number of Recent Posts
Post by: GrannyT on June 18, 2011, 02:27:34 PM
Sorry - when I was talking about not seeing a code I meant here - you said Try this in a php block but I don't know what 'this' is.
Title: Re: Maximum number of Recent Posts
Post by: Old Fossil on June 18, 2011, 02:32:46 PM
OOPs

:-[

Here ya go. I really must upgrade my memory at some point.



 :-[
Code: [Select]
global $txt, $scripturl, $settings, $context, $color_profile;

   $boards = null;
   $limit = 30;
   $type = 'ssi_recentTopics'; // Can also be 'ssi_recentPosts' for recent posts.
   $display = 'full'; // Could also be 'compact' for showing on the left and right sides. Although it doesn't work as well.

   $items = $type($limit, null, $boards, 'array');

   if (empty($items))
   {
      echo '
                        ', $txt['error_sp_no_posts_found'];
      return;
   }
   else
      $items[count($items) - 1]['is_last'] = true;

   $colorids = array();
   foreach ($items as $item)
      $colorids[] = $item['poster']['id'];

   if (!empty($colorids) && sp_loadColors($colorids) !== false)
   {
      foreach ($items as $k => $p)
      {
         if (!empty($color_profile[$p['poster']['id']]['link']))
            $items[$k]['poster']['link'] = $color_profile[$p['poster']['id']]['link'];
      }
   }

   echo '<marquee behavior="scroll" direction="up" height="170px" scrolldelay=" 10" scrollamount=" 1" onmouseover="this.stop()" onmouseout="this.start()">';

   if ($display == 'compact')
   {
      foreach ($items as $key => $item)
         echo '
                        <a href="', $item['href'], '">', $item['subject'], '</a> <span class="smalltext">', $txt['by'], ' ', $item['poster']['link'], $item['new'] ? '' : ' <a href="' . $scripturl . '?topic=' . $item['topic'] . '.msg' . $item['new_from'] . ';topicseen#new" rel="nofollow"><img src="' . $settings['lang_images_url'] . '/new.gif" alt="' . $txt['new'] . '" border="0" /></a>', '<br />[', $item['time'], ']</span><br />', empty($item['is_last']) ? '<hr />' : '';
   }
   elseif ($display == 'full')
   {
      echo '
                        <table class="sp_fullwidth">';

      foreach ($items as $item)
         echo '
                           <tr>
                              <td class="sp_recent_icon sp_center">
                                 ', sp_embed_image(empty($parameters['type']) ? 'post' : 'topic'), '
                              </td>
                              <td class="sp_recent_subject">
                                 <a href="', $item['href'], '">', $item['subject'], '</a>
                                 ', $item['new'] ? '' : '<a href="' . $scripturl . '?topic=' . $item['topic'] . '.msg' . $item['new_from'] . ';topicseen#new"><img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/new.gif" alt="' . $txt['new'] . '" border="0" /></a>', '<br />[', $item['board']['link'], ']
                              </td>
                              <td class="sp_recent_info sp_right">
                                 ', $item['poster']['link'], '<br />', $item['time'], '
                              </td>
                           </tr>';

      echo '
                        </table>';
   }
   
   echo '</marquee>';
Title: Re: Maximum number of Recent Posts
Post by: GrannyT on June 18, 2011, 02:36:58 PM
 ;D Thank you!
SimplePortal 2.3.8 © 2008-2024, SimplePortal