TinyPortal

Development => Support => Topic started by: Moif on June 17, 2008, 10:34:05 AM

Title: Recent Topics Block missing some things
Post by: Moif on June 17, 2008, 10:34:05 AM
Hi,

I'm in the process of upgrading my SMF and TP forums to the latest stable and beta versions respectively. However, I've noticed that my Recent Topics block on the front page doesn't have the poster name or time:

http://labs.brap.fm/index.php

How do I get that back so it's the same as my live site:

http://forums.brap.fm/index.php

Thanks
Title: Re: Recent Topics Block missing some things
Post by: Zetan on June 17, 2008, 10:55:23 AM
Looks like it does to me.. Although the horizontal rule has been omitted and the font size is a little different.
Title: Re: Recent Topics Block missing some things
Post by: Moif on June 17, 2008, 11:03:04 AM
You're right, the text is there but from what I can see, on my live site, the fonts are all of a different style. Poster name is in bold, date is in square brackets with the today in bold and it's all nicely formatted.

On the labs site, it's all the same font, size and formatting and yep, no horizontal rule.

Is this a stylesheet issue?
Title: Re: Recent Topics Block missing some things
Post by: Zetan on June 17, 2008, 11:14:44 AM
Nope.. it's the tportal.blocks.php file (I think.. at work and can't check). I'm not sure why it was changed, but I prefered it the way it was.

try having a search, somebody may have posted a fix for it.
Title: Re: Recent Topics Block missing some things
Post by: Moif on June 17, 2008, 11:35:04 AM
Ah cool. I'll check the old php and make some comparisons.

Thanks
Title: Re: Recent Topics Block missing some things
Post by: Moif on June 17, 2008, 11:48:45 AM
Fixed.

in TBlocks.template.php

Find (around line 171)


// Output the topics
echo '
<ul class="tp_recentblock" style="' , $context['TPortal']['recentboxscroll']==1 ? 'overflow: auto; height: 20ex;' : '' , '">';
foreach($what as $w){
echo '
<li style="overflow: auto;"><a href="'.$w['href'].'">'.$w['short_subject'].'</a> ', $txt[525], ' ', $w['poster']['link'];
if(!$w['new'])
echo ' <a href="'.$w['href'].'"><img src="'. $settings['images_url'].'/'.$context['user']['language'].'/new.gif" alt="new" /></a> ';

echo ' ['.$w['time'].']
</li>';
}
echo '
</ul>';
}


Replace with:


// Output the topics
$counter=1; $cmax=count($what);
echo '
<div style="width: 100%; ' , $context['TPortal']['recentboxscroll']==1 ? 'overflow: auto; height: 20ex;' : '' , '">';
foreach($what as $w){
echo '
<div class="smalltext"><a href="'.$w['href'].'">'.$w['short_subject'].'</a></div>
<div class="smalltext">', $txt[525], ' <b>', $w['poster']['link'], '</b></div>
<div class="smalltext">';
if(!$w['new'])
echo '<a href="'.$w['href'].'"><img border="0" src="'.$settings['images_url'].'/'.$context['user']['language'].'/new.gif" alt="new" /></a> ';

echo '['.$w['time'].']
</div>';

if($counter != $cmax)
echo '<hr />';
$counter++;
}
echo '
</div>';
}
Title: Re: Recent Topics Block missing some things
Post by: Zetan on June 17, 2008, 11:50:51 AM
Good stuff, pleased you worked it out.  :up:

Marked solved