TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,966
  • Latest: safir45
Stats
  • Total Posts: 195,982
  • Total Topics: 21,320
  • Online today: 844
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 1
  • Guests: 439
  • Total: 440
  • @rjen

removing the time from "Recent Topics" block

Started by iowamf, November 04, 2005, 01:43:17 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

iowamf

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:


iowamf

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.


bloc

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...

This website is proudly hosted on Crocweb Cloud Website Hosting.