<?php
|
|
|
|
//
|
|
//private messsages cache - v1.0 Alpha 2
|
|
//
|
|
$sql = "SELECT `u_id`,`nick`,`rank` FROM `".USERS_TABLE."`";
|
|
$query = DataBase::sql_query($sql,GENERAL,'Could not obtain forums information');
|
|
$user['count']= DataBase::num_rows($query);
|
|
|
|
while($result = DataBase::fetch($query))
|
|
{
|
|
$user[$result['u_id']]['u_id']=$result['u_id'];
|
|
$user[$result['u_id']]['nick']=$result['nick'];
|
|
$user[$result['u_id']]['rank']=$result['rank'];
|
|
}
|
|
|
|
$folder = ($_GET['submode']=='sentbox') ? '<a href="pms.php?mode=folder&submode=sentbox" class="navigator">'.$lng['sentbox'].'</a>' : '<a href="pms.php?mode=folder&submode=inbox" class="navigator">'.$lng['inbox'].'</a>';
|
|
//add skin variables
|
|
$skin = array(
|
|
'lang'=>DefaultLang(),
|
|
'lname'=>$lng['message_name'],
|
|
'lauthor'=>$lng['user'],
|
|
'lmdate'=>$lng['date']
|
|
);
|
|
|
|
$skin = array_push_assoc($skin,GenerateHeader($lng['lpm'].': '.(($_GET['submode']=='sentbox') ? $lng['sentbox'] : $lng['inbox']), '</a> > <a href="pms.php" class="navigator">'.$lng['lpm'].'</a> > '.$folder));
|
|
//do it!
|
|
include('./skins/'.$default_skin.'/overall_header.tpl');
|
|
include('./skins/'.$default_skin.'/msgs_is_body.tpl');
|
|
|
|
$uid = $_SESSION['uid'];
|
|
if (!isset($_GET['submode']))
|
|
{
|
|
message_forum($lng['invalidmode'],'pms.php');
|
|
}
|
|
switch($_GET['submode'])
|
|
{
|
|
case 'sentbox':
|
|
{
|
|
$sql = "SELECT * FROM ".PM_SENTBOX_TABLE." WHERE `u_n_id`='$uid'";
|
|
break;
|
|
}
|
|
case 'inbox':
|
|
{
|
|
$sql = "SELECT * FROM ".PM_INBOX_TABLE." WHERE `u_id`='$uid'";
|
|
break;
|
|
}
|
|
default:
|
|
{
|
|
message_forum($lng['invalidmode'],'pms.php');
|
|
break;
|
|
}
|
|
}
|
|
|
|
$query = DataBase::sql_query($sql,CRITICAL,'Could not obtain messages information');
|
|
$count = DataBase::num_rows($query);
|
|
|
|
if ($count==0)
|
|
{
|
|
$skin['nomsgs']='<tr><td width="750" colspan="4" height="19" class="fitem"><p class="fstandard" align="center">'.$lng['no_elements'].'!</p></td></tr>';
|
|
}
|
|
else
|
|
{
|
|
while($item=DataBase::fetch($query))
|
|
{
|
|
$skin=array(
|
|
'mid'=>$item['m_id'],
|
|
'name'=>$item['name'],
|
|
'author'=>Pms::UserName($item['u_id']),
|
|
'nuid'=>$item['u_n_id'],
|
|
'date'=> date('d-m-Y, G:i',$item['time']),
|
|
'mode'=> ($_GET['submode']=='inbox') ? 'user' : 'author'
|
|
);
|
|
|
|
include('./skins/'.$default_skin.'/msgs_is_item_body.tpl');
|
|
}
|
|
$skin['nomsgs'] = '';
|
|
}
|
|
//do it!
|
|
include('./skins/'.$default_skin.'/msgs_is_end_body.tpl');
|
|
if(RANK=='2')
|
|
{
|
|
$skin['pa_link']='<a href="admin/index.php" class="fsmall"><b>'.$lng['pa_link'].'</b></a>';
|
|
}
|
|
else
|
|
{
|
|
$skin['pa_link']='';
|
|
}
|
|
|
|
$stop = TimeGeneration();
|
|
$skin['queries'] = ShowQueries($start, $stop);
|
|
|
|
include('./skins/'.$default_skin.'/overall_footer.tpl');
|
|
?>
|