ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Help with outputting code within a query and paginating

May 15, 2013 6:04pm

Subscribe [1]
  • #1 / May 15, 2013 6:04pm

    Alli

    158 posts

    I a trying to check if a member is online and then output the member info (contained in a channel entry) in a paginated grid pattern of 12 to a page.
    The following code works ok without the query but with the query I get one member output per page:

    {exp:channel:entries channel="zoo_visitor" search_id="{segment_2}" group_id="7|8" search:show_hide="show" search:member_photo="not IS_EMPTY" paginate="bottom" limit="12"}
      {paginate}{clear}<div class="messagebar">{if previous_page}<a href="http://{auto_path}"> «Previous Page</a>  {/if}
      {if next_page}<a href="http://{auto_path}">Next Page »</a>{/if} <span class="grid-right">{pagination_links}</span></div>{clear}{pad}{/paginate}
      {exp:query sql="SELECT member_id FROM exp_sessions WHERE member_id = '{member_id}' LIMIT 1"} {if member_id}
      <div class="{switch='grid-item|grid-item|grid-item|grid-item last'}">   
    <!-- Entry content goes here -->
    
    
       </div>  {/if}{/exp:query} 
          
     {/exp:channel:entries}
.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases