* @link http://www.pioder.pl/ * @license see LICENSE.txt **/ if ( !defined('IN_uF') ) { die('Hacking attempt'); } // //private messsages cache - v1.0 Alpha 2 // $cnt = Pms::PMCnt(); // 0 - inbox; 1 - sentbox $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') ? ''.$lng['sentbox'].'' : ''.$lng['inbox'].''; //add skin variables $skin = array( 'lang'=>DefaultLang(), 'lname'=>$lng['message_name'], 'lauthor'=>$lng['user'], 'lmdate'=>$lng['date'], 'lmessages_in_box'=>$lng['messages_in_box'], 'msg_count'=>($_GET['submode']=='inbox') ? $cnt[0] : $cnt[1], 'msg_max'=>($_GET['submode']=='inbox') ? $forum_config['pm_inbox_max'] : $forum_config['pm_sentbox_max'], 'msg_per'=>($_GET['submode']=='inbox') ? round(($cnt[0]/$forum_config['pm_inbox_max'])*100,1) : round(($cnt[1]/$forum_config['pm_sentbox_max'])*100,1) ); $skin = array_push_assoc($skin,GenerateHeader($lng['lpm'].': '.(($_GET['submode']=='sentbox') ? $lng['sentbox'] : $lng['inbox']), ''.$lng['lpm'].' » '.$folder)); //do it! require('./skins/'.$default_skin.'/overall_header.tpl'); require('./skins/'.$default_skin.'/pms_folder_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']='
'.$lng['no_elements'].'!