Language: 
To browser these website, it's necessary to store cookies on your computer.
The cookies contain no personal information, they are required for program control.
  the storage of cookies while browsing this website, on Login and Register.
Welcome, Guest. Please login or register.
Did you miss your activation email?


Login with username, password and session length

Select language:

Community



Donate

Donate for PortaMx !
Your donation is safe and helps support the issues and causes you care most about.

Stats

  • *Total Members: 4339
  • *Latest: AJ

  • *Total Posts: 15832
  • *Total Topics: 2396
  • *Online Today: 9
  • *Most Online: 157
(27.08.09, 03:54:53)
  • *Users: 0
  • *Guests: 4
  • *Total: 4

Author Topic: Forum Block Update (curve)  (Read 4177 times)

0 Members and 0 Guests are viewing this topic.

Offline mikeymx5

  • Jr. Member
  • **
  • Posts: 73
  • Gender: Male
    • Houston Miata Club
Forum Block Update (curve)
« on: 10.05.10, 22:50:37 »
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>';

Offline agent47

  • Newbie
  • *
  • Posts: 45
  • Gender: Male
    • Superhero Alliance
Re: Forum Block Update (curve)
« Reply #1 on: 30.10.11, 17:00:55 »
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 ?

Offline mikeymx5

  • Jr. Member
  • **
  • Posts: 73
  • Gender: Male
    • Houston Miata Club
Re: Forum Block Update (curve)
« Reply #2 on: 28.11.11, 22:51:31 »
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.