Re: Latest Discussion – More Control
For 3, from the Genealogías theme:
function gs_topic_forum_link() {
global $topic;
if ($topic) {
echo '<a href="' . get_forum_link($topic->forum_id) . '">' . get_forum_name($topic->forum_id) . '</a>';
}
}
For the private forums, i do the following (considering only one private forum, having id 22):
add_filter('get_posts_where', 'ryuuko_staff_where_posts');
function ryuuko_staff_where_posts($where) {
if (!bb_is_user_logged_in() || !bb_current_user_can('moderate')) {
$where .= " AND p.forum_id <> '22' ";
}
return $where;
}
add_filter('get_topics_where', 'ryuuko_staff_where_topics');
function ryuuko_staff_where_topics($where) {
if (!bb_is_user_logged_in() || !bb_current_user_can('moderate')) {
$where .= " AND t.forum_id <> '22' ";
}
return $where;
}
add_filter('get_forums', 'ryuuko_staff_forums');
function ryuuko_staff_forums($forums) {
if (!bb_is_user_logged_in() || !bb_current_user_can('moderate')) {
$forum_key = -1;
foreach ($forums as $key => $forum)
if (intval($forum->forum_id) == 22) {
$forum_key = $key;
break;
}
unset($forums[$key]);
}
return $forums;
}
add_action('bb_forum.php_pre_db', 'ryuuko_forum_redirect');
function ryuuko_forum_redirect($forum_id) {
if (!bb_is_user_logged_in() || !bb_current_user_can('moderate')) {
if ($forum_id == 22)
bb_die("You can't see this!");
}
}