collapse

* Simple Portal Archived Forum

This is an Archive Forum.

The content in this forum may be out-of-date or have been superseded by newer information, and links in forum pages to other sites may not work.
This forum contains archives for future reference.

Visit our thread at Simple Machines Forum for current support.

SMF 2.1 users: EhPortal is a ported version of Simple Portal specifically designed for the SMF 2.1 branch.
Please visit web-develop.ca to download EhPortal and for its support.

* User Info

 
 
Welcome, Guest. Please login or register.

* Who's Online

  • Dot Guests: 521
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

* Shoutbox

Refresh History
  • Shoutbox is not for support!
  • {OCS}MasterSeal: Yup, Still adore SP
    April 21, 2019, 07:08:06 PM
  • {OCS}MasterSeal: STILL love SP :)
    November 24, 2018, 05:05:50 AM
  • ♦ Ninja ZX-10RR ♦: <3 aegersz
    September 13, 2018, 03:36:09 PM
  • aegersz: I STILL <3 LOVE SimplePortal
    September 13, 2018, 07:11:39 AM
  • aegersz: o LOVE you guys - Simple Portal rocks !
    May 09, 2018, 05:18:59 AM
  • Chen Zhen: our apologies for the site being down.. please read server issues topic
    March 22, 2018, 05:32:38 AM
  • {OCS}MasterSeal: LOL PLEASE forget I just posted that. I found the answer in my own dang post back in 2015. lol sorry!
    July 04, 2017, 10:47:55 PM
  • {OCS}MasterSeal: I know this SB isnt' for support, but I just have a general question. Who would I contact to find out where SP stores its block info? Is it DB driven or files? I searched the site but came up with nothing. probably my fault any insight is appreciated.
    July 04, 2017, 10:43:36 PM
  • ♦ Ninja ZX-10RR ♦: Excuse me but what does Simpleportal have to deal with that?
    February 05, 2017, 08:21:14 PM
  • WhiteEagle: of course IMHO that site appears to be dead :(
    February 04, 2017, 01:08:05 PM
  • WhiteEagle: If I can get that, then I'll use it for that site...
    February 04, 2017, 01:07:35 PM
  • WhiteEagle: decided to not use SMF for any projects, unless I can get a copy of the premium version of the fanfiction archive plugin
    February 04, 2017, 01:06:54 PM
  • expertdecisions: cloudflare
    January 28, 2017, 08:01:47 AM
  • aegersz: SM release 2.0.13 !
    January 12, 2017, 06:00:13 AM
  • raffo: Tks Emanuele, even if I didn't understand the fix :D
    November 07, 2016, 02:01:20 AM
  • emanuele: [link]
    November 01, 2016, 12:43:50 PM
  • emanuele: raffo: the English support board is a good place. ;)
    November 01, 2016, 12:43:38 PM
  • raffo: Where can I find the fix for the shoutbox?
    November 01, 2016, 05:06:09 AM
  • {OCS}MasterSeal: To the SP team, I make a point to come here and thank you as much as possible for your work.  so again, THANK YOU!
    October 28, 2016, 10:38:05 AM
  • emanuele: That's indeed funny, the limit is present only in the patch and not the full install.
    October 22, 2016, 06:14:58 PM

* Recent Posts

Adding Forums Button to Nav bar by jirapon
[August 01, 2019, 09:07:12 AM]


Re: Board Icons by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 04:03:41 PM]


MOVED: Czech translation???? by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 03:04:51 PM]


Board Icons by jirapon
[July 30, 2019, 07:28:44 AM]


Re: Thankyou Simpleportal, by ♦ Ninja ZX-10RR ♦
[July 29, 2019, 09:41:29 AM]

Thanks for having an interest with our portal. If you have any requests for features, have a look at the Feature Requests board.

Author Topic: Recent topic with popup  (Read 10112 times)

0 Members and 3 Guests are viewing this topic.

Offline rocknroller

  • Jr. Member
  • **
  • Posts: 51
  • Gender: Male
  • Simple portal is great
    • Mini Chat - Domaca Pricaonica
  • SMF Version: 2 RC5
  • SP Version: 2.3.3
Recent topic with popup
« on: June 25, 2011, 04:20:49 AM »
..::Recent Topic with avatar and popup preview::..
Verson 1.2


Code: [Select]
/**
 * Recent Topic with avatar and popup preview
 * Version 1.2
 * @author logooff.net
 */
 
//SETUP

$number_of_posts =10; // here you can change number of posts
$default_avatar = 'http://www.pohrani.com/f/45/mu/1bzggGqq/noavatar.png'; // enter URL of default avatar you want. Like this 'http://www.url.com/image.jpg'

//SETUP END
global $contex, $txt, $settings;
$array = ssi_recentTopics($number_of_posts, null, null, 'array');
echo '
<table class="side_class_row">';
foreach ($array as $post)
{
global $memberContext;
      loadMemberData($post['poster']['id']);
      loadMemberContext($post['poster']['id']);
echo '
  <tr>
<td class="side_class_replies">', $post['replies'], '</td>
            <td  class="side_class_new">';
                if (!empty($post['new']) )
                    echo'';
                else
                    echo'
                    <img src="' . $settings['lang_images_url'] . '/new.gif" class="new_posts" alt="new" />';
             echo'
            </td>
            <td></td>
    <td><div class="triangle-isosceles" id="a', $post['topic'], '" style="display: none">', $post['preview'], '</div>
                    <a href="'. $post['href']. '" target="_self" onmouseover="document.getElementById(\'a', $post['topic'], '\').style.display = \'block\'" onmouseout="document.getElementById(\'a', $post['topic'], '\').style.display = \'none\'">', $post['short_subject'], '</a>
             </td>
<td>';
            if (!empty($memberContext[$post['poster']['id']]['avatar']['href'])){
echo '<img src="' . $memberContext[$post['poster']['id']]['avatar']['href'] . '" width="30" height="30" alt="', $post['poster']['name'], '" />';
                    }           
            else {
echo '<img src="' . $default_avatar .'" alt="default_avatar" width="30" height="30" />';
                }
        echo'
            </td>
            <td></td>
    </tr>
        <tr>
            <td colspan="6"><p class="side_class_poster"><span class="floatleft">', $txt['replies'], '</span> ', $post['poster']['link'], ' </p><hr class="side_hr" /></td>
        </tr>';
}
echo '
    </table>
<style type="text/css">
.side_class_poster
{
     font-size:10px;
     margin: 0;
     padding: 0;
     text-align: right;
}
table.side_class_row hr
     margin: 0;
     padding: 0;
}
.side_class_row
{
     padding:4px;
     width: 100%;
}
td.side_class_replies
{
     text-align:center;
     width:3%;
}
td.side_class_new
{
     text-align:center;
     width:3%;
}
.triangle-isosceles {
    position: fixed;
    top: 300px;
    left: 400px;
    padding:15px;
    margin:1em 0 3em;
    color:#fff;
    max-width: 400px;
    border: 1px solid #222222;
    -moz-border-radius:10px;
    -webkit-border-radius:10px;
    border-radius:10px;
    -moz-box-shadow: 3px 3px 39px 2px #222222;
    -webkit-box-shadow: 3px 3px 39px 2px #222222;
    box-shadow: 3px 3px 39px 2px #222222;
    background: -moz-linear-gradient(top, rgba(41,137,216,0.9) 0%, rgba(30,87,153,0.9) 94%, rgba(30,87,153,0.9) 100%);
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(41,137,216,0.9)), color-stop(94%,rgba(30,87,153,0.9)), color-stop(100%,rgba(30,87,153,0.9)));
    background: -webkit-linear-gradient(top, rgba(41,137,216,0.9) 0%,rgba(30,87,153,0.9) 94%,rgba(30,87,153,0.9) 100%);
    background: -o-linear-gradient(top, rgba(41,137,216,0.9) 0%,rgba(30,87,153,0.9) 94%,rgba(30,87,153,0.9) 100%);
    background: -ms-linear-gradient(top, rgba(41,137,216,0.9) 0%,rgba(30,87,153,0.9) 94%,rgba(30,87,153,0.9) 100%);
    background: linear-gradient(top, rgba(41,137,216,0.9) 0%,rgba(30,87,153,0.9) 94%,rgba(30,87,153,0.9) 100%);
    }
</style>';
Enjoy!


29.08.2011
Version 1.2
  • Added Setupable avatar


16.07.2011
  • Added avatar (thanx to blue)
  • Fixed XHTML validation
  • Added setup for number of posts
« Last Edit: August 29, 2011, 12:03:41 PM by rocknroller »
Tražite li mjesto za opuštanje, zabavu, Besplatno Upoznavanje, brbljanje i pricanje tu je Mini Chat HR, Domaci sajt sadrži sobe za druženje tj. chat za mobitel, isto kao i za stolna racunala. I to bez prijave email adrese, najbolje pricaonice su MiniChatHR.com

Offline Blue

  • Customizer
  • *
  • Posts: 379
  • Gender: Male
  • Block Maker? =P
Re: Recent topic with popup
« Reply #1 on: July 03, 2011, 09:59:47 AM »
Here, try this:

Code: [Select]
<?php

$array 
ssi_recentTopics(10nullnull'array');
global 
$contex$txt$settings;
echo 
'
<table class="side_class_row">
        <thead>
            <tr>
                <td>'
$txt['replies'], '</td>
                <td></td>
                <td></td>
<td></td>
                <td></td>
            </tr>
        <thead>'
;
foreach (
$array as $post)
{

global $memberContext;
      
loadMemberData($post['poster']['id']);
      
loadMemberContext($post['poster']['id']);


echo 
'
        <tbody>
  <tr>
<td class="side_class_replies">'
$post['replies'], '</td>
            <td  class="side_class_new">'
;
                if (!empty(
$post['new']) )
                    echo
'';
                else
                    echo
'
                    <img src="' 
$settings['lang_images_url'] . '/new.gif" class="new_posts" alt="" />';
             echo
'
                </td>
                <td></td>
     <td>
                    <div class="triangle-isosceles" id="'
$post['topic'], '" style="display: none">'$post['preview'], '</div>
                    <a href="'
$post['href']. '" target="_self" onmouseover="document.getElementById(\''$post['topic'], '\').style.display = \'block\'" onmouseout="document.getElementById(\''$post['topic'], '\').style.display = \'none\'">'$post['short_subject'], '</a>
                </td>
<td><img src="' 
$memberContext[$post['poster']['id']]['avatar']['href'] . '" width="30px" height="30px" /></td>
                <td class="side_class_poster"><pre> '
$post['poster']['name'], ' </pre> </td>
     </tr>
            <tr>
                <td colspan="5"><hr></td>
            </tr>
        </tbody>'
;
}
echo 
'
    </table> 
<style> 
.side_class_poster pre
{
     font-size:10px;
}
.side_class_row
{
     padding:4px;
     width: 100%;
}
td.side_class_replies
{
     text-align:center;
     width:3%;
}
td.side_class_new
{
     text-align:center;
     width:3%;
}
.triangle-isosceles {
    position: fixed;
    top: 300px;
    left: 400px;
    padding:15px;
    margin:1em 0 3em;
    color:#fff;
    max-width: 400px;
    border: 1px solid #222222;
    -moz-border-radius:10px;
    -webkit-border-radius:10px;
    border-radius:10px;
    -moz-box-shadow: 3px 3px 39px 2px #222222;
    -webkit-box-shadow: 3px 3px 39px 2px #222222;
    box-shadow: 3px 3px 39px 2px #222222;
    background: -moz-linear-gradient(top, rgba(41,137,216,0.9) 0%, rgba(30,87,153,0.9) 94%, rgba(30,87,153,0.9) 100%);
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(41,137,216,0.9)), color-stop(94%,rgba(30,87,153,0.9)), color-stop(100%,rgba(30,87,153,0.9)));
    background: -webkit-linear-gradient(top, rgba(41,137,216,0.9) 0%,rgba(30,87,153,0.9) 94%,rgba(30,87,153,0.9) 100%);
    background: -o-linear-gradient(top, rgba(41,137,216,0.9) 0%,rgba(30,87,153,0.9) 94%,rgba(30,87,153,0.9) 100%);
    background: -ms-linear-gradient(top, rgba(41,137,216,0.9) 0%,rgba(30,87,153,0.9) 94%,rgba(30,87,153,0.9) 100%);
    background: linear-gradient(top, rgba(41,137,216,0.9) 0%,rgba(30,87,153,0.9) 94%,rgba(30,87,153,0.9) 100%);
    }
</style>'
;

?>
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Offline agent47

  • Jr. Member
  • **
  • Posts: 61
  • SMF Version: 2 RC5
  • SP Version: 2.3.3
Re: Recent topic with popup
« Reply #2 on: July 03, 2011, 11:19:48 AM »
Wow this looks so awesome.... I wish someone would implement this for this mod. It'll look so awesome.

Offline Blue

  • Customizer
  • *
  • Posts: 379
  • Gender: Male
  • Block Maker? =P
Re: Recent topic with popup
« Reply #3 on: July 03, 2011, 11:32:40 AM »
I have to re-do that block since that was my first block ever  ;P

Maybe, when I start I'll ask rocknroller if I can use his code.
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Offline rocknroller

  • Jr. Member
  • **
  • Posts: 51
  • Gender: Male
  • Simple portal is great
    • Mini Chat - Domaca Pricaonica
  • SMF Version: 2 RC5
  • SP Version: 2.3.3
Re: Recent topic with popup
« Reply #4 on: July 03, 2011, 11:44:25 AM »
I have to re-do that block since that was my first block ever  ;P

Maybe, when I start I'll ask rocknroller if I can use his code.

tnx friend for avatar, sure you can use it. I'm glad that someone like this code.  :D
Tražite li mjesto za opuštanje, zabavu, Besplatno Upoznavanje, brbljanje i pricanje tu je Mini Chat HR, Domaci sajt sadrži sobe za druženje tj. chat za mobitel, isto kao i za stolna racunala. I to bez prijave email adrese, najbolje pricaonice su MiniChatHR.com

Offline Blue

  • Customizer
  • *
  • Posts: 379
  • Gender: Male
  • Block Maker? =P
Re: Recent topic with popup
« Reply #5 on: July 03, 2011, 12:01:39 PM »
Glad I could help ;)
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Offline agent47

  • Jr. Member
  • **
  • Posts: 61
  • SMF Version: 2 RC5
  • SP Version: 2.3.3
Re: Recent topic with popup
« Reply #6 on: July 03, 2011, 12:07:23 PM »
You guys rule!

Offline S@ffz

  • Jr. Member
  • **
  • Posts: 51
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Re: Recent topic with popup
« Reply #7 on: August 11, 2011, 09:26:28 PM »
I have to re-do that block since that was my first block ever  ;P

Maybe, when I start I'll ask rocknroller if I can use his code.

Are you still going too Blue?
 is it possible to reduce the amount of topics displayed?
« Last Edit: August 11, 2011, 09:30:36 PM by saffz »

Offline rocknroller

  • Jr. Member
  • **
  • Posts: 51
  • Gender: Male
  • Simple portal is great
    • Mini Chat - Domaca Pricaonica
  • SMF Version: 2 RC5
  • SP Version: 2.3.3
Re: Recent topic with popup
« Reply #8 on: August 16, 2011, 05:18:41 PM »
I have to re-do that block since that was my first block ever  ;P

Maybe, when I start I'll ask rocknroller if I can use his code.

Are you still going too Blue?
is it possible to reduce the amount of topics displayed?

Edited first post.. :)
Tražite li mjesto za opuštanje, zabavu, Besplatno Upoznavanje, brbljanje i pricanje tu je Mini Chat HR, Domaci sajt sadrži sobe za druženje tj. chat za mobitel, isto kao i za stolna racunala. I to bez prijave email adrese, najbolje pricaonice su MiniChatHR.com

Offline S@ffz

  • Jr. Member
  • **
  • Posts: 51
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Re: Recent topic with popup
« Reply #9 on: August 28, 2011, 05:59:00 PM »
Thanks rocknroller

One more Question how can I tidy the contents displayed in the block as they are very space apart and almost looks
bare.   As you can see from the attached image 5 post are displayed and there is a scroll bar at the bottom.   :(
and I don't know how or where to tidy this block.  Any help would be much appreciated.

Offline rocknroller

  • Jr. Member
  • **
  • Posts: 51
  • Gender: Male
  • Simple portal is great
    • Mini Chat - Domaca Pricaonica
  • SMF Version: 2 RC5
  • SP Version: 2.3.3
Re: Recent topic with popup
« Reply #10 on: August 29, 2011, 11:24:31 AM »
Thanks rocknroller

One more Question how can I tidy the contents displayed in the block as they are very space apart and almost looks
bare.   As you can see from the attached image 5 post are displayed and there is a scroll bar at the bottom.   :(
and I don't know how or where to tidy this block.  Any help would be much appreciated.

i was changed code in first post today with newer version, first change the code and is still have problem send me link of your forum, so can check with firebug. :)
« Last Edit: August 29, 2011, 12:05:18 PM by rocknroller »
Tražite li mjesto za opuštanje, zabavu, Besplatno Upoznavanje, brbljanje i pricanje tu je Mini Chat HR, Domaci sajt sadrži sobe za druženje tj. chat za mobitel, isto kao i za stolna racunala. I to bez prijave email adrese, najbolje pricaonice su MiniChatHR.com

Offline S@ffz

  • Jr. Member
  • **
  • Posts: 51
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Re: Recent topic with popup
« Reply #11 on: October 19, 2011, 05:14:27 AM »
Great block guys

thanks  ;D
« Last Edit: October 19, 2011, 05:19:48 AM by saffz »

Offline FrizzleFried

  • Full Member
  • ***
  • Posts: 114
  • SMF Version: 2.0.5
  • SP Version: 2.3.5
Re: Recent topic with popup
« Reply #12 on: April 04, 2012, 02:41:50 AM »
Was wondering if there is a way to limit the forums this block looks for... I have a NSFW forum i want it to ignore.

Offline fapencio

  • Jr. Member
  • **
  • Posts: 61
  • Gender: Male
    • medilibros
  • SMF Version: 2.0.8
  • SP Version: 2.3.5
Re: Recent topic with popup
« Reply #13 on: April 04, 2014, 10:26:04 PM »
awesome! thanks  :thumbsup: :applause:
Theme: Default

Offline Schnuffeltier

  • Semi Newbie
  • *
  • Posts: 19
  • Gender: Female
  • SMF Version: 2.0.7
  • SP Version: 2.3.5
Re: Recent topic with popup
« Reply #14 on: April 06, 2014, 01:48:53 PM »
Wow! This is really fantastic! I like the popups very much!

Would it be possible to add the popups to this code?

Code: [Select]
global $context, $settings, $scripturl, $txt;
global $user_info, $modSettings, $smcFunc, $posts;
global $color_profile;

$exclude_boards = null;
$num_recent = !empty($parameters[0]) ? $parameters[0] :  (isset($_GET['limit']) ? (int) $_GET['limit'] : 20);

if ($exclude_boards === null && !empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0)
$exclude_boards = array($modSettings['recycle_board']);
else
$exclude_boards = empty($exclude_boards) ? array() : $exclude_boards;

$stable_icons = array('xx', 'thumbup', 'thumbdown', 'exclamation', 'question', 'lamp', 'smiley', 'angry', 'cheesy', 'grin', 'sad', 'wink', 'moved', 'recycled', 'wireless');
$icon_sources = array();
foreach ($stable_icons as $icon)
$icon_sources[$icon] = 'images_url';

// Find all the posts in distinct topics.  Newer ones will have higher IDs.
$request = $smcFunc['db_query']('','
SELECT
m.poster_time, ms.subject, m.id_topic, m.id_member, m.id_msg, b.id_board, t.num_replies, t.num_views, b.name AS bName,
IFNULL(mem.real_name, m.poster_name) AS poster_name, ' . ($user_info['is_guest'] ? '1 AS is_read, 0 AS new_from' : '
IFNULL(lt.id_msg, IFNULL(lmr.ID_MSG, 0)) >= m.id_msg_modified AS is_read,
IFNULL(lt.id_msg, IFNULL(lmr.ID_MSG, -1)) + 1 AS new_from') . ', LEFT(m.body, 384) AS body, m.smileys_enabled, mf.icon
FROM ({db_prefix}messages AS m, {db_prefix}topics AS t, {db_prefix}boards AS b, {db_prefix}messages AS ms)
INNER JOIN {db_prefix}messages AS mf ON (mf.id_msg = t.id_first_msg)
LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = m.id_member)' . (!$user_info['is_guest'] ? '
LEFT JOIN {db_prefix}log_topics AS lt ON (lt.id_topic = t.id_topic AND lt.id_member = {int:id_member})
LEFT JOIN {db_prefix}log_mark_read AS lmr ON (lmr.id_board = b.id_board AND lmr.id_member = {int:id_member})' : '') . '
WHERE t.ID_LAST_MSG >= ' . ($modSettings['maxMsgID'] - 35 * min($num_recent, 5)) . '
AND t.id_last_msg = m.id_msg
AND b.id_board = t.id_board' . (empty($exclude_boards) ? '' : '
AND b.id_board NOT IN ({array_int:exclude_boards})'). '
AND {raw:query_see_board}
AND ms.id_msg = t.id_last_msg
ORDER BY t.id_last_msg DESC
LIMIT {int:limit}',
array(
'id_member' => $user_info['id'],
'exclude_boards' => $exclude_boards,
'query_see_board' => $user_info['query_wanna_see_board'],
'limit' => (int) $num_recent,
)
);
$posts = array();
$colorids = array();
while ($row = $smcFunc['db_fetch_assoc']($request))
{
$row['body'] = strip_tags(strtr(parse_bbc($row['body'], $row['smileys_enabled'], $row['id_msg']), array('<br />' => '')));
if ($smcFunc['strlen']($row['body']) > 128)
$row['body'] = $smcFunc['substr']($row['body'], 0, 128) . '...';

// Censor the subject.
                  $row['subject'] = preg_replace('/^' . preg_quote($txt['response_prefix']) . '/', '', $row['subject']);
censorText($row['subject']);
censorText($row['body']);

//Collect the color ids :)
$colorids[$row['id_member']] = $row['id_member'];

if (empty($modSettings['messageIconChecks_disable']) && !isset($icon_sources[$row['icon']]))
$icon_sources[$row['icon']] = file_exists($settings['theme_dir'] . '/images/post/' . $row['icon'] . '.gif') ? 'images_url' : 'default_images_url';

// Build the array.
$posts[] = array(
'board' => array(
'id' => $row['id_board'],
'name' => $row['bName'],
'href' => $scripturl . '?board=' . $row['id_board'] . '.0',
'link' => '<a href="' . $scripturl . '?board=' . $row['id_board'] . '.0">' . $row['bName'] . '</a>'
),
'topic' => $row['id_topic'],
'poster' => array(
'id' => $row['id_member'],
'name' => $row['poster_name'],
'href' => empty($row['id_member']) ? '' : $scripturl . '?action=profile;u=' . $row['id_member'],
'link' => empty($row['id_member']) ? $row['poster_name'] : '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['poster_name'] . '</a>'
),
'subject' => $row['subject'],
'short_subject' => shorten_subject($row['subject'], 25),
'preview' => $row['body'],
'time' => timeformat($row['poster_time']),
'timestamp' => forum_time(true, $row['poster_time']),
'href' => $scripturl . '?topic=' . $row['id_topic'] . '.msg' . $row['id_msg'] . ';topicseen#new',
'link' => '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.msg' . $row['id_msg'] . '#new">' . $row['subject'] . '</a>',
'new' => !empty($row['is_read']),
'new_from' => $row['new_from'],
'icon' => '<img src="' . $settings[$icon_sources[$row['icon']]] . '/post/' . $row['icon'] . '.gif" align="middle" alt="' . $row['icon'] . '" border="0" />',
'views' => $row['num_views'],
'replies' => $row['num_replies'],
);
}
$smcFunc['db_free_result']($request);

// Load recent topic posts colors =)
if(!empty($colorids) && sp_loadColors($colorids) !== false)
foreach($posts as $k => $p)
if(!empty($color_profile[$p['poster']['id']]['link']))
$posts[$k]['poster']['link'] = $color_profile[$p['poster']['id']]['link'];

$context['recent_topics']=$posts;

// Just return it.
if (empty($posts))
return $posts;

echo '
<div class="tborder">
<table cellspacing="0" width="100%">
<tr class="catbg">

</tr>
<tr>
<td style="padding: 5px;">
</td> ';
foreach ($posts as $post)
echo '
<tr>
<td align="center" valign="middle" nowrap="nowrap">
', $post['icon'], '
</td>
<td valign="middle" width="%100">
<div style="font-size: 11px;"><b>
<a href="', $post['href'], '">', $post['subject'], '</a>
', $post['new'] ? '' : '<a href="' . $scripturl . '?topic=' . $post['topic'] . '.msg' . $post['new_from'] . ';topicseen#new"><img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/new.gif" alt="' . $txt['new'] . '" border="0" /></a>', '</b></div><div style="font-size: 9px;">von ', $post['poster']['link'], ' in ', $post['board']['link'], ' </br> ', $post['time'], '

| Klicks: ', $post['views'], ' | Antworten: ', $post['replies'], '</font><hr>
</td>
</tr>';
echo '
</table></div>';