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,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,917
  • Total Topics: 21,308
  • Online today: 884
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 435
  • Total: 435

Recent Topics Block

Started by prometheus fire, December 29, 2009, 04:10:51 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

prometheus fire

How do I edit this section of code?

This is for the standard recent Topics block that comes with TP. I want it to only display the topic names instead of all the other stuff like the username and posting time.

What do I remove to make that change?

// 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 board, if any
if(isset($modSettings['recycle_board']))
$bb=array($modSettings['recycle_board']);
else
$bb=array();

$ex_aeva = empty($modSettings['aeva_enable']) ? 0 : 1;
$modSettings['aeva_enable'] = 0;
$what = ssi_recentTopics($context['TPortal']['recentboxnum'], $bb, 'array');
$modSettings['aeva_enable'] = $ex_aeva;

// 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>';

}

Mick

Not tested as i cannot redeclare this code in TP unless i modify my TP.

Anyways, i took out the member's name, "New" .gif image and post time.


Try 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 board, if any
   if(isset($modSettings['recycle_board']))
      $bb=array($modSettings['recycle_board']);
   else
      $bb=array();

   $ex_aeva = empty($modSettings['aeva_enable']) ? 0 : 1;
   $modSettings['aeva_enable'] = 0;
   $what = ssi_recentTopics($context['TPortal']['recentboxnum'], $bb, 'array');
   $modSettings['aeva_enable'] = $ex_aeva;

   // 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></li>';
   }
   echo '
   </ul>';

}

This website is proudly hosted on Crocweb Cloud Website Hosting.