[ PHPXref.com ] [ Generated: Sun Jul 20 20:38:18 2008 ] [ Tikiwiki 1.9.2 ]
[ Index ]     [ Variables ]     [ Functions ]     [ Classes ]     [ Constants ]     [ Statistics ]

title

Body

[close]

/ -> messu-read.php (source)

   1  <?php
   2  
   3  // $Header: /cvsroot/tikiwiki/tiki/messu-read.php,v 1.14.2.3 2005/03/31 17:33:18 teedog Exp $
   4  
   5  // Copyright (c) 2002-2005, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
   6  // All Rights Reserved. See copyright.txt for details and a complete list of authors.
   7  // Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
   8  require_once  ('tiki-setup.php');
   9  
  10  include_once  ('lib/messu/messulib.php');
  11  
  12  if (!$user) {
  13      $smarty->assign('msg', tra("You are not logged in"));
  14  
  15      $smarty->display("error.tpl");
  16      die;
  17  }
  18  
  19  if ($feature_messages != 'y') {
  20      $smarty->assign('msg', tra("This feature is disabled").": feature_messages");
  21  
  22      $smarty->display("error.tpl");
  23      die;
  24  }
  25  
  26  if ($tiki_p_messages != 'y') {
  27      $smarty->assign('msg', tra("Permission denied"));
  28  
  29      $smarty->display("error.tpl");
  30      die;
  31  }
  32  
  33  if (isset($_REQUEST["delete"])) {
  34      check_ticket('messu-read');
  35      $messulib->delete_message($user, $_REQUEST['msgdel']);
  36  }
  37  
  38  $smarty->assign('sort_mode', $_REQUEST['sort_mode']);
  39  $smarty->assign('find', $_REQUEST['find']);
  40  $smarty->assign('flag', $_REQUEST['flag']);
  41  $smarty->assign('offset', $_REQUEST['offset']);
  42  $smarty->assign('flagval', $_REQUEST['flagval']);
  43  $smarty->assign('priority', $_REQUEST['priority']);
  44  $smarty->assign('legend', '');
  45  
  46  if (!isset($_REQUEST['msgId']) || $_REQUEST['msgId'] == 0) {
  47      $smarty->assign('legend', tra("No more messages"));
  48  
  49      $smarty->assign('mid', 'messu-read.tpl');
  50      $smarty->display("tiki.tpl");
  51      die;
  52  }
  53  
  54  if (isset($_REQUEST['action'])) {
  55      $messulib->flag_message($user, $_REQUEST['msgId'], $_REQUEST['action'], $_REQUEST['actionval']);
  56  }
  57  
  58  // Using the sort_mode, flag, flagval and find get the next and prev messages
  59  $smarty->assign('msgId', $_REQUEST['msgId']);
  60  $next = $messulib->get_next_message($user, $_REQUEST['msgId'], $_REQUEST['sort_mode'], $_REQUEST['find'],
  61      $_REQUEST['flag'], $_REQUEST['flagval'], $_REQUEST['priority']);
  62  $prev = $messulib->get_prev_message($user, $_REQUEST['msgId'], $_REQUEST['sort_mode'], $_REQUEST['find'],
  63      $_REQUEST['flag'], $_REQUEST['flagval'], $_REQUEST['priority']);
  64  $smarty->assign('next', $next);
  65  $smarty->assign('prev', $prev);
  66  
  67  // Mark the message as read in the receivers mailbox
  68  $messulib->flag_message($user, $_REQUEST['msgId'], 'isRead', 'y');
  69  
  70  // Get the message and assign its data to template vars
  71  $msg = $messulib->get_message($user, $_REQUEST['msgId']);
  72  $smarty->assign('msg', $msg);
  73  
  74  // which quote format should tiki use?
  75  global $feature_use_quoteplugin;
  76  if ($feature_use_quoteplugin == 'y') {
  77      $quote_format = 'fancy';
  78  } else {
  79      $quote_format = 'simple';
  80  }
  81  $smarty->assign('quote_format',$quote_format);
  82  
  83  if ($messulib->get_user_preference($user, 'mess_sendReadStatus', 'n') == 'y') {
  84      // Mark the message as read in the senders sent box:
  85      $messulib->flag_message($msg['user_from'], $_REQUEST['msgId'], 'isRead', 'y', 'sent');
  86  }
  87  
  88  ask_ticket('messu-read');
  89  $section = 'user_messages';
  90  include_once  ('tiki-section_options.php');
  91  include_once  ('tiki-mytiki_shared.php');
  92  $smarty->assign('mid', 'messu-read.tpl');
  93  $smarty->display("tiki.tpl");
  94  
  95  ?>


[ Powered by PHPXref - Served by Debian GNU/Linux ]