Hi, how can I put the latest Forumposts into a centerblock ? So I can put it above the articles on the main site.
Thx.
WarBirD
try this in a php block
// "Recent Topics" a php Block
// Prefered settings when being designed
// Border and title on
// Title ="Recent Topics"
global $scripturl;
$what=ssi_recentTopics('10', NULL, 'array');
echo '<table border="0" width="100%" cellspacing="1" cellpadding="4" class="bordercolor">';
echo '<tr class="catbg3"><td valign="middle" align="center">Subject</td><td valign="middle" align="center">Board</td><td valign="middle" align="center">Poster</td><td valign="middle" align="center">Time</td></tr>';
foreach ($what as $topic)
{
echo '<tr><td class="windowbg" valign="middle" align="center">', $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" align="center">', $topic['board']['link'], '</td>';
echo '</td><td class="windowbg2" valign="middle" align="center">', $topic['poster']['link'], '</td><td class="windowbg2" valign="middle" align="center">';
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>';
Thx m8. ;)
your welcome :)
But, the text in the block is aligned centered. can this be changed, that its aligned left like the usual of a forum ? Looks stupid centered. ;)
Any ideas how to change that ?
Try this one
// "Recent Topics" a php Block
// Prefered settings when being designed
// Border and title on
// Title ="Recent Topics"
global $scripturl;
$what=ssi_recentTopics('10', NULL, 'array');
echo '<table border="0" width="100%" cellspacing="1" cellpadding="4" class="bordercolor">';
echo '<tr class="catbg3"><td valign="middle" align="left">Subject</td><td valign="middle" align="left">Board</td><td valign="middle" align="left">Poster</td><td valign="middle" align="left">Time</td></tr>';
foreach ($what as $topic)
{
echo '<tr><td class="windowbg" valign="middle" align="left">', $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" align="left">', $topic['board']['link'], '</td>';
echo '</td><td class="windowbg2" valign="middle" align="left">', $topic['poster']['link'], '</td><td class="windowbg2" valign="middle" align="left">';
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>';
Was just going to post that RebelRose :)
Quote from: Lesmond on December 07, 2006, 07:57:29 PM
Was just going to post that RebelRose :)
Sorry didn't mean to get in your way :)
If mine is not correct then you give it a go ;)
its ok RebelRose, its the same thanks :)
Thx again. ;) Both of you.
Your most welcome, from both of us :laugh:
If you want the actual recent posts and not just the topics
Then just add this to a phpbox center block:
ssi_recentPosts();
Hi,
I want to show only forum topics created by admins/moderators and not by members in the front page, although the respective board allows regular members to post also.
Is there a way to use this center block script to do it? Or some other solution?
Could you Please read the Posting Guidelines (http://www.tinyportal.net/index.php?topic=581) and start your own topic. Thanks.