TinyPortal

Development => Block Codes => Topic started by: metal13 on January 16, 2007, 06:05:04 PM

Title: last post from a board
Post by: metal13 on January 16, 2007, 06:05:04 PM
does anyone have this code? last 5 or more post from a board? like the front page of tp? how do i get the code of that?  :) ::)
Title: Re: last post from a board
Post by: JPDeni on January 16, 2007, 06:19:49 PM
How would you decide which board is displayed?
Title: Re: last post from a board
Post by: IchBin on January 16, 2007, 07:04:58 PM
Look at the recent topics code taht block has posted in this forum. You can find it in the index post stickied at the top. You can exclude any boards that you don't want recent_Topics to pick up.
Title: Re: last post from a board
Post by: metal13 on January 16, 2007, 11:09:10 PM
hmm ok ill search for it, thanks
Title: Re: last post from a board
Post by: metal13 on January 16, 2007, 11:17:06 PM
is this the code for it? how do i use it only for one board? like i only want to show the recent topics from board 58

       
global $scripturl;

echo '
                        <table border="0" width="100%" cellspacing="1" cellpadding="4" class="bordercolor">
                               <tr><td colspan="3" class="titlebg">Recent topics</td></tr> ';
       $what=ssi_recentTopics('8', NULL, 'array');


        foreach ($what as $topic)
        {
                echo '
                                <tr>
                                        <td class="windowbg" valign="middle">
                                                ', $topic['link'];

                // Is this topic new? (assuming they are logged in!)
                if (!$topic['new'] && $context['user']['is_logged'])
                        echo '
                                                <a href="', $scripturl, '?topic=', $topic['topic'], '.from', $topic['new_from'], '#new"><img src="', $settings['images_url'], '/', $context['user']['language'], '/new.gif" alt="', $txt[302], '" border="0" /></a>';

                echo '
                                        </td>
                                        <td class="windowbg2" valign="middle" width="20%">
                                                ', $topic['poster']['link'], '
                                        </td>
                                        <td class="windowbg2" valign="middle" width="35%">';
                if ($settings['images_url'] != $settings['theme_url'] . '/images' || file_exists($settings['theme_dir'] . '/images/icons/last_post.gif'))
                        echo '
                                        <a href="', $topic['href'], '"><img src="', $settings['images_url'], '/icons/last_post.gif" alt="', $txt[111], '" title="', $txt[111], '" border="0" style="float: right;" /></a>';
                echo '
                                                <span class="smalltext">
                                                        ', $topic['time'], '
                                                </span>
                                        </td>
                                </tr>';
        }

        echo '
                        </table>';
Title: Re: last post from a board
Post by: metal13 on January 16, 2007, 11:18:40 PM
ohh ok, no need.. its the "8" right... ill try it out
Title: Re: last post from a board
Post by: metal13 on January 16, 2007, 11:45:09 PM
i tried this code but it did not work..
       $what=ssi_recentTopics('8', array('429','430','431','432') , 'array');


i want to get the recent topics from the child boards  this board
http://www.pinoystream.net/pt/index.php/board,426.0.html

help please...


Title: Re: last post from a board
Post by: JPDeni on January 17, 2007, 12:42:00 AM
In the $what line array, you list the boards you don't want to include.
Title: Re: last post from a board
Post by: metal13 on January 17, 2007, 06:56:24 PM
hmmm... is there a code only for a single board? coz i have like 400+ boards on my forum.. hehe.. i cant do that...  any more codes please?...
Title: Re: last post from a board
Post by: JPDeni on January 17, 2007, 06:58:48 PM
http://www.tinyportal.net/index.php?topic=1234.0
Title: Re: last post from a board
Post by: metal13 on January 18, 2007, 12:12:15 PM
thanks!