* @link http://www.pioder.pl/ * @license see LICENSE.txt **/ if ( !defined('IN_uF') ) { die('Hacking attempt'); } //smiles cache $sql = "SELECT * FROM ".SMILES_TABLE.""; $query = DataBase::sql_query($sql,GENERAL,'Could not obtain emoticons information.'); $i = 1; while($result = DataBase::fetch($query)) { $smile[$i]['smile'] = $result['smile']; $smile[$i]['url'] = $result['url']; $i +=1; } $mid = intval($_GET['id']); if (!isset($_GET['submode'])) { message_forum($lng['invalidmode'],'pms.php'); } switch($_GET['submode']) { case 'author': { $sql = "SELECT * FROM ".PM_SENTBOX_TABLE." WHERE m_id='$mid'"; break; } case 'user': { $sql = "SELECT * FROM ".PM_INBOX_TABLE." WHERE m_id='$mid'"; break; } default: { message_forum($lng['invalidmode'],'pms.php'); break; } } $query = DataBase::sql_query($sql,CRITICAL,'Could not obtain messages information'); $result = DataBase::fetch($query); //if message exist.... if ($result['m_id']=='') { message_forum($lng['no_message'],'pms.php'); } switch($_GET['submode']) { case 'user': { //if message user loged.... if ($result['u_id']!=$_SESSION['uid']) { message_forum($lng['merror_2'],'index.php'); } break; } case 'author': { //if message author loged.... if ($result['u_n_id']!=$_SESSION['uid']) { message_forum($lng['merror_2'],'index.php'); } break; } } if ($_GET['submode']=='user') { DataBase::sql_query("UPDATE ".PM_INBOX_TABLE." SET `read`='1' WHERE `m_id`='$mid'", GENERAL, 'Could not update message.'); } $sql = "SELECT * FROM ".USERS_TABLE." WHERE `u_id`='".$result['u_n_id']."'"; $query = DataBase::sql_query($sql,GENERAL,'Could not obtain user information'); $user = DataBase::fetch($query); $folder = ($_GET['submode']=='author') ? ''.$lng['sentbox'].'' : ''.$lng['inbox'].''; //add skin variables $skin = array( 'lang'=>DefaultLang(), 'lname'=>$lng['message'], 'u_id'=>$result['u_n_id'], 'username'=>Topic::UserName($user['nick'], $user['rank']), 'userrank'=>User::UserRank($user['rank']), 'delete'=>'del', 'avatar'=>($user['avatar']!='') ? 'av' : '



', 'msgtext'=>Topic::PostText($result['message'],0,0), 'sig'=> ($user['sig']!='') ? '
------------------------
'.$user['sig'] : '', 'posts'=>$user['posts'], 'regdate'=>date('d-m-Y',$user['regdate']), 'lastvisit'=>date('d-m-Y',$user['lastvisit']), //labels 'lrank'=>$lng['lurank2'], 'llastvisit'=>$lng['lulastvisit'], 'lregdate'=>$lng['regdate2'], 'lposts'=>$lng['posts'], 'lno'=>$lng['no.'], 'lpinfo'=>$lng['postinfo'] ); $skin = array_push_assoc($skin,GenerateHeader($lng['show_message'].': '.$result['name'], .$folder.' » '.$lng['show_message'] .': '.$result['name'])); //do it! require('./skins/'.$default_skin.'/overall_header.tpl'); require('./skins/'.$default_skin.'/msgs_msg_body.tpl'); if(RANK=='2') { $skin['pa_link']=''.$lng['pa_link'].''; } else { $skin['pa_link']=''; } $stop = TimeGeneration(); $skin['queries'] = ShowQueries($start, $stop); require('./skins/'.$default_skin.'/overall_footer.tpl'); break; ?>