/*************************************************************************** * Dolphin Smart Community Builder * ----------------- * begin : Mon Mar 23 2006 * copyright : (C) 2006 BoonEx Group * website : http://www.boonex.com/ * This file is part of Dolphin - Smart Community Builder * * Dolphin is free software. This work is licensed under a Creative Commons Attribution 3.0 License. * http://creativecommons.org/licenses/by/3.0/ * * Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the Creative Commons Attribution 3.0 License for more details. * You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin, * see license.txt file; if not, write to marketing@boonex.com ***************************************************************************/ require_once( 'inc/header.inc.php' ); require_once( BX_DIRECTORY_PATH_INC . 'design.inc.php' ); require_once( BX_DIRECTORY_PATH_INC . 'profiles.inc.php' ); require_once( BX_DIRECTORY_PATH_INC . 'utils.inc.php' ); // --------------- page variables and login $_page['name_index'] = 130; $_page['css_name'] = 'mail.css'; $logged['member'] = member_auth(0); $memberID = (int)$_COOKIE['memberID']; $_page['extra_js'] = $oTemplConfig -> sMailBoxSortingInit; $_page['js_name'] = 'sort_table.js'; // this is dynamic page - send headers to do not cache this page send_headers_page_changed(); $_ni = $_page['name_index']; $mode = $_REQUEST['mode']; switch( $mode ) { case 'outbox': $_page['header'] = _t( "_OUTBOX_H" ); $_page['header_text'] = _t( "_OUTBOX_H1" ); $_page_cont[$_ni]['page_main_code'] = PageCodeOutbox(); break; case 'inbox': default: $mode = 'inbox'; $_page['header'] = _t( "_INBOX_H" ); $_page['header_text'] = _t( "_INBOX_H1" ); $_page_cont[$_ni]['page_main_code'] = PageCodeInbox(); } PageCode(); function PageCodeInbox() { global $memberID; global $site; global $tmpl; global $date_format; if( $_REQUEST['do_delete'] or $_REQUEST['do_mark_new'] or $_REQUEST['do_mark_old'] ) { if( $_REQUEST['do_delete'] ) $sqlDoQuery = "DELETE FROM `Messages` WHERE"; if( $_REQUEST['do_mark_new'] ) $sqlDoQuery = "UPDATE `Messages` SET `New`='1' WHERE"; if( $_REQUEST['do_mark_old'] ) $sqlDoQuery = "UPDATE `Messages` SET `New`='0' WHERE"; if( $aMsgs = $_POST['m'] and is_array( $aMsgs ) and !empty( $aMsgs ) ) { foreach( $aMsgs as $msgID => $on ) { $msgID = (int)$msgID; if( !$msgID or $on != 'on' ) continue; db_res( "$sqlDoQuery `ID`=$msgID AND `Recipient` = $memberID" ); } } } //echoDbg( $_POST ); $query = " SELECT `Messages`.`ID`, UNIX_TIMESTAMP( `Date` ) AS `timestamp`, DATE_FORMAT(`Date`, '$date_format') AS `Date`, `Sender`, `Profiles`.`NickName` AS `SenderNickName`, `Subject`, `New` FROM `Messages` LEFT JOIN `Profiles` ON `Profiles`.`ID` = `Sender` WHERE `Recipient` = $memberID ORDER BY `Date` DESC "; $rMsgs = db_res( $query ); if( !mysql_num_rows( $rMsgs ) ) return '