News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Simple list of boards, php code?

Started by MarkoKg, September 10, 2020, 05:45:48 AM

Previous topic - Next topic

MarkoKg

Hey guys,

I'm using smf 2.0.17 and I'd like to be able to show really simple list of all boards that I have on forum, separated by comma, and linked with appropriate link.

So for example i'd like to show something like:
Category 1: Board 1, Board 2, Board 3, Board 4
Cateogory 2: Board 1, Board 2, Board 3, Board 4
Category 3: Board 1, Board 2, Board 3, Board 4

Is there a php code I can use in order to get those, so I can use it in portal block on somewhere on the forum?

MarkoKg

So I found this:
https://support.simplemachines.org/function_db/index.php?action=view_function;id=13

Can I use that, and if so, how?
I tried to use just getBoardTree (); but it shows me nothing. Also, not sure if I should firstly require SSI or some other file in order to use this function? Or I'm looking at the wrong place?

Shambles

That function will populate a few variables which you can use to fulfil your request, but you need to pull in the defining source script first.

Try a few things in your portal block, like:


global $cat_tree, $boards, $boardList;

include('Subs-Boards.php');

getBoardTree();

// have a look inside the variables

echo '<pre>';
print_r($cat_tree);

Advertisement: