TinyPortal
General => Chit chat => Topic started by: iowamf on November 04, 2005, 01:43:17 AM
Is there an easy way to strip the time out of the existing "Recent Topics" block?
Would it take a custom block?
Displaying the time is 50% of the content of the block - ouch!
I'd rather have the last 20 posts than the last 10 with the exact time.
Better yet, I'd rather have the last 10 posts in half the space :coolsmiley:
Try here
http://www.tinyportal.net/smf/index.php?topic=667.0
I think there is a misunderstanding as the previous post references stripping out the link tree (which I'd like to do everywhere but in the forums - but that is another topic for another time).
I'm wondering how to ditch the "time" of the posts in the "Recent Topics"? (see attached image)
The "new" icon is a keeper though.
To remove date, open TPortalBlocks.tempalte and find this:
// TPortal recent topics block
function TPortal_recentbox()
{
global $context, $settings, $options, $txt , $modSettings;
// is it a number?
if(!is_numeric($context['TPortal']['recentboxnum']))
$context['TPortal']['recentboxnum']='10';
// leave out the recycle baord, if any
if(isset($modSettings['recycle_board']))
$bb=array($modSettings['recycle_board']);
else
$bb=array();
$what=ssi_recentTopics($num_recent = $context['TPortal']['recentboxnum'], $bb, $output_method = 'array');
// Output the topics
foreach($what as $w){
echo '<span class="smalltext"><a href="'.$w['href'].'"> '.$w['time'];
if(!$w['new'])
echo ' <img border="0" src="'.$settings['images_url'].'/'.$context['user']['language'].'/new.gif" alt="new" />';
echo '<br />'.$w['short_subject'].'</a></span><hr style="background-color: #c0c0c0;margin: 0px; " />';
}
}
and rather do it like:
// TPortal recent topics block
function TPortal_recentbox()
{
global $context, $settings, $options, $txt , $modSettings;
// is it a number?
if(!is_numeric($context['TPortal']['recentboxnum']))
$context['TPortal']['recentboxnum']='10';
// leave out the recycle baord, if any
if(isset($modSettings['recycle_board']))
$bb=array($modSettings['recycle_board']);
else
$bb=array();
$what=ssi_recentTopics($num_recent = $context['TPortal']['recentboxnum'], $bb, $output_method = 'array');
// Output the topics
foreach($what as $w){
echo '<span class="smalltext"><a href="'.$w['href'].'">' . $w['short_subject'];
if(!$w['new'])
echo ' <img border="0" src="'.$settings['images_url'].'/'.$context['user']['language'].'/new.gif" alt="new" />';
echo '</a></span><hr style="background-color: #c0c0c0;margin: 0px; " />';
}
}
you can even take out the whole < hr > tag, which is the dividing line.Use a < br > instead.
Stripping out linktree..the easiest is to just remove everything between
function linktree();
{
...and
}
- leaving just a empty function. For even more control copy it first, and name it linktree2, then call link-tree2 exactly where you want it, and in just the templates you need it to be. I have done that in quite a few themes...