Files
Testing/user_messages.php
sean 0e8a8b3028
Some checks are pending
deploy-testing / deploy (push) Waiting to run
Initial testing snapshot
2026-11-17 16:15:01 -05:00

60 lines
1.6 KiB
PHP

<?php
/* $Id: user_messages.php 42 2009-01-29 04:55:14Z john $ */
$page = "user_messages";
include "header.php";
if(isset($_POST['task'])) { $task = $_POST['task']; } elseif(isset($_GET['task'])) { $task = $_GET['task']; } else { $task = "main"; }
if(isset($_POST['p'])) { $p = $_POST['p']; } elseif(isset($_GET['p'])) { $p = $_GET['p']; } else { $p = 1; }
if(isset($_POST['s'])) { $s = $_POST['s']; } elseif(isset($_GET['s'])) { $s = $_GET['s']; } else { $s = ""; }
// CHECK FOR ADMIN ALLOWANCE OF MESSAGES
if( !$user->level_info['level_message_allow'] )
{
header("Location: home.php");
exit();
}
// SET VARS
if($user->user_info["user_level_id"]==5){
$pms_per_page = 5;
}
else{
$pms_per_page = 10;
}
// DELETE NECESSARY PMS
if($task == "deleteselected") { $user->user_message_delete_selected($_POST['delete_convos'], 0); }
// GET TOTAL MESSAGES
$total_pms = $user->user_message_total(0, 0);
// MAKE PM PAGES
$page_vars = make_page($total_pms, $pms_per_page, $p);
// GET ARRAY OF MESSAGES
$pms = $user->user_message_list($page_vars[0], $pms_per_page, 0);
for($x=$page_vars[1]; $x<=$page_vars[2]; $x++)
{
if(($page_vars[1]+10)==$x)
{break;}
$for[$y]=$x;
$y++;
}
$smarty->assign('user_unread_pms', $user->user_message_total(0, 1));
$smarty->assign('for', $for);
// ASSIGN VARIABLES AND INCLUDE FOOTER
$smarty->assign('total_pms', $total_pms);
$smarty->assign_by_ref('pms', $pms);
$smarty->assign('p', $page_vars[1]);
$smarty->assign('s', $s);
$smarty->assign('maxpage', $page_vars[2]);
$smarty->assign('p_start', $page_vars[0]+1);
$smarty->assign('p_end', $page_vars[0]+count($pms));
include "footer.php";
?>