summaryrefslogtreecommitdiff
path: root/read.php
diff options
context:
space:
mode:
authorbitweaver.org <bitweaver@users.sourceforge.net>2005-06-19 04:56:31 +0000
committerbitweaver.org <bitweaver@users.sourceforge.net>2005-06-19 04:56:31 +0000
commitdb60c85506a212d5eae4ffc6eecf43ece2a9b7f9 (patch)
tree441c9f624e4d6dd5beb28ce677c4955f5811022b /read.php
downloadmessages-db60c85506a212d5eae4ffc6eecf43ece2a9b7f9.tar.gz
messages-db60c85506a212d5eae4ffc6eecf43ece2a9b7f9.tar.bz2
messages-db60c85506a212d5eae4ffc6eecf43ece2a9b7f9.zip
IMPORT TikiPro CLYDE FINAL
Diffstat (limited to 'read.php')
-rw-r--r--read.php67
1 files changed, 67 insertions, 0 deletions
diff --git a/read.php b/read.php
new file mode 100644
index 0000000..de11603
--- /dev/null
+++ b/read.php
@@ -0,0 +1,67 @@
+<?php
+
+// $Header: /cvsroot/bitweaver/_bit_messages/read.php,v 1.1 2005/06/19 04:56:31 bitweaver Exp $
+
+// Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
+// All Rights Reserved. See copyright.txt for details and a complete list of authors.
+// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
+require_once( '../bit_setup_inc.php' );
+require_once( MESSU_PKG_PATH.'messu_lib.php' );
+
+if( !$gBitUser->isRegistered() ) {
+ $smarty->assign('msg', tra("You are not logged in"));
+ $gBitSystem->display( 'error.tpl' );
+ die;
+}
+
+$gBitSystem->isPackageActive( 'messu', TRUE );
+$gBitSystem->verifyPermission( 'bit_p_messages' );
+
+if (isset($_REQUEST["msgdel"])) {
+
+ $messulib->delete_message($gBitUser->mUserId, $_REQUEST['msgdel']);
+}
+
+$sort_mode = !empty( $_REQUEST['sort_mode'] ) ? $_REQUEST['sort_mode'] : '';
+$find = !empty( $_REQUEST['find'] ) ? $_REQUEST['find'] : '';
+$flag = !empty( $_REQUEST['flag'] ) ? $_REQUEST['flag'] : '';
+$offset = !empty( $_REQUEST['offset'] ) ? $_REQUEST['offset'] : '';
+$flagval = !empty( $_REQUEST['flagval'] ) ? $_REQUEST['flagval'] : '';
+$priority = !empty( $_REQUEST['priority'] ) ? $_REQUEST['priority'] : '';
+
+$smarty->assign('sort_mode', $sort_mode );
+$smarty->assign('find', $find );
+$smarty->assign('flag', $flag );
+$smarty->assign('offset', $offset );
+$smarty->assign('flagval', $flagval );
+$smarty->assign('priority', $priority );
+$smarty->assign('legend', '');
+
+if (!isset($_REQUEST['msg_id']) || $_REQUEST['msg_id'] == 0) {
+ $smarty->assign('legend', tra("No more messages"));
+ $gBitSystem->display( 'messu-read.tpl');
+ die;
+}
+
+if (isset($_REQUEST['act'])) {
+ $messulib->flag_message( $gBitUser->mUserId, $_REQUEST['msg_id'], $_REQUEST['act'], $_REQUEST['actval'] );
+}
+
+// Using the sort_mode, flag, flagval and find get the next and prev messages
+$smarty->assign('msg_id', $_REQUEST['msg_id']);
+$next = $messulib->get_next_message( $gBitUser->mUserId, $_REQUEST['msg_id'], $sort_mode, $find, $flag, $flagval, $priority );
+$prev = $messulib->get_prev_message( $gBitUser->mUserId, $_REQUEST['msg_id'], $sort_mode, $find, $flag, $flagval, $priority );
+$smarty->assign('next', $next);
+$smarty->assign('prev', $prev);
+
+// Mark the message as read
+$messulib->flag_message( $gBitUser->mUserId, $_REQUEST['msg_id'], 'is_read', 'y');
+
+// Get the message and assign its data to template vars
+$msg = $messulib->get_message( $gBitUser->mUserId, $_REQUEST['msg_id']);
+$smarty->assign('msg', $msg);
+
+$section = 'user_messages';
+$gBitSystem->display( 'bitpackage:messu/messu_read.tpl');
+
+?>