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

Recent

Welcome to TinyPortal. Please login or sign up.

April 25, 2024, 10:37:03 PM

Login with username, password and session length
Members
  • Total Members: 3,885
  • Latest: Growner
Stats
  • Total Posts: 195,173
  • Total Topics: 21,219
  • Online today: 319
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 1
  • Guests: 180
  • Total: 181

"recent topics" in SMF style

Started by Lesmond, August 17, 2005, 12:01:38 PM

Previous topic - Next topic

0 Members and 3 Guests are viewing this topic.

Xarcell

#590
Quote from: IchBinâ„¢ on March 30, 2010, 09:57:03 PM
I see now. Looks like there is an extra <td> when you do that. Let me see if I can replicate the problem. Are you using the code that was last posted by Xarcell?

I see the extra TD too Ich.

Lol, is that TP? is that the one that bikken found awhile back?

I'm still trying to figure out where that background color is coming from though. It doesn't make sense. I'd swear that it's the frame background.

EDIT:
I'm looking at the code right now and it's using "windowbg", the same as the other blocks.

ricardo3523

Thought I'd just let you know, also if I only choose to not display the title, it starts doing a bit odd.

IchBin

Can you try this code to see if it does anything different?
global $scripturl, $settings, $txt, $context;

echo '
<div style="width: 50%; float: left;">';

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, array(2), '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="last post" title="last post" border="0" style="float: right;" /></a>
<span class="smalltext">
', $topic['time'], '
</span>
</td>
</tr>';
        }

        echo '
</table>
</div>
    <div style="float: right; width: 50%;">
<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, array(3), '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="last post" title="last post" border="0" style="float: right;" /></a>';
               
                echo '
<span class="smalltext">
', $topic['time'], '
</span>
</td>
</tr>';
        }

        echo '
</table>
</div>';

ricardo3523

#593
It seems to be working ;)

Well, thank you both I guess!!

Just one remaining question, how can I get the left side of the frame from this code on the same row as from the news that shows beneath it.

Tried some numbers in the code itself and on the admin panel, didn't managed to find anything yet.

IchBin

Do you still have another block enabled? It looks to me like that extra <td> causing your shift on the left is from an empty block or something. I can't reproduce the same affect on my site.

Xarcell

Quote from: IchBinâ„¢ on March 31, 2010, 07:53:58 PM
Do you still have another block enabled? It looks to me like that extra <td> causing your shift on the left is from an empty block or something. I can't reproduce the same affect on my site.

I think it's TP. It's an extra TD. Bloc has corrected this in beta 5.

IchBin

Doesn't happen on my TP beta 4 or beta 5.

ricardo3523

I don't have any other upper blocks enabled or front page blocks.

There is an option at those blocks saying padding between panels.. but this is on #4 at every block.. so that can't be it?

IchBin

Need to know your TP version. Would help if you'd leave the version in your footer. :) Would you mind letting me take a look? I can't reproduce the issue on my setup. I don't think the padding has anything to do with it.

ricardo3523

Well if you would be able to tell me where I can find my TP version I'd be glad to look it up for you :)
What do you mean exactly, letting you take a look?