Customizing SMF > SMF Coding Discussion

Show stuff only in topics what are public

(1/5) > >>

Owdy:
What is code for this? I added Addthis code to Display.template, but i wanna show it only in topics what atre in publick boards.

Joker™:
Saw it in some file earlier


--- Code: ---$user_info['query_wanna_see_board']
--- End code ---

Arantor:
Nope.

That criteria gives you the list of boards that the user can see, modified by their ignore list, and it's in the form of a partial SQL snippet - which for administrators defaults to '1=1'.

What you need to do is look at the board's access criteria (the list of groups of who it's visible to) and see if -1 is in that list.

Joker™:
Maybe I'm going in wrong direction, but I saw it in Search.php


--- Code: --- // Find all the boards this user is allowed to see.
$request = $smcFunc['db_query']('order_by_board_order', '
SELECT b.id_cat, c.name AS cat_name, b.id_board, b.name, b.child_level
FROM {db_prefix}boards AS b
LEFT JOIN {db_prefix}categories AS c ON (c.id_cat = b.id_cat)
WHERE {query_see_board}
AND redirect = {string:empty_string}',
array(
'empty_string' => '',
)
);
$context['num_boards'] = $smcFunc['db_num_rows']($request);
$context['boards_check_all'] = true;
$context['categories'] = array();
--- End code ---

Owdy:

--- Quote from: Joker™ on February 06, 2011, 02:49:29 PM ---Maybe I'm going in wrong direction,

--- End quote ---
Seems you are, but thanks for trying to help :-\

I wanna show "Addthis" icons only in topics what are in publick boards.

Navigation

[0] Message Index

[#] Next page

Go to full version