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

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 196,004
  • Total Topics: 21,330
  • Online today: 141
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 109
  • Total: 109

Specific recent posts?

Started by MrApples, July 24, 2007, 02:42:26 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

MrApples

How could I instead of getting recent posts #1 through 20, get #5 through 25 instead?

Nikki Sixx

Are you referring to the recent posts from the TinyPortal block or the recent posts listed on the forum footer?

MrApples

This is tiny portal.net isn't it?

Yes for a block. I'm using this code at the moment...

{
    // is it a number?
    if(!is_numeric($context['TPortal']['recentboxnum']))
                     $context['TPortal']['recentboxnum']='9';

    // leave out the recycle board, 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
        $counter=1; $cmax=8;
    foreach($what as $w){
            echo '<div style="white-space: nowrap; overflow: hidden; padding: 0px 4px;" class="smalltext">
<span title="', $w['first_post']['preview'], '"><b><a href="'.$w['href'].'">'.$w['short_subject'].'</a></b></span>
<div class="smalltext"><i>' . $w['board']['name'] . " - " . $w['poster']['link'] . '</i></div>
                                    </div>
                                    <div style="white-space: nowrap; overflow: hidden; padding: 0px 4px; " 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 '<img src="'.$settings['images_url'].'/blank.gif" alt="" width="12" / >'.$w['time'].'</div><br />';

           if($counter != $cmax)
                   echo '<img src="'.$settings['images_url'].'/blank.gif" alt="" height="6" / >';
           $counter++;
    }
}


Changing counter, cmax, and numrecenttopics does not work.

Nikki Sixx

I asked a legitimate question. I don't appreciate the attitude, Mr. Apples.

MrApples

You see attitude in that post?

Nikki Sixx

#5
Quote from: Nikki Sixx on July 24, 2007, 03:48:55 AM
Are you referring to the recent posts from the TinyPortal block or the recent posts listed on the forum footer?
Quote from: MrApples on July 24, 2007, 03:52:10 AM
This is tiny portal.net isn't it?

Sorry if I misinterpreted that but initially it seemed rather feisty. ???


Edit- ONE HUNDREDTH POST!!!!!!!!!!!!!!!!!!!!!!!!!! :smiley6600:

IchBin

I'm assuming you haven't posted the full code on purpose? With that assumption it looks like you've also added the counter and max yourself?

Remember you also have to check for the max. I'm not sure what the best way to make it only output "after" the first 5 results.

MrApples

#7
I fixed it. I was trying to get paged recent topics, so I had to make one huge array, and for each page check if counter is more than start and less than end.

But yes thats the whole code, its a modded version of the block code snippet "Recent Topics (with some finessing)".

You can see it here; http://www.pollama.com, on the first block click on the Recent tab. I'd post the code but it makes use of the "Mini User CP" by Stormlrd

This website is proudly hosted on Crocweb Cloud Website Hosting.