Location: PHPKode > scripts > WH Social > wh_social/framework/templates/notification.tpl
<?php

    echo '<img src="style/icons/notification.png" border="0" vspace="5" alt="MSG">';

    $sql = mysql_query("SELECT m1.msg, m1.title, m1.date, count(m2.msg) AS reps, members.id AS id, members.name FROM messages AS m1, messages AS m2,members WHERE ((m1.user1 = '" . (int)$_SESSION['id'] . "' AND m1.user1read = 'no' AND members.id = m1.user2) OR (m1.user2 = '" . (int)$_SESSION['id'] . "' AND m1.user2read = 'no' AND members.id = m1.user1)) AND m1.assign = '1' AND m2.msg = m1.msg GROUP BY m1.msg ORDER BY m1.msg DESC");

    if(!$sql) {

	echo '<p>' . $lang['no_msg_unread'] . '</p>';

		}else{

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

		echo '<p class="red_bgp">' . $lang['no_msg_unread'] . '</p>';

	}else{

    echo '<p class="blue_bgm">' . intval(mysql_num_rows($sql)) . ' ' . $lang['yes_msg_unread'] . '</p>';
    }
    }

    $query = "SELECT id, level FROM members WHERE id = " . (int)$_SESSION['id'];

    $isset_admin = mysql_query($query) OR die(mysql_error());
    $row_level = mysql_fetch_assoc($isset_admin);

    if($row_level['level'] == '1') {

        echo '<p class="red_bgp"><a href="admin/" target="_blank" class="admin_link">' . $lang['link_admin'] . '</a></p>';
        }

?>
Return current item: WH Social