Skip to:
Content
Pages
Categories
Search
Top
Bottom

messages: notices-loop breaks the inbox and sentbox loop

  • Avatar of Shmoo
    Shmoo
    Participant

    @macpresss

    I’ve made a few screenshots of my raw site to show what I’m trying to create.

    Left side I have the inbox and sentbox loop that you can toggle by some JS Tabs. Both inbox and sentbox will be shown on the ‘inbox page’ only the sentbox is a hidden tab by default.

    On the right side I have made my “content” div where I’m trying to show all other elements like compose, single and notices.
    Everything is working just fine until I show the notices page (moderators only) , that will cause to break my inbox-/sentbox loop for some reason and I can’t figure out why.

    From my sight I’m just making and closing 3 different loops
    < inbox – start – end >
    < sentbox – start – end >
    < notices – start – end >

    Images:
    Notices page -Breaks-
    Messages inbox
    Messages single
    Messages compose

    The code:

    
    <div class="row">
    	<div class="three columns npr">
    	<?php if ( bp_is_my_profile() ): ?>
    		<?php bp_get_template_part( 'members/single/messages/messages-loop' ); ?>
    	<?php endif; ?>
    	</div>
    	<div class="five columns">
    		<div class="msg-content-wrap">
    		<?php
    		switch ( bp_current_action() ):
    			case 'inbox':
    			case 'sentbox':
    				bp_get_template_part( 'members/single/messages/create-button' );
    				break;
    
    			// Single Message View
    			case 'view':
    				bp_get_template_part( 'members/single/messages/single' );
    				break;
    
    			// Compose
    			case 'compose':
    				bp_get_template_part( 'members/single/messages/compose' );
    				break;
    
    			// Notices
    			case 'notices':
    				bp_get_template_part( 'members/single/messages/notices-loop' );
    				break;
    
    			// Any other
    			default:
    				bp_get_template_part( 'members/single/plugins' );
    				break;
    		endswitch; ?>
    		</div>
    	</div>
    </div>
    

    Inside messages-loop.php I’ve just duplicated the loop with different boxes.

    
    ... inbox start ...
    <?php if ( bp_has_message_threads( bp_ajax_querystring( 'messages' ).'per_page=10' ) ): ?>
    
    ... sentbox start ...
    <?php if ( bp_has_message_threads( bp_ajax_querystring( 'messages' ).'box=sentbox&max=10' ) ): ?>
    

    And the only difference in the loop-structure I could see if the way the notices are started. It doesn’t have that bp_ajax_querystring()

    
    ... notices loop start ...
    <?php if ( bp_has_message_threads() ): ?>
    

    Anybody an idea why the notices-loop will can break the inbox-/sentbox loop while it’s later being called in the source?

You must be logged in to reply to this topic.