To use this website completely, it is necessary to store cookies on your computer.
 

Forum Block Update (curve)

Started by mikeymx5, 7 years ago

previous topic - next topic

0 Members and 0 Guests are viewing this topic.

mikeymx5

7 years ago
Here is a Forum Block, that will show the latest post simular to the way SMF will. This will give you control over what forums you want to show in your latest post on a particular page.



CORE THEME
Code Select
global $settings, $txt;

// Boardnumbers you see
$my_boards = array(1,3,4,5,6,7,8,10,11,22,23,16,17,18,19,20,21,25);
// Number of topics (use odd number)
$numPosts = 15;
// call the ssi function
$result = ssi_recentTopics($numPosts, null, $my_boards, '');


echo '
   <table width="100%" border="0" cellpadding="1" cellspacing="1">
<tr>
<th class="titlebg2" style="width: 10px;"> </th>
<th class="titlebg2" style="padding:4px;">Topic</th>
<th class="titlebg2" style="width: 25px;">Replies</th>
<th class="titlebg2" style="width: 150px;">Last Post</th>
</tr>';



foreach($result as $post)
{
   echo '
            <tr>
<td id="messageindex" class="windowbg2"  style="padding-left:5px; padding-right:5px;">'. $post['icon'] .'</td>
<td class="windowbg" style="padding-left:5px; ">
   <span class="normaltext" ><b>'. $post['link'] .($post['new']
  ? ''
  : '<span style="padding-left:5px;">
  <img src="' . $settings['lang_images_url'] . '/new.gif" alt="new" border="0" /></span>') .'</b></span><br>
   <span class="smalltext">['. $post['board']['link'] .']</span>
</td>
<td class="windowbg2" style="text-align:center;">'. $post['replies'] .'</td>
<td class="windowbg smalltext" >'. $post['time'] .' by: '. $post['poster']['link'] .'</td>
</tr>';
}


   echo '
 
   </table>';


CURVE THEME
Code Select
global $settings, $txt;

// Boardnumbers you see
$my_boards = array(1,3,4,5,6,7,8,10,11,22,23,16,17,18,19,20,21);
// Number of topics (use odd number)
$numPosts = 15;
// call the ssi function
$result = ssi_recentTopics($numPosts, null, $my_boards, '');


echo '
   <table width="100%" class="table_grid" cellspacing="0" >
      <thead>
         <tr>
         <th scope="col" class="smalltext first_th" colspan="1" width="4%"> </th>
         <th scope="col" class="smalltext">Subject/Forum</th>
         <th scope="col" class="smalltext center" width="14%">Replies</th>
         <th scope="col" class="smalltext last_th" width="22%">Last Post</th>
         </tr>
      </thead>
      <tbody>';

foreach($result as $post)
{
   echo ' 
        <tr>
<td class="icon2 windowbg">'. $post['icon'] .'</td>
<td class="subject windowbg2">
                     <div>
<span ><b>'. $post['link'] .($post['new'] ? '' : ' <img src="' . $settings['lang_images_url'] . '/new.gif" alt="new" border="0" />') .'</b></span><br>
<span class="smalltext ">Located in '. $post['board']['link'] .'</span>
                     <div></td>
<td class="stats windowbg smalltext center">'. $post['replies'] .' Replys<br>'. $post['views'] .' Views</td>
<td class="lastpost windowbg2 smalltext" >'. $post['time'] .' by: '. $post['poster']['link'] .'</td></tr>';
}

   echo '
   </tbody> 
   </table>';


[attachment deleted by admin]

agent47

#1
5 years ago
An amazing mod... Looks splendid. Just one thing though - how do I get it to display the icon of the "FIRST" post instead of the most current ?

mikeymx5

#2
5 years ago
Sorry dont get on here much unless downloading updates my website is pretty much complete.

I will have to look into this next time im updating code.