Login  |  Register
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome, Guest. Please login or register.
Did you miss your activation email?

November 28, 2022, 10:20:40 PM

Login with username, password and session length
Members
  • Total Members: 3853
  • Latest: tty456
Stats
  • Total Posts: 193617
  • Total Topics: 21105
  • Online today: 60
  • Online ever: 3540
  • (September 02, 2022, 06:38:54 PM)
Users Online
Users: 0
Guests: 52
Total: 52

Author Topic: "recent topics" in SMF style  (Read 269935 times)

0 Members and 1 Guest are viewing this topic.

Bjørn

  • Guest
"recent topics" in SMF style
« on: August 17, 2005, 05:01:38 AM »
This is requested elsewhere, but I though I post it here. It essentially use the SSI function for collecting the recent topics, and lay them out like the threads overview of the forum.

- use a PHP type block and just insert the code down below.
- use it preferably on a centerblock or frontblock - since its quite wide.
- looks best with "do not use title/frame" for the block, it has it own titlebar.
- add board ID number like to the function if youw ant to narrow down the boards recent topics are taken from. change it to ssi_recentTopics('8', array('3','56') , 'array') where the numbers 3 and 56 are examples of board ID's.


Code: [Select]
       
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>';

edit: added a extra line on top, since errors were created.

[attachment deleted by admin]
« Last Edit: April 20, 2006, 09:52:03 AM by Bloc »

Offline Ray

  • Sr. Member
  • ****
  • Posts: 446
Re: "recent topics" in SMF style
« Reply #1 on: August 17, 2005, 09:51:02 AM »
Works good but will not uncheck the post after the post has been read

Offline Nokonium

  • Aging Hippie
  • Friends
  • *
  • Posts: 1384
    • Our-Local
Re: "recent topics" in SMF style
« Reply #2 on: August 17, 2005, 10:30:29 AM »
Ray
One of my posts was the "elsewhere"  ;)

If you check you will find that the read and unread post topics are reversed. If you read one shown as unread it will then have a 'New' but, yes, if you read one marked 'New' it doesn't change.
« Last Edit: August 17, 2005, 10:32:10 AM by nokonium »

Offline Ray

  • Sr. Member
  • ****
  • Posts: 446
Re: "recent topics" in SMF style
« Reply #3 on: August 17, 2005, 11:36:59 AM »
Ah! ok thanks

Bjørn

  • Guest
Re: "recent topics" in SMF style
« Reply #4 on: August 17, 2005, 03:45:55 PM »
Changed the code..does it work better now?

Offline Nokonium

  • Aging Hippie
  • Friends
  • *
  • Posts: 1384
    • Our-Local
Re: "recent topics" in SMF style
« Reply #5 on: August 17, 2005, 04:10:24 PM »
Yup! they are the right way round again. Thanks Bloc

It was terribly confusing, when you are over 50 you have enough difficulty remembering what you've read anyway .....  ;)

Offline Ray

  • Sr. Member
  • ****
  • Posts: 446
Re: "recent topics" in SMF style
« Reply #6 on: August 17, 2005, 05:44:33 PM »
Aye works OK now -- yep over 50 can be a pain sometimes lol -- like remembering how to get home from work

Offline Ray

  • Sr. Member
  • ****
  • Posts: 446
Re: "recent topics" in SMF style
« Reply #7 on: August 17, 2005, 06:13:29 PM »
How hard would it be to change it To recent post and not topics -- just wondering? :-\

Bjørn

  • Guest
Re: "recent topics" in SMF style
« Reply #8 on: August 17, 2005, 06:32:29 PM »
You mean like the "recent posts" on the forum? (action=recent)

Offline Ray

  • Sr. Member
  • ****
  • Posts: 446
Re: "recent topics" in SMF style
« Reply #9 on: August 17, 2005, 08:45:16 PM »
yes on all forums that have permission to see the post

what Im looking for is here

Show forum-posts on frontpage from:(can pisck only one forum)

to be able to have more than one forum at a time.
« Last Edit: August 18, 2005, 11:35:19 AM by Ray »