<?php
/********************************************************/
/* NSN Your Account                                     */
/* By: NukeScripts Network (webmaster@nukescripts.net)  */
/* http://www.nukescripts.net                           */
/* Copyright © 2000-2004 by NukeScripts Network         */
/* ==================================================== */
/* Based from:                                          */
/* PHP-NUKE: Web Portal System                          */
/********************************************************/
defined('MAXIMUS') or Header("Location: index.php");

    if (is_active("Private_Messages") AND ($username == $cookie[1]) AND ($usrinfo['user_password'] == $cookie[2])) {
        br('1');
        Max_OpenTable();
        echo "<center><b>"._PRIVATEMESSAGES."</b>";
        br('2');
        $numrow = $db->sql_numrows($db->sql_query("SELECT * FROM `".$prefix."_bbprivmsgs` WHERE `privmsgs_to_userid`='$usrinfo[user_id]' AND (`privmsgs_type`='1' OR `privmsgs_type`='5' OR `privmsgs_type`='0')"));
        if (is_active("Members_List")) {
            $mem_list = "<a href=\"modules.php?name=Members_List\">"._BROWSEUSERS."</a>";
        } else {
            $mem_list = "";
        }
        if (is_active("Search")) {
            $mod_search = "<a href=\"modules.php?name=Search&amp;type=users\">"._SEARCHUSERS."</a>";
        } else {
            $mod_search = "";
        }
        if ($mem_list != "" AND $mod_search != "") { $a = " | "; } else { $a = ""; }
        if ($mem_list != "" OR $mod_search != "") {
            $links = "[ $mem_list $a $mod_search ]";
        } elseif ($mem_list == "" AND $mod_search == "") {
            $links = "";
        }
        echo ""._YOUHAVE." <a href=\"modules.php?name=Private_Messages\"><b>$numrow</b></a> "._PRIVATEMSG."";
	br('2');
	echo "<form action=\"modules.php?name=Private_Messages\" method=\"post\">";
        echo ""._USENDPRIVATEMSG.": <input type=\"text\" name=\"pm_username\" size=\"20\" />&nbsp;&nbsp;$links";
        echo "<input type=\"hidden\" name=\"send\" value=\"1\" />";
        echo "</form></center>";
        Max_CloseTable();
    }