News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Which is the action for the recent topics?

Started by aksal, December 25, 2018, 03:43:14 PM

Previous topic - Next topic

aksal

Any idea which is the action for the most recently updated topics?
I thought it was ?action=recenttopics but it seems that it doesn't work! https://www.simplemachines.org/community/index.php?action=recenttopics


Arantor

There is no action out of the box for recent topics; it's not a feature in an unmodified SMF.

Sir Osis of Liver

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Arantor

For some portals, maybe, I've long since given up working out which portals have which features.


aksal

Quote from: Arantor on December 25, 2018, 03:43:52 PM
There is no action out of the box for recent topics; it's not a feature in an unmodified SMF.

I know you marked the topic as solved, but I have to ask. Couldn't be possible a small mod, which only can activate such an action, without having to install portals or full-featured mods. Just like the action=recent to have an action=topics.
It could be very handy!

Mick.

Maybe creating a php file in your forum root called recenttopics.php and add the following.... Just replace the asterisks with your database name. It can be accessed via yoursite.com/recenttopics.php but you would have to add a link to the user area in index.template.php

Im sure there are other approaches. Hopefully others chime in.  ;)

Replace the 25 with the number of topics you want to show.

<?php require("/home/*********/public_html/SSI.php"); 
$context['page_title_html_safe'] = 'Recent Topics';

template_header(); 

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('25'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>'
;


template_footer(); ?>



This is the laziest form. It uses tables. I dont like it but with some CSS love can be easily achieved.

Shambles

Quote from: Mick.
Just replace the asterisks with your database name.

I'm pretty sure you didn't mean "database"  :P

Mick.

Quote from: Sh@mbles on December 26, 2018, 06:37:26 AM
Quote from: Mick.
Just replace the asterisks with your database name.

I'm pretty sure you didn't mean "database"  :P
Hahaha  oops, that what happens when you mix xmas day, drinks and SMF lol.   Too bad i cant edit my post. It seems post editing here on SMF is limited. Lame.

To the OP, replace the asterisks with the access name to your root.

Kindred

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Advertisement: