* @link http://www.pioder.pl/ * @license see LICENSE.txt **/ define('IN_uF', true); //include files require('./config.php'); require('./includes/constants.php'); require('./includes/db.php'); require('./includes/errors.php'); //connect to database DataBase::db_connect(); require('./includes/sessions.php'); require('./includes/classes/class_user.php'); require('./common.php'); require('./includes/misc_functions.php'); require('./includes/classes/class_forum.php'); require('./includes/classes/secure.php'); $default_lang = DefaultLang(); require('./lngs/'.$default_lang.'/main.php'); $start = TimeGeneration(); $default_skin = ViewSkinName(); SessDelInvalid(); SessRegister(); SessDeleteOld(); $uid = intval($_GET['id']); //check online for user $sql = "SELECT `s_id`, `u_id`, `time` FROM ".SESSIONS_TABLE." WHERE `u_id`='$uid' AND time+1250>".$_SERVER['REQUEST_TIME']." LIMIT 1"; $query = DataBase::sql_query($sql, GENERAL, 'Could not read user active.'); $result = DataBase::fetch($query); if ($result['u_id']==$uid) { $active = 1; } else { $active = 0; } unset($sql, $query, $result); $userwarn = 0; $sql = "SELECT `u_id`,`value` FROM `".WARNINGS_TABLE."` WHERE `u_id`='$uid'"; $query = DataBase::sql_query($sql,GENERAL,'Could not obtain user warns information'); $result = DataBase::num_rows($query); while ($result = DataBase::fetch($query)) { if ($result['value']=='-') { $userwarn -=1; } else { $userwarn +=1; } } $userwarn = ($userwarn>0) ? $userwarn*10 : $userwarn; //add skin variables $sql = "SELECT * FROM `".USERS_TABLE."` WHERE u_id='$uid'"; $query = DataBase::sql_query($sql,CRITICAL,'Could not obtain user information'); $user_info = DataBase::fetch($query); if ($user_info['u_id']=='') { message_forum($lng['no_user'],'index.php'); } $skin = array( 'u_id'=>$_GET['id'], 'lang'=>$default_lang, 'sig'=>$user_info['sig'], 'lsig'=>$lng['sig'], 'posts'=>$user_info['posts'], 'luposts'=>$lng['posts'], 'lstat'=>$lng['stat'], 'stat'=>($active==1) ? 'online.gif' : 'offline.gif', 'prposts'=>User::PostWithForum($user_info['posts']), 'lastvisit'=>($user_info['lastvisit']!='0') ? date('d-m-Y, G:i',$user_info['lastvisit']) : $lng['never'], 'llastvisit'=>$lng['lulastvisit'], 'avatar'=>($user_info['avatar']!='') ? 'av' : '



', 'lavatar'=>$lng['avatar'], 'regdate'=>date('d-m-Y, G:i',$user_info['regdate']), 'lpalf'=>$lng['witch_all_post_forum'], 'lregdate'=>$lng['luregister'], 'interests'=>$user_info['interests'], 'linterests'=>$lng['luinterests'], 'userrank'=>User::UserRank($user_info['rank']), 'luserrank'=>$lng['lurank'], 'lwarns'=> $lng['warns'], 'show_topics'=> $lng['view_user_topics'], 'warnlevel' => $userwarn, 'warncolor'=>($userwarn>0) ? 'red' : 'green', 'lcontact'=>$lng['contact'], 'user_gg'=>(($user_info['allow_gg'])&& ($user_info['gg']!='0')) ? 'gg' : '', 'user_email'=>($user_info['allow_email']=='1') ? 'email' : '', ); $skin = array_push_assoc($skin,GenerateHeader($lng['showprofile'].': '.$user_info['nick'], ''.$lng['showprofile'].': '.$user_info['nick'])); //do it! require('./skins/'.$default_skin.'/overall_header.tpl'); require('./skins/'.$default_skin.'/user_body.tpl'); if($_SESSION['uid']>0) { if(RANK==2) { $skin['pa_link']=''.$lng['pa_link'].''; } else { $skin['pa_link']=''; } } else { $skin['pa_link']=''; } $stop = TimeGeneration(); $skin['queries'] = ShowQueries($start, $stop); require('./skins/'.$default_skin.'/overall_footer.tpl'); ?>