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.

Counting Bulletin Board Messages

September 23, 2010 3:36pm

Subscribe [3]
  • #1 / Sep 23, 2010 3:36pm

    Luka Kemperle

    5 posts

    Hi,
    I’m able to display bulletins from bulletin_group in my template..
    Is it possible to count active (not expired) messages?

    Example: Messages in the BB: 3

    Here is my code:

    {if logged_in}
    <div id="bulletin-board">
    {exp:query sql="SELECT bulletin_date, bulletin_message 
    FROM exp_member_bulletin_board 
    WHERE bulletin_group = '1'||'10' 
    ORDER BY bulletin_date DESC"}
    {if no_results}Sorry, No Bulletin Board Posts{/if}
        <div class="index-multi">
            <h6 class="date intern-news">
                <strong>{bulletin_date format="%d"}.</strong >{bulletin_date format="%F"}
    {bulletin_date format="%Y"}
                    </h6>
            <div class="edge">
            {bulletin_message}
            </div>
             </div>
    {/exp:query} 
    </div>
    {/if}

    There is probably query solution with COUNT,...
    Thanks!

  • #2 / Sep 23, 2010 4:42pm

    Ingmar

    29245 posts

    Yes, that would have to be a custom SQL query. Let me move this to the code share corner for you.

  • #3 / Sep 23, 2010 4:44pm

    Luka Kemperle

    5 posts

    OK, thanks..

  • #4 / Dec 07, 2010 8:49pm

    Graham Huber

    217 posts

    Any luck on this, Luka?

    I’m interesting in adapting your code and would like to use a bulletin count as well.

    Many thanks if you can share!

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases