<?php
# Copyright by: Manuel Staechele
# Support: www.ilch.de
defined ('main') or die ( 'no direct access' );
if( $allgAr['ProfilRight'] == 1 OR loggedin()){
error_reporting(E_ALL);
$uid = $menu->get(2);
###
##
# auslesen der Menüs by Nero
##define some vars
$choosemenu = $menu->get(3);
$l= '';
$l1= '';
$usermenu = '';
$checkchoose = true;
$checkchoose1 = true;
$usermenu[0] = 0;
$tmenupos = 0;
$imenu = 0;
$imenu1 = 1;
$menushow = '';
##hier wird die letzte position von den eingabefelder ausgelesen
$takelastpos = db_result ( db_query ("SELECT pos FROM prefix_profilefields WHERE func <> 2 ORDER BY pos DESC LIMIT 1") , 0 );
/*
auslesen und kontrolieren des inhlates von den Kategorien,
die Kategorien werden hier natürlich auch ausgelesen
*/
$ergmenu = db_query("SELECT * FROM prefix_profilefields WHERE func = 2 ORDER BY pos ASC");
while($row1 = db_fetch_assoc($ergmenu)){
$usermenuname[$imenu1] = $row1['show'];
$usermenu[$imenu1] = $row1['pos'];
$menushow[$imenu1] ='<a class="profil10" href="index.php?user-details-'.$uid.'-'.$row1['pos'].'"> '.$row1['show'].' </a>|';
if($choosemenu){
if($choosemenu == $usermenu[$imenu] AND $usermenu[$imenu] AND $takelastpos > $usermenu[$imenu]){
$menushow[$imenu] = str_replace('profil10','profil11',$menushow[$imenu]);
if($usermenu[$imenu]+1 <> $usermenu[$imenu1]){
if($imenu ==2){
$l = profilefields_show( $uid, $usermenu[$imenu], $usermenu[$imenu1], 40);
}else{
$l = profilefields_show( $uid, $usermenu[$imenu], $usermenu[$imenu1]);
}
$tmenupos = $imenu;
}else{$tmenupos = $imenu;}
$checkchoose1 = false;
}elseif($choosemenu == $usermenu[$imenu1] AND $takelastpos < $usermenu[$imenu1]){
$menushow[$imenu1] = str_replace('profil10','profil11',$menushow[$imenu1]);
$tmenupos = $imenu1+3;
$checkchoose1 = false;
}
$checkchoose = false;
}
$imenu1++;
$imenu++;
}
if($checkchoose){
$checkchoose1 = false;
$menushow[1] = str_replace('profil10','profil11',$menushow[1]);
$l = profilefields_show( $uid, $usermenu[1], $usermenu[2], 40);
$tmenupos = 1;
}elseif($choosemenu == $usermenu[$imenu] AND $takelastpos > $usermenu[$imenu] AND $checkchoose1){
$checkchoose1 = false;
$takelastpos++;
$menushow[$imenu] = str_replace('profil10','profil11',$menushow[$imenu]);
if($imenu <=2){
$l = profilefields_show( $uid, $usermenu[$imenu], $takelastpos, 40);
}else{
$l = profilefields_show( $uid, $usermenu[$imenu], $takelastpos);
}
$tmenupos = $imenu;
}elseif($checkchoose1){
$l = '<td class="Cmite" width="100%">Sie haben eine ungültige Kategorie gewält</td>';
$tmenupos = $imenu+3;
}
foreach($menushow as $show2){
$l1 .= $show2;
}
###
##
# der rest kommt hier
$abf = 'SELECT * FROM prefix_user WHERE id = "'.$uid.'"';
$erg = db_query($abf);
$row = db_fetch_assoc($erg);
$avatar = '';
if ( file_exists($row['avatar'])) {
$avatar = '<img src="'.$row['avatar'].'" border="0">';
}
$userpict = '';
if ( file_exists($row['userpict'])) {
$userpict = '<img src="'.$row['userpict'].'" border="0">';
}
$regsek = mktime ( 0,0,0, date('m'), date('d'), date('Y') ) - $row['regist'];
$regday = round($regsek / 86400);
$postpday = ( $regday == 0 ? 0 : round($row['posts'] / $regday, 2 ) );
$title = $allgAr['title'].' :: Users :: Details von '.$row['name'];
$hmenu = $extented_forum_menu.'<a class="smalfont" href="?user">Users</a><b> » </b> Details von '.$row['name'].$extented_forum_menu_sufix;
$design = new design ( $title , $hmenu, 1, 'forum/index.htm' );
$design->header();
$tpl = new tpl ( 'user/userdetails' );
$tpl->out(0);
##Hier wird die 1. Kategorie ausgelesen. Hier wird noch der name sowie das usebild mit ausgegeben.
if($tmenupos == 1){
$ar1 = array (
'NAME' => $row['name'],
'USERBILD' => $userpict,
'NAME' => $row['name']
);
$ar1['profilefieldtitle'] = '<th class="ProfTitel" colspan="3"><b>'.$l1.'</b></th>';
$ar1['rowspan'] = 1 + substr_count($l, '</td><td');
$tpl->set_ar_out($ar1,1);
}
##Hier wird die 2. Kategorie ausgegeben, am besten man nennt die Forum,
##da hier die Sachen für das Forum mit ausgegeben werden
elseif($tmenupos == 2){
$ar2 = array (
'JOINED' => date('d M Y',$row['regist']),
'LASTAK' => date('d M Y - H:i',$row['llogin']),
'POSTS' => $row['posts'],
'postpday' => $postpday,
'RANG' => userrang ($row['posts'],$uid),
'AVATA' => $avatar,
'NAME' => $row['name']
);
$ar2['profilefieldtitle'] = '<th class="ProfTitel" colspan="3"><b>'.$l1.'</b></th>';
$ar2['rowspan'] = 3 + substr_count($l, '</td><td');
$tpl->set_ar_out($ar2,2);
}
##Hier wird der Rest der Kategorien ausgegeben.
elseif($tmenupos != 0){
$ar3['profilefieldtitle'] = '<th class="ProfTitel" colspan="2"><b>'.$l1.'</b></th>';
$ar3['NAME'] = $row['name'];
$tpl->set_ar_out($ar3,3);
}
##Hier werden die Felder zu den Kategorien ausgegeben.
$tpl->set_out('profilefields',$l,4);
$design->footer();
}else{
#einlogen
$uid = $menu->get(2);
$title = $allgAr['title'].' :: Login';
$hmenu = $extented_forum_menu.'Login'.$extented_forum_menu_sufix;
$tpl = new tpl ( 'user/login.htm' );
if ( loggedin() ) {
$design = new design ( $title , $hmenu, 1);
$design->header();
if (isset($_POST['wdlink'])) { $wd = $_POST['wdlink']; }
else { $wd = 'index.php?user-details-'.$uid; }
wd ($wd, $lang['yourareloged']);
$design->footer();
} else {
$design = new design ( $title , $hmenu, 1, 'forum/index.htm' );
$design->header();
$tpl = new tpl ( 'user/login.htm' );
$tpl->set_out('WDLINK','index.php?user-details-'.$uid,0);
$design->footer();
}
}
?>
Zuletzt modifiziert von Requiem am 21.01.2013 - 23:55:15