TinyPortal

Development => Block Codes => Topic started by: brianjw on April 21, 2007, 04:30:32 PM

Title: SMALL RECENT FORUM TOPICS
Post by: brianjw on April 21, 2007, 04:30:32 PM
INSTRUCTIONS
Place the code below into a "scriptblock" or modify the theme you're using and add it wherever you want. This is viewed best using "center block" type but I think will squeeze into a right or left block as well. :) Remember to save the image below.

CODE
<table border="0" width="100%" height="210" cellspacing="0" cellpadding="0" bgcolor="#24292f" height="210" background="', $settings['images_url'], '/topicbox.png"><tr><td height="1"></td></tr>';
       $what=ssi_recentTopics('6', NULL, 'array');


        foreach ($what as $topic)
        {
                echo ' <tr><td valign="middle" style="padding-left: 3px; padding-right: 2px;" class="headertext" align="left">
                                                <b>&raquo;</b>  ', $topic['link'];

                echo '</td></tr><tr><td style="padding-right: 5px;" class="headertext" align="right">
                                         ';

                echo '

                                                        By: ', $topic['poster']['link'], ' @ ', $topic['time'], '

                                   
                                        </td>
                                </tr>';
        }

        echo '
                        </table>


DOWNLOAD
Download the attached image to this topic and save it in your theme image folder. /Themes/THEME_NAME/images/ Save it as topicbox.png.

DEMO
http://www.gamerzgarage.com/index.php (at the top of the theme)

Brianjw :)
Title: Re: SMALL RECENT FORUM TOPICS
Post by: soMzE on May 09, 2007, 08:42:37 PM
Sorry i did exactly what you have explained here but it does not seem to work :(
Title: Re: SMALL RECENT FORUM TOPICS
Post by: rebelrose on May 09, 2007, 09:19:45 PM
Quote from: soMzE on May 09, 2007, 08:42:37 PM
Sorry i did exactly what you have explained here but it does not seem to work :(

What are you looking to do exactly? I know a recent post block but what kind, there is one that comes automatic with TP did you want to modify it some way?
Title: Re: SMALL RECENT FORUM TOPICS
Post by: soMzE on May 10, 2007, 06:50:16 AM
Quote from: Ã,©RebelRose on May 09, 2007, 09:19:45 PM
Quote from: soMzE on May 09, 2007, 08:42:37 PM
Sorry i did exactly what you have explained here but it does not seem to work :(

What are you looking to do exactly? I know a recent post block but what kind, there is one that comes automatic with TP did you want to modify it some way?

I have tp disabled within the forums only not for the main forum page, but i want my users to view the recent forum topics everywhere they go :)

I viewed this code snippit on BrianJw's page but when i put it is in a script block al i see is code, maybe there is something missing in the script?
Title: Re: SMALL RECENT FORUM TOPICS
Post by: IchBin on May 10, 2007, 07:00:48 AM
It doesn't go in a script block. It should go in a phpbox.
Title: Re: SMALL RECENT FORUM TOPICS
Post by: soMzE on May 10, 2007, 07:02:08 AM
Quote from: IchBinâ„¢ on May 10, 2007, 07:00:48 AM
It doesn't go in a script block. It should go in a phpbox.

Sorry forgot to mention i tried this as well and the box stays empty :(
Title: Re: SMALL RECENT FORUM TOPICS
Post by: Zetan on May 10, 2007, 07:38:38 AM
I tested it last night, I couldn't get it to work. I didn't really have time to play with for ages so I gave up.
It does seem to work at Brians site though.
Title: Re: SMALL RECENT FORUM TOPICS
Post by: Svaha on May 10, 2007, 11:47:42 PM
I see a fatal error on the site of Brian, and when I click on a link of the small 'recent topics' block it leads me nowhere, I keep getting only the front page. (maxthon browser with IE6 engine)
Title: Re: SMALL RECENT FORUM TOPICS
Post by: IchBin on May 11, 2007, 12:47:59 AM
Looking closer at the code now, sorry I didn't see this before. But it appears that the code is missing quite a few things.
Try this and see if it works.
echo '<table border="0" width="100%" height="210" cellspacing="0" cellpadding="0" bgcolor="#24292f" height="210" background="', $settings['images_url'], '/topicbox.png"><tr><td height="1"></td></tr>';
       $what=ssi_recentTopics('6', NULL, 'array');


        foreach ($what as $topic)
        {
                echo ' <tr><td valign="middle" style="padding-left: 3px; padding-right: 2px;" class="headertext" align="left">
                                                <b>&raquo;</b>  ', $topic['link'];

                echo '</td></tr><tr><td style="padding-right: 5px;" class="headertext" align="right">
                                         ';

                echo '

                                                        By: ', $topic['poster']['link'], ' @ ', $topic['time'], '

                                   
                                        </td>
                                </tr>';
        }

        echo '
                        </table>';
Title: Re: SMALL RECENT FORUM TOPICS
Post by: Svaha on May 13, 2007, 09:39:10 AM
This (above) does the job, but it kind of spreads out all over the center (php block) http://www.amevita.eu/forum
Title: Re: SMALL RECENT FORUM TOPICS
Post by: Assistance on May 13, 2007, 10:07:58 AM
Quote from: Svaha on May 13, 2007, 09:39:10 AM
This (above) does the job, but it kind of spreads out all over the center (php block) http://www.amevita.eu/forum
change : echo '<table border="0" width="100%

also, may I suggest a change to your bg image? your current one is very dark

Title: Re: SMALL RECENT FORUM TOPICS
Post by: Svaha on May 13, 2007, 01:08:34 PM
Yes thank you, I know, the "original" posted at the beginning of this topic was not that wide, but maybe that's because it was build into the theme or something.
The code posted by IchBin works, that's what I wanted to test.