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

Recent

Welcome to TinyPortal. Please login or sign up.

May 18, 2024, 10:30:19 PM

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

"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.

IchBin

Don't be afraid to try things alhaudie.
Add some spaces.
/>&nbsp;&nbsp;</a>';

alhaudhie

i try to make recent topic for 40 posts.. but it still limit only for only 21
recentTopics('8', NULL, 'array');  i have change 8 to 40

mrbean17

Quote from: DASBEAN on October 23, 2007, 09:39:47 PM
Is it possible to add a message stating that you need to register if a guest is viewing?

Thanks

Just following up ... months later!

Thanks

Smoky

there should be a few codes or scripts around here for that ;)

IchBin

To the last few posters..... WHAT code are you guys using? There is many different posts with many different code snippets. It would be better if each of you started your own topic and put your code and questions into your own topic.

mrbean17

My question was in response to the initial code posted on the first page of this thread. Basically just trying to figure out if a guest is visiting the site (currently no guests can read anything) that I'd like to display a message stating that you need to register ...

Thanks!

IchBin


if ($context['user']['is_guest'])
echo ' message to guest here in between these two single quotes';
else {
put all the code for recent topics here between the two curley braces.
}

mrbean17


lyer

Quote from: b33znutz on July 08, 2008, 04:48:36 AM
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>';



sir can i ask for  this code so icould put it in my forum?

by the way i using SMF 1.1.5 and TP v0.9.8

thanks....



IchBin

Isn't the code in your quote you just posted from him?