TinyPortal

Development => Support => Topic started by: NoFeaR on November 24, 2010, 10:34:28 AM

Title: Recent Topics
Post by: NoFeaR on November 24, 2010, 10:34:28 AM
Link to my site: http://www.bosveldboerbokklub.com
SMF version: 2RC3
TP version: 1.0 RC1
Default Forum Language: ENG
Theme name and version: ZAP Theme
Browser Name and Version: Firefox 3.6.12
Mods installed: Mods listed here
Related Error messages: N/A

I have a question, under my left block i want to add a link that will be something like "view all"
and a link to a page with all the latest topics in order from newest to latest.

Possible??
Title: Re: Recent Topics
Post by: IchBin on November 24, 2010, 11:13:50 PM
All you have to do is put in a link that points to index.php?action=recent.
Title: Re: Recent Topics
Post by: NoFeaR on November 25, 2010, 10:19:51 AM
Nice. Now how do i edit the TP recent code to add this link??

Sorry for so many Q's.
Title: Re: Recent Topics
Post by: Lesmond on November 25, 2010, 03:18:14 PM
You could add this code to a HTML & Javascript code block.

<p align="center"><b><a href="index.php?action=recent"><font size="4">Recent
Post</font></a></b></p>
Title: Re: Recent Topics
Post by: IchBin on November 25, 2010, 07:03:22 PM
Open the Themes/default/TPsubs.template.php file. Search for the "function TPortal_recentbox()" function. You can see where to add that link in the code there.
Title: Re: Recent Topics
Post by: NoFeaR on November 26, 2010, 05:17:50 AM
I dont see it. I am nOOb :(

Quote{
   global $scripturl, $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();

   if($context['TPortal']['useavatar']==0)
   {
   $what = ssi_recentTopics($context['TPortal']['recentboxnum'], $bb, 'array');
Title: Re: Recent Topics
Post by: ZarPrime on November 26, 2010, 01:24:26 PM
That's the right spot though the function itself starts on line 68 and the echo statements are on farther down ...


// TPortal recent topics block
function TPortal_recentbox()
{
global $scripturl, $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();

if($context['TPortal']['useavatar']==0)
{
$what = ssi_recentTopics($context['TPortal']['recentboxnum'], $bb, 'array');

// Output the topics
echo '
<ul class="middletext" style="line-height: 1.5em; ' , isset($context['TPortal']['recentboxscroll']) && $context['TPortal']['recentboxscroll']==1 ? 'overflow: auto; height: 20ex;' : '' , 'margin: 0; padding: 0;">';
foreach($what as $wi => $w){
echo '
<li style="margin: 0; list-style: none; line-height: 1.5em; padding: 4px 0;"><a href="'.$w['href'].'">'.$w['short_subject'].'</a> ', $txt['by'], ' ', $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>';
}
else
{
$what = tp_recentTopics($context['TPortal']['recentboxnum'], $bb, 'array');

// Output the topics
echo '
<ul class="recent_topics" style="' , isset($context['TPortal']['recentboxscroll']) && $context['TPortal']['recentboxscroll']==1 ? 'overflow: auto; height: 20ex;' : '' , 'margin: 0; padding: 0;">';
foreach($what as $wi => $w){
echo '
<li>
<span class="tpavatar"><a href="' . $scripturl. '?action=profile;u=' . $w['poster']['id'] . '">' , empty($w['poster']['avatar']) ? '<img src="' . $settings['tp_images_url'] . '/TPguest.png" alt="" />' : $w['poster']['avatar'] , '</a></span><a href="'.$w['href'].'">' . $w['short_subject'].'</a><br />
', $txt['by'], ' <b>', $w['poster']['link'],'</b><br />';
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>';
}
}


ZarPrime