cart3r (@cart3r)

Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • In reply to: Totomer.com

    @cart3r

    Member

    The notions about the fold and some other things finally got through me. I just changed things around further; requiring registration to see the content, among other things.

    I really like how easy it was with BBpress to make these changes possible – literally less than 20mins. To make things show up only when a user is logged in, I used a bunch of these:

    <?php

    if ( bb_is_user_logged_in() ) {

    include ‘path/to/include.php’;

    }

    else {

    echo ‘ ‘;

    }

    ?>

    In reply to: Totomer.com

    @cart3r

    Member

    Thanks for the comments. I spent a good amount of time while I was designing this deciding how much I want to have above the fold. This article on Boxes and Arrows was what really did it for me, though: http://www.boxesandarrows.com/view/blasting-the-myth-of

    @cart3r

    Member

    Thanks much! Finally got it working the way I want to. For everyone’s reference here’s how to do the separation:

    Where the first one is going to go:

    <?php

    foreach ($posts as $bb_post) : $del_class = post_del_class();

    post_text(); // Other variables, etc

    array_shift($posts);

    break;

    endforeach;

    ?>

    Then, where the rest of them are going to appear:

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

    php bb_post_template();

    endforeach; ?>

    @cart3r

    Member

    Thanks! 1st and 3rd things are resolved.

    I’ve been trying hundreds of different things/syntaxes to get the second item to work, but to no avail yet. I’m sure it must be the way I’m trying to code it (Full disclosure: I’m still trying to learn PHP).

    What I’m going for is as follows:

    Run the foreach, and then using array_shift(), grab the first item in the array, and then display just the post_text() that is contained within that array (assuming this is an array within an array)

    This what my code (stripped down) looks like:

    INITIAL POST:

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

    <?

    php array_shift();

    echo post_text();

    ?>

    <?php endforeach; ?>

    =====================================

    and then later on, when the responses are displayed:

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

    <?php echo post_text(); ?>

    <?php endforeach; ?>

    I was hoping the first initial post wouldn’t be displayed since array_shift() would have taken it out?

    Any help would be greatly appreciated…

    @cart3r

    Member

    This is something I’m looking for as well…

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