TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

May 15, 2024, 01:11:43 AM

Login with username, password and session length
Members
  • Total Members: 3,886
  • Latest: Grendor
Stats
  • Total Posts: 195,188
  • Total Topics: 21,220
  • Online today: 130
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 119
  • Total: 119

"recent topics" in SMF style

Started by Lesmond, August 17, 2005, 12:01:38 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

alhaudhie



how can we add category name before the subject like smf default one?

IchBin

I can't see what you're talking about. The picture is too small.

alhaudhie

Quote from: IchBinâ,,¢ on July 07, 2008, 02:15:13 PM
I can't see what you're talking about. The picture is too small.

The original code for this topic only show
Topic Subject-Poster Name-Date

But how can we add category name before the topic subject like the default smf recent post.

b33znutz

#403
Quote from: alhaudhie on July 07, 2008, 04:24:52 PM
Quote from: IchBinâ,,¢ on July 07, 2008, 02:15:13 PM
I can't see what you're talking about. The picture is too small.

The original code for this topic only show
Topic Subject-Poster Name-Date

But how can we add category name before the topic subject like the default smf recent post.

that is what i came here for this time! just want to add a category(boardname) row....

UPDATE:
i did it myself... added "board name" column .. (i totally guessed!!)   O0

click to enlarge


       

       
global $scripturl;

echo '
                        <table border="0" width="100%" cellspacing="1" cellpadding="4" class="bordercolor">
                               <tr><td colspan="6" class="titlebg">Recent Posts</td></tr> ';
       $what=ssi_recentTopics('4', 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="10%">
                                                ', $topic['poster']['link'], '
                                        </td>

                                        </td>
                                        <td class="windowbg" valign="middle" width="10%">
                                                ', $topic['board']['link'], '
                                        </td>


                                        <td class="windowbg2" valign="middle" width="20%">';
                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>';


IchBin

Why not just use ssi_recentTopics(); then?

b33znutz

Quote from: IchBinâ,,¢ on July 08, 2008, 05:20:28 AM
Why not just use ssi_recentTopics(); then?

no offense ich, but the question was "how" ... which would lead me to believe that the poster didnt know what they were doing. which would lead me to beleive that the poster wouldnt know about ssi_ stuff... i dont.. i just looked at the source and messed with it until it worked.. only took about 15mins to figure it out.....

just my thoughts.....

IchBin

Well I assumed since the poster said they wanted it to look like SMF's that they knew about SMF's stuff. If the don't know what ssi is, then a quick search here and at SMF will bring up the answer.

alhaudhie

 :up:

Nice interaction and nice job.. thanks all...

b33znutz

Quote from: IchBinâ,,¢ on July 08, 2008, 05:34:32 AM
Well I assumed since the poster said they wanted it to look like SMF's that they knew about SMF's stuff. If the don't know what ssi is, then a quick search here and at SMF will bring up the answer.
seriously, no offense bro! just tryin to help.. most of the posts are 1+ years old and some of us are need some help this year, so i try...

IchBin

No offense taken. But what is the difference between last years posts and this years? They are still relevant. Which is why we suggest a search. If the search is exhausted I don't mind helping out.