Location: PHPKode > scripts > WH Board > wh_board/framework/messages.php
<?php

    $sql_pm = "SELECT
                   m1.msg_id, m1.msg_title, m1.msg_date, count(m2.msg_id) AS reps, users.user_id AS user_id, users.user_name
               FROM
                   messages AS m1, messages AS m2,users
               WHERE
                   ((m1.msg_user1 = '" . (int)$_SESSION['user_id'] . "'
               AND
                   m1.msg_user1read = 'no'
               AND
                   users.user_id = m1.msg_user2)
               OR
                   (m1.msg_user2 = '" . (int)$_SESSION['user_id'] . "'
               AND
                   m1.msg_user2read = 'no'
               AND
                   users.user_id = m1.msg_user1))
               AND
                   m1.msg_id2 = '1'
               AND
                   m2.msg_id = m1.msg_id
               GROUP BY
                   m1.msg_id
               ORDER BY
                   m1.msg_id DESC";

    $check_msg = mysql_query($sql_pm) OR die(mysql_error());

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

    //

        }else{

        echo '<a href="inbox.php"><img src="style/images/notification/pm.png" hspace="15" border="0" alt="' . $lang['msg_new_pms'] . '" title="' . intval(mysql_num_rows($check_msg)) . ' ' . $lang['msg_new_pms']. '"></a>';
        }

?>
Return current item: WH Board