Just put this inside new php block, and use no matter the server and theme:
// Compact recent topics view
// Based on TinyPortal default block by BLOC
// Author: Greybrow
// Version: 2007-02-05 14:30
// Features:
// compact, uses smf icons for read/unread post,
// shows long topic, author, posting date on hover
// number of displayed topics
$last_topics_count='20';
// leave out the recycle board, if any
if(isset($modSettings['recycle_board']))
$bb=array($modSettings['recycle_board']);
else
$bb=array();
// get topics from SSI
$what=ssi_recentTopics($num_recent = $last_topics_count, $bb, $output_method = 'array');
// Output the topics
echo '<div style="width: 100%; overflow: hidden;">';
foreach($what as $w)
{
echo '<div style="white-space: nowrap;" class="smalltext">';
echo $w['new'] ? '<img src="' . $settings['images_url'] . '/new_none.gif" alt="+" border="0" style="vertical-align: middle;" />' : '<img src="' . $settings['images_url'] . '/new_some.gif" alt="-" border="0" style="vertical-align: middle;" />';
echo '<a href="'.$w['href'].'" title="'.$w['subject'];
echo "\n";
echo $w['poster']['name'];
echo "\n";
echo $w['time'];
echo '">';
echo strlen(un_htmlspecialchars($w['short_subject'])) > 25 ? htmlspecialchars(substr(un_htmlspecialchars($w['short_subject']), 0, 22) . '...') : $w['short_subject'];
echo '</a></div>';
}
echo '</div>';
edit: 2006-01-30, removed unused variable, which was showing up as error in reports.
edit: 2006-02-05 4am, if the block makes strange gaps between columns ...cut
edit: 2006-02-05 2pm, I've changed the code, so you don't have to play with it by yourself, and I've fixed new-post icon vertical position
If you wish to use ie not friendly code:
change line:
echo strlen(un_htmlspecialchars($w['short_subject'])) > 25 ? htmlspecialchars(substr(un_htmlspecialchars($w['short_subject']), 0, 22) . '...') : $w['short_subject'];
to:
echo $w['short_subject'];
Would be great if you could share a demo link or a screenshot for those that might want to try it. Thanks for sharing!
Screenshots added.
Sorry, but in Polish only :)
Very cool! Thanks!
A bit of update. Some errors fixed.
Neat, thank you very much.
very cool.. thanks for this ;)
Great Mod, I like the design but it creates quite a large gap between my right side blocks column and my center blocks.
I suppose you use IE. There is some strange problem with this browser not supporting "overflow: hidden;" in styles.
Try this. Instead of:
echo '">'.$w['short_subject'].'</a></div>';
put
echo strlen(un_htmlspecialchars($w['short_subject'])) > 25 ? htmlspecialchars(substr(un_htmlspecialchars($w['short_subject']), 0, 22) . '...') : $w['short_subject'];
It will trim longer subjects to 25 letters.
i had same problem and try to use your fix for it but that makes the block go totaly nuts pushing the other blocks off the screen :o
any other way to fix the problem with IE7 ?
Quote from: knat on February 03, 2007, 10:34:14 AM
i had same problem and try to use your fix for it but that makes the block go totaly nuts pushing the other blocks off the screen :o
any other way to fix the problem with IE7 ?
Yup Me to.
Cheers
I'm sorry, I didn't check this one :(
I forgot to add two lines of the code:
echo '">';
echo strlen(un_htmlspecialchars($w['short_subject'])) > 25 ? htmlspecialchars(substr(un_htmlspecialchars($w['short_subject']), 0, 22) . '...') : $w['short_subject'];
echo '</a></div>';
It should work now.
Since there is no demo....
Is this like the one that you can use with TP in the recent posts? ???
Brianjw
Thanks, its working fine with the new code ;)
Working fine Greybrow, thank you.
A bit of update again and screenshot added :)
Glad to hear, you like it :)
Oh, do i need to replace code again then?
If you like the vertical positon of the images, then no :)
Okidoki :) Thx again.
thanx, it worked in my site
I like this very much,
but all the chinese words from my forum are not able display correctly.
how do it fix the utf-8 problem?
thanks
QuoteI like this very much,
but all the chinese words from my forum are not able display correctly.
how do it fix the utf-8 problem?
thanks
That is something you need to get help from Simplemachines.org
Forums posts and recent topics and the language settings for the same is their department of support :)
if i use the build-in recent topic from tiny portal
it works fine...
just the compact recent topics couldnt work properly... :'(
any ideas? ???