<?php
// ======================================================================== //
//   KOOBI - CMS                                                            //
//   SCRiPTMAFiA 2005 - THE DiRTY HANDS ON YOUR SCRiPTS                     //
//                                                                          //
//   DREAM4 - AM MICHELSGRUND 7 - 69469 WEINHEIM - GERMANY                  //    
//   TEL. +49(0) 6201 - 980442 / FAX. +49(0) 6201 - 64809                   //
// ======================================================================== //
if(!checkactive('user')) include(dirname(__FILE__)."/lib/notactive.php" );
$sname = simpletitle($lang['title_userdetails']);
if (!permission('showuserpage')) {
	$EOUT = stderror("nopermission", $lang['nopermission_t'], str_replace("__URL__", "index.php", $lang['redirect']), "index.php", 1);
	$error = 1;
	$NOOUT = 1;
}

$sql = new dbc("SELECT * FROM ".PREFIX."_user WHERE uid = '".escs($_REQUEST['id'])."' AND user_regdate > 1");
$row = $sql->fetchrow();

if($row->uid == ''){
 $EOUT = msg("error_once","error_usernotindb", str_replace("__URL__", "index.php", $lang['redirect']), "index.php") ; 
 $NOOUT = 1;
}

// ausgabe
if($row->user_aim!=""){$useraim = '<a href="javascript:popex(\'index.php?p=misc&do=AIM&uid='.$row->uid.'\',\'\',\'450\',\'300\',\'1\',\'1\',\'0\',\'0\');"><img border="0" src="templates/'.$THEME.'/img/buttons/aim.gif" alt=\"\" /></a>';}
if($row->user_icq!=""){$usericq = '<a href="javascript:popex(\'index.php?p=misc&do=ICQ&uid='.$row->uid.'\',\'\',\'450\',\'300\',\'1\',\'1\',\'0\',\'0\');"><img border="0" src="templates/'.$THEME.'/img/buttons/icq.gif" alt=\"\" /></a>';}

if($row->user_viewemail=="yes"){$usermail = '<a href="javascript:popex(\'index.php?p=misc&do=EMAIL&uid='.$row->uid.'\',\'\',\'450\',\'300\',\'1\',\'1\',\'0\',\'0\');"><img border="0" src="templates/'.$THEME.'/img/buttons/email.gif" alt=\"\" /></a>';}

$row->usergroup = fetchgroupname($row->ugroup);
$row->ctime = mygmt($row->user_regdate);



// Darf user BBcode oder smilies verwenden?
$signatur = (BBCODESITE==1) ? kcodes($row->user_sig) : nl2br($row->user_sig);
$signatur = (SMILIES == 1) ? dosmilies($signatur) : $signatur;

$interests = (BBCODESITE==1) ? kcodes($row->user_interests) : nl2br($row->user_interests);
$interests = (SMILIES == 1) ? dosmilies($interests) : $interests;

$tmpl->register_function('getonlinestatus', 'getonlinestatus');
$tmpl->assign('signatur', $signatur);
$tmpl->assign('posts', numposts(escs($_REQUEST['id'])));
$tmpl->assign('interests', $interests);
$tmpl->assign('avatar', getAvatar($row->ugroup,$row->user_avatar,$row->usedefault_avatar,$row->ugroup));
$tmpl->assign('pncode', base64_encode($row->uname));
$tmpl->assign('row', $row);
$tmpl->assign('lang', $lang);
$tmpl->assign('content', parsetrue('container/'.container('userlist'), $lang['title_userdetails'], $tmpl->fetch('user/userdetail.tpl')));
?>