|
<?php
|
|
/**
|
|
* @package Dynamic Script Forum
|
|
* @file user.php
|
|
* @version 1.0.x, 12-07-2007, 19:35
|
|
* @copyright 2008(c) PioDer <[email protected]>
|
|
* @link http://pioder.gim2przemysl.int.pl/dsf.html
|
|
* @license GNU GPL v3
|
|
**/
|
|
define('IN_uF', true);
|
|
//include files
|
|
include('./config.php');
|
|
include('./includes/constants.php');
|
|
include('./includes/class_db.php');
|
|
include('./includes/class_error.php');
|
|
//connect to database
|
|
DataBase::db_connect();
|
|
include('./includes/sessions.php');
|
|
include('./includes/class_user.php');
|
|
include('./common.php');
|
|
include('./includes/class_overall.php');
|
|
include('./includes/class_forum.php');
|
|
include('./includes/classes/secure.php');
|
|
$default_lang = Over::DefaultLang();
|
|
include('./lngs/'.$default_lang.'/main.php');
|
|
$start = Over::TimeGeneration();
|
|
$default_skin = Over::ViewSkinName();
|
|
sess_del_invalid($_SESSION['uid']);
|
|
sess_register($_SESSION['uid']);
|
|
sess_delete_old();
|
|
$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>".time()." LIMIT 1";
|
|
$query = DataBase::sql_query($sql, 'GENERAL', 'Could not read user active.');
|
|
$result = @mysql_fetch_array($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 = mysql_num_rows($query);
|
|
while ($result = @mysql_fetch_array($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 = @mysql_fetch_array($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']!='') ? '<img src="'.$user_info['avatar'].'" alt="av">' : '<br><br><br><br>',
|
|
'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')) ? '<a href="gg:'.$user_info['gg'].'"><img border="0" src="skins/'.$default_skin.'/images/gg.gif" onMouseOver="this.style.cursor=\'hand\'; this.src=\'skins/'.$default_skin.'/images/gg_active.gif\'"�
|
|
onMouseOut="this.src=\'skins/'.$default_skin.'/images/gg.gif\'" alt="gg"></a>' : '',
|
|
'user_email'=>($user_info['allow_email']=='1') ? '<a href="mailto:'.$user_info['email'].'"><img border="0" src="skins/'.$default_skin.'/images/email.gif" onMouseOver="this.style.cursor=\'hand\'; this.src=\'skins/'.$default_skin.'/images/email_active.gif\'"�
|
|
onMouseOut="this.src=\'skins/'.$default_skin.'/images/email.gif\'" alt="email"></a>' : '',
|
|
);
|
|
$skin = array_push_associative($skin,Over::generate_header($lng['showprofile'].': '.$user_info['nick'], '</a>> <a href="user.php?id='.$_GET['id'].'" class="navigator">'.$lng['showprofile'].': '.$user_info['nick']));
|
|
//do it!
|
|
include('./skins/'.$default_skin.'/overall_header.tpl');
|
|
include('./skins/'.$default_skin.'/user_body.tpl');
|
|
if($_SESSION['uid']>0)
|
|
{
|
|
if(RANK==2)
|
|
{
|
|
$skin['pa_link']='<a href="admin/index.php" class="fsmall"><b>'.$lng['pa_link'].'</b></a>';
|
|
}
|
|
else
|
|
{
|
|
$skin['pa_link']='';
|
|
}
|
|
}
|
|
else
|
|
{
|
|
$skin['pa_link']='';
|
|
}
|
|
$stop = Over::TimeGeneration();
|
|
$skin['queries'] = Over::ShowQueries($start, $stop);
|
|
include('./skins/'.$default_skin.'/overall_footer.tpl');
|
|
?>
|