<?PHP
/************************************************************************/
/* NPDS V : Net Portal Dynamic System .                                 */
/* ===========================                                          */
/*                                                                      */
/* This version name NPDS Copyright (c) 2001-2004 by Philippe Brunier   */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/
if (!function_exists("Mysql_Connexion")) {include ("mainfile.php");}
include("powerpack_f.php");
global $powerpack; $powerpack=true;

switch($op) {
   // Instant Members Message
   case "instant_message":
        Form_instant_message($to_userid);
        break;

   case "write_instant_message":
        if ($user) {
           $res = mysql_query("select uid from users where uname='$cookie[1]'");
           list($from_userid) = mysql_fetch_row($res);
           if (($subject!="") or ($message!="")) {
              $subject=FixQuotes($subject)."";
              $messages=FixQuotes($messages)."";
              writeDB_private_message($to_userid,"",$subject,$from_userid,$message,$copie);
           }
        }
        Header("Location: index.php");
        break;
   // Instant Members Message

   // Purge Chat Box
   case "admin_chatbox_write":
        if ($admin) {
           if ($chatbox_clearDB=="OK") {
              mysql_query("DELETE FROM chatbox WHERE date <= ".(time()-(60*5))."");
           }
        }
        Header("Location: index.php");
        break;
   // Purge Chat Box

}
?>