Location: PHPKode > projects > WH Community > wh_community/framework/messages.php
<?php

    $newpm = mysql_query("SELECT
                              m1.pm_id, m1.title, m1.timestamp, count(m2.pm_id) AS reps, users.user_id AS user_id, users.user_name
                          FROM
                              messages AS m1, messages AS m2,users
                          WHERE
                              ((m1.user1 = '" . $_SESSION['user_id'] . "'
                          AND
                              m1.user1read = 'no'
                          AND
                              users.user_id = m1.user2)
                          OR
                              (m1.user2 = '" . $_SESSION['user_id'] . "'
                          AND
                              m1.user2read = 'no'
                          AND
                              users.user_id = m1.user1))
                          AND
                              m1.pm_id2 = '1'
                          AND
                              m2.pm_id = m1.pm_id
                          GROUP BY
                              m1.pm_id
                          ORDER BY
                              m1.pm_id DESC") OR die(mysql_error());

    if(intval(mysql_num_rows($newpm)) == 0) {

    	

        }else{
        
        echo '<span class="pm_bubble"><a href="inbox.php" class="pmbubble">' . intval(mysql_num_rows($newpm)) . ' ' . $lang['bubble_newpm'] . '</a></span>';
        }

?>
Return current item: WH Community