Skip to:
Content
Pages
Categories
Search
Top
Bottom

Hide replies frm non logged users?

  • Hello,

    I’m using the standalone bbpress 1.1. I want to make a little modification to hide the thread replies from the non-logged users. So, the non-logged users can see only the very first post but can not see the replies to the topic. How can I do that?

    I tried to remove following from the topic.php file in the theme, but it removes the first post as well. I’ll appreciate any help.

    Code:
    <?php foreach ($posts as $bb_post) : $del_class = post_del_class(); ?>
    <li id=”post-<?php post_id(); ?>”<?php alt_class(‘post’, $del_class); ?>>
    <?php bb_post_template(); ?>

    <?php endforeach; ?>

Viewing 2 replies - 1 through 2 (of 2 total)
  • Any help?


    Lynq
    Participant

    @lynq

    You will probably need to add a counter to check if it is the first reply, something like this:

    <?php i == 0; ?>

    <?php foreach ($posts as $bb_post) : $del_class = post_del_class(); ?>

    <?php if(i == 0) { ?>
    <li id="post-<?php post_id(); ?>"<?php alt_class('post'); ?>>
    <?php } else { ?>
    <li id="post-<?php post_id(); ?>"<?php alt_class('post', $del_class); ?>>
    <?php bb_post_template(); ?>
    <?php } ?>
    <?php i++; ?>

    <?php endforeach; ?>

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.