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

Recent

Welcome to TinyPortal. Please login or sign up.

May 18, 2024, 01:20:40 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: 45
  • Total: 45

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

lyer

Quote from: IchBinâ,,¢ on August 04, 2008, 06:00:56 PM
Isn't the code in your quote you just posted from him?

what i mean is perfect code for my babylon theme

thanks

alhaudhie

#431
Can we put msg preview on mouseover in this code using js...?

Dragooon

Try this
global $scriptur, $modSettingsl;

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">
                                                <span title="',shorten_subject($topic['preview'], $modSettings['hoverLength']),'">', $topic['link'],'</span>';

                // 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>';

alhaudhie

Thanks.. very nice...

But how can we sett up to make show fastly...

other is i look in joomla, they have a msg preview with the title in the top and custom css.
Can we make like that?

alhaudhie

can we make with with ajax than can refresh new topic automatically?

IchBin

While you are at it Dragooon, can you make this serve up some Grilled Chicken Salad with some Ranch sause? I"m really hungry right now, and the salad sounds good about now.

Dragooon

Quote from: IchBinâ,,¢ on August 08, 2008, 12:35:08 AM
While you are at it Dragooon, can you make this serve up some Grilled Chicken Salad with some Ranch sause? I"m really hungry right now, and the salad sounds good about now.
Yeah sure, want some drinks too?

@alhaudie, The things you're asking will be requiring far more complexion in javascript than I know off. And IMHO, they are unneeded. There is no need for ajax to be there. It'll just end up increasing your server load.

hdhoran

I have a question......I decided to use this code:

Quote
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('15', 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>';

For my recent topics...but I was wondering if it were possible to keep the person who started the topic in the box instead of the last poster? We have a forum full of women who don't always get along, and them being able to avoid topics, boards and posters is a good thing sometimes.

And I swear, if you can show me...I'll be happy to provide the chicken salad with homemade ranch and drinks too.  :2funny:

dhighet


IchBin

The person who made the mod would most likely be the one to answer that.