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

Recent

Welcome to TinyPortal. Please login or sign up.

May 14, 2024, 11:19:53 PM

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: 176
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 100
  • Total: 100

"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


ontap

#51
when i use this recent topics block for the frontpage, error logs fills up with this error.


8: Undefined index: newtime
File: \Themes\default\TPortal.template.php (eval?)
Line: 19

evillair

You need to change $topic['newtime'] to $topic['time'] in the following section of the code.
See the red text...

// 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['time'], '#new"><img src="', $settings['images_url'], '/', $context['user']['language'], '/new.gif" alt="', $txt[302], '" border="0" /></a>';


ontap

Quote from: evillair on March 02, 2006, 05:42:00 PM
You need to change $topic['newtime'] to $topic['time'] in the following section of the code.

Thanks.... here is the new code!

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('10', 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['time'], '#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>';

astpaul

Hi
Thanks a lot for this script.
I wanted to change it a little and put an exerpt of the message content. What is the correct parameter for $topic['???'] to get it ?
Couldn't get hold of the info.

Thanks a lot

RoarinRow


SMF 2.0 RC3
TP 1.0 beta 5-1
Wordpress 3.0

Blue Steel

#56
how about this little alteration..

Please look at the code and tell mer if I've got anything wrong.. its my first attempt at doing this.. it can be seen in action at http://ourmega.net/index.php
global $scripturl;

echo '<table border="0" width="100%" cellspacing="1" cellpadding="4" class="bordercolor">';

$what=ssi_recentTopics('10', NULL, 'array');

foreach ($what as $topic)
  {
echo '<tr class="catbg3">
<td valign="middle">Subject</td>
<td valign="middle">Board</td>
<td valign="middle">Poster</td>
<td valign="middle">Time</td>
</tr>';

    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['time'], '#new"><img src="', $settings['images_url'], '/', $context['user']['language'], '/new.gif" alt="', $txt[302], '" border="0" /></a>';

  echo '</td><td class="windowbg2" valign="middle" >', $topic['board']['link'], '</td>';

    echo '</td><td class="windowbg2" valign="middle" >', $topic['poster']['link'], '</td><td class="windowbg2" valign="middle" >';

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

RoarinRow

I got this from your link -  The page cannot be displayed.

SMF 2.0 RC3
TP 1.0 beta 5-1
Wordpress 3.0

Blue Steel


RoarinRow

#59
Quote from: BlueSteel on March 28, 2006, 04:02:03 AM
arghh.. why not.. try it  www.ourmega.net


I see it and like it on your site, but the code didn't work on my test site.

SMF 2.0 RC3
TP 1.0 beta 5-1
Wordpress 3.0