• Welcome to Simple Machines Community Forum. Please login or sign up.
October 23, 2021, 04:18:46 PM

News:

Join the Facebook Fan Page.


SSI recentpost per board

Started by Angelotus, August 06, 2008, 01:34:15 PM

Previous topic - Next topic

Angelotus

Hi, how do I show recent posts just from one board in 2.0? I see there is an include function but I don't know how to use this?

H

function ssi_recentPosts($num_recent = 8, $exclude_boards = null, $include_boards = null, $output_method = 'echo')

I think you can just leave $exclude_boards blank so if the board ID was 1 you should be able to do:

ssi_recentPosts(,,1);
-H
Former Support Team Lead
                              I recommend:
Namecheap (domains)
Fastmail (e-mail)
Linode (VPS)
                             

Angelotus

Well, tried that already but didn't worked. Actually the whole page doesn't load then.

mike_sw


Angelotus


mike_sw

OK, you need to find out the id of your board. In the example the id was assumed to be 1 (the 3rd parameter).

Angelotus

Yes I have already, board nr 34. There are 2 post in there at the moment and they are not showing up.

H

Anything in any error logs? (SMF or web-server)

Does it work on any other boards? (Perhaps it only checks recent posts since a certain time? I haven't looked too closely at the function)
-H
Former Support Team Lead
                              I recommend:
Namecheap (domains)
Fastmail (e-mail)
Linode (VPS)
                             

Angelotus

No errors. The function does work for all, only not if I select one board as given in the example above.

mike_sw

I've just tried this function and it displays my last 3 posts (on my local test forum).

My test on smf 2 beta 3.1

<?php
//include SSI 
require(  'forum/SSI.php');
ssi_recentPosts(8,null,1);
?>





Angelotus

^^ my settings are correct, have included SSI correct as everything else included works fine. It's just this function that isn't working for me.

Can it be that it has to do something with the fact that the board is only visable for 1 group? Although I am a part of that particular group I still don't see a thing.

mike_sw

I think you should try first to make the board accesible to anyone and see if that works. It might be a permission problem.

Angelotus

Well. I have tried that as well and unfortunatelly no succes either... :(

Maybe someone is willing to take a look at my SSI included here? Thanks in advance!!!

mike_sw

Yeap, it's a different SSI.php . It looks like smf beta 3.0 . However it's strange that is almost double in size than mine.

Angelotus

That could be, because I have much modifications and addons made in it.
I have checked my version against your version of recentpost function. Except for the output (have made a little tweak in the table) the codings are the same. Have tested it already and still no luck.
I am getting really confused about this...

Dragooon

OK Time to do some debugging.
Try adding this to your page
global $context;
echo $context['user']['is_logged'] ? $context['user']['name'] : 'Guest';

Anywhere after SSI is called, what does it says there?

Angelotus

When logged in it gives my name, when logged out is says ´Guest´

Dragooon


Angelotus

Here is my SSI and my custom page Club.php

Dragooon


Advertisement: