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: 488
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 83
  • Total: 83

Re: "recent topics" in SMF style [Include Boards]

Started by insanemustang, January 07, 2009, 08:38:55 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

insanemustang

I cannot get this

ssi_recentTopics('8', array('3','56') , 'array') to specifically use a board for nothing!

I have tried everything, and it continually lists recent topics from all boards.

IchBin

Any time you put quotes around a number PHP treats it like a string. You should try this instead.
ssi_recentTopics(8, array(3,56) , 'array')

insanemustang

ok, so now I have this



     $what=ssi_recentTopics(8, array(4) , 'array');


And it still doesn't work properly.  I know that just a 4 is not a number array, but I don't know how else to add it.  I just want board 4 displayed.


IchBin

ssi_recentTopics does not work that. It only allows you to "exclude" the boards you don't want topics from. There are some codes in this board that do what you want if you search through them though.

insanemustang

So the array number is boards I want to exclude, so in the example above I am excluding board 4?

ZarPrime

Insanemustang,

Not sure what you're trying to do exactly, but if you want to "include" boards instead of excluding them you might want to take a look at this topic starting with this message ---> http://www.tinyportal.net/index.php/topic,25497.msg204282.html#msg204282

If that does what you want to do, let Ichbin know here.

ZarPrime

insanemustang

in the original post it says

Quote- add board ID number like to the function if youw ant to narrow down the boards recent topics are taken from. change it to ssi_recentTopics('8', array('3','56') , 'array') where the numbers 3 and 56 are examples of board ID's.

i assume block actually meant, where recent topics are NOT taken from?


Zar, I guess that code may do what I need since it says, "include boards"?

ZarPrime

I guess that could sound a little confusing.  Maybe instead of "narrow down" it should say "exclude".

Anyway, try that other topic and see if that might do what you're looking for.

ZP

insanemustang

I tried it and it doesn't help me much.  I don't understand why I just can't include X boards into the script I am running in this block?

global $scripturl;

     $what=ssi_recentTopics(8, array(1,5) , 'array');

        foreach ($what as $topic)
        {
echo '<br><span class="smalltext">', $topic['link'], '</span>';



                // Is this topic new? (assuming they are logged in!)
                if (!$topic['new'] && $context['user']['is_logged'])
                        echo '
                                                <a href="', $scripturl, '?topic=', $topic['topic'], '.msg', $topic['new_from'], '#new"><img src="', $settings['images_url'], '/', $context['user']['language'], '/new.gif" alt="', $txt[302], '" border="0" /></a>';


}                                       


I want to include board X, instead of excluding Y & Z...

IchBin

Because smf didn't write their  ssi_recentTopics to work like that. The link that Zarprime posted for you does exactly what you're asking for though.

This website is proudly hosted on Crocweb Cloud Website Hosting.