Danke für die schnelle Antwort.
Nun will ich mal die freunde.php posten und die userdetails.php sowie dazugehörige html.
freunde.php aus dem Content Ordner
<?php
defined('main') or die('no direct access');
$title = $allgAr['title'].' :: Freunde';
$hmenu = 'Freunde';
$design = new design ( $title , $hmenu );
$design->header();
if (loggedin()) {
if (isset($_POST['sub'])) {
$name = escape($_POST['name'],'string');
$fid = db_result(db_query("SELECT id FROM prefix_user WHERE name = BINARY '".$name."'"),0);
if ($fid > 0 AND $fid != $_SESSION['authid'] AND db_num_rows(db_query("SELECT uid FROM prefix_friends WHERE fid = ".$fid."")) == 0) {
db_query('INSERT INTO prefix_friends (uid,fid) VALUES ('.$_SESSION['authid'].','.$fid.')');
$msg = '<b>Erfolgreich eingetragen.</font></b><br><br>';
} else {
$msg = '<b>Es ist Fehler beim Eintragen aufgetreten.</font></b><br><br>';
}
}
if (is_numeric($menu->get(1))) {
if ($fid > 0 AND $fid != $_SESSION['authid'] AND db_num_rows(db_query("SELECT uid FROM prefix_friends WHERE fid = ".$fid."")) == 0) {
db_query('INSERT INTO prefix_friends (uid,fid) VALUES ('.$_SESSION['authid'].','.$fid.')');
$msg = '<b>Erfolgreich eingetragen.</b></font><br><br>';
} else {
$msg = '<b>Es ist Fehler beim Eintragen aufgetreten.</b></font><br><br>';
}
}
echo $msg;
if ($menu->getA(1) == 'd') {
db_query("DELETE FROM prefix_friends WHERE uid = ".$_SESSION['authid']." AND fid = ".$menu->getE(1));
}
$tpl = new tpl('freunde');
$tpl->out(0);
$abf = db_query("SELECT fid FROM prefix_friends WHERE uid = ".$_SESSION['authid']."");
while ($row = db_fetch_assoc($abf)) {
$r['class'] = ($class=='Cmite'?'Cnorm':'Cmite');
$sql = db_query("SELECT id,name FROM prefix_user WHERE id = '".$row['fid']."'");
$rr = db_fetch_assoc($sql);
$r['name'] = '<a href="index.php?user-details-'.$rr['id'].'">'.$rr['name'].'</a>';
$r['aktfid'] = $row['fid'];
$tpl->set_ar_out($r,1);
}
$tpl->out(2);
$abf = db_query("SELECT uid FROM prefix_friends WHERE fid = ".$_SESSION['authid']."");
while ($row = db_fetch_assoc($abf)) {
$r['class'] = ($class=='Cmite'?'Cnorm':'Cmite');
$sql = db_query("SELECT id,name FROM prefix_user WHERE id = '".$row['uid']."'");
$rr = db_fetch_assoc($sql);
$r['name'] = '<a href="index.php?user-details-'.$rr['id'].'">'.$rr['name'].'</a>';
$r['aktfid'] = $row['fid'];
$tpl->set_ar_out($r,3);
}
$tpl->out(4);
} else {
echo '';
}
$design->footer();
?>
userdetails.php aus dem Content /user Ordner
<?php
# Copyright by: Manuel
# Support: www.ilch.de
defined ('main') or die ( 'no direct access' );
function get_userstatus ($uid) {
$dif = date('Y-m-d H:i:s', time() - 60);
$q = "SELECT COUNT(*) FROM prefix_online WHERE uid = '".$uid."' AND uptime > '".$dif."'";
$on = db_count_query($q);
if($on == 1){
$s = '<font size="+1">"Ich bin gerade in der Gildenhalle unterwegs."</font>';
} else {
$s = '<font size="+1">"Ich bin bald zurück."</font>';
}
return($s);
}
function get_user_age($datum){
$age = preg_split('/\-/', $datum);
$alter = date("Y",time())-$age[0];
if (mktime(0,0,0,date("m",time()),date("d",time()),date("Y",time())) < mktime(0,0,0,$age[1],$age[2],date("Y",time())))
$alter--;
$return = $datum == '0000-00-00' ? false : $alter;
return ($return);
}
$uid = intval($menu->get(2));
$profilefields = array();
$erg = db_query('SELECT `prefix_profilefields`.`show`, `prefix_userfields`.`val` FROM `prefix_userfields`
LEFT JOIN `prefix_profilefields` ON `prefix_profilefields`.`id` = `prefix_userfields`.`fid`
WHERE `uid` = '.$uid);
while($row = db_fetch_assoc($erg)) {
$profilefields[$row['show']] = $row['val'];
}
$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'].'" alt="Avatar" 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 ) );
$sexar = array ( 0 => $lang['itdoesntmatter'], 1 => $lang['male'], 2 => $lang['female'] );
$lastbes_anz = 5; //Bei höhere Anzahl muss ggf. in der Datenbank die Größe der Felder bzw der Typ geändert werden
if ($_SESSION['authid'] != $uid AND $_SESSION['authid'] != 0) {
$lb = db_fetch_object(db_query('SELECT last_bes, last_user_time FROM prefix_user WHERE id = '.$uid));
$lba = explode('#',$lb->last_bes);
$lbt = explode('#',$lb->last_user_time);
$i = array_search($_SESSION['authid'],$lba);
if ($i !== false) {
unset($lba[$i]); unset($lbt[$i]);
} elseif (count($lba) >= $lastbes_anz) {
$lba = array_slice($lba,0,$lastbes_anz-1);
$lbt = array_slice($lbt,0,$lastbes_anz-1);
}
array_unshift($lba,$_SESSION['authid']);
array_unshift($lbt,time());
$i_lb = implode('#',$lba);
$i_lbt = implode('#',$lbt);
db_query("UPDATE prefix_user SET last_bes = '$i_lb', last_user_time = '$i_lbt' WHERE id = $uid");
}
include('user_infos.php');
$ar = array (
'UID' => $uid,
'NAME' => $row['name'],
'JOINED' => date('d M Y',$row['regist']),
'LASTAK' => date('d M Y - H:i',$row['llogin']),
'POSTS' => $row['posts'],
'postpday' => $postpday,
'LASTUSER' => last_user($uid),
'RANG' => userrang ($row['posts'],$uid),
'AVATA' => $avatar,
'KLASSE' => $profilefields['Klasse'],
'CHARNAME' => $profilefields['CharName'],
'LIEBLINGSSPIELE' => $profilefields['Lieblingsspiele'],
'RASSE' => $profilefields['Rasse'],
'BERUF1' => $profilefields['Beruf1'],
'BERUF2' => $profilefields['Beruf2'],
'SKILLUNG' => $profilefields['Skillung'],
'TWINKS' => $profilefields['Twinks'],
'GILDE' => $profilefields['Gilde'],
'VORNAME' => $profilefields['Vorname'],
'SPIELERTITEL' => $profilefields['Spielertitel'],
'USERSTATUS' => get_userstatus($uid),
'UID' => $uid,
'LAND' => (!empty($row['staat']) && file_exists('include/images/flags/'.$row['staat']) ? '<img src="include/images/flags/'.$row['staat'].'" alt="'.$row['staat'].'" border="0" />' : '<img src="include/images/flags/na.gif" alt="" border="0" />' ),
'WOHNORT' => (!empty($row['wohnort']) ? $row['wohnort'] : 'einem geheimen Ort'),
'ALTER' => (get_user_age($row['gebdatum']) != FALSE ? get_user_age($row['gebdatum']).' Jahre' : ''),
'GBDATE' => ($row['gebdatum'] != '0000-00-00' ? $row['gebdatum'] : 'irgendwann'),
'SEX' => $sexar[$row['geschlecht']],
'SIG' => (!empty($row['sig']) ? BBcode($row['sig']) : ''),
);
$title = $allgAr['title'].' :: Users :: Details von '.$row['name'];
$hmenu = $extented_forum_menu.'<a class="smalfont" href="index.php?user">Users</a><b> » </b> Details von '.$row['name'].$extented_forum_menu_sufix;
$design = new design ( $title , $hmenu, 1);
$design->header();
$tpl = new tpl ( 'user/userdetails' );
$l = profilefields_show ( $uid );
$ar['rowspan'] = 4 + substr_count($l, '<tr><td class="');
$ar['profilefields'] = $l;
$tpl->set_ar_out($ar,0);
$design->footer();
?>
userdetails.htm
<style type="text/css">
div.bg11 {
background-image: url(../imgs/foren.jpg);
background-color:#D2BD99;
width:100px;height:130px;
border:0px solid #4F2700;
padding:0px;
}
</style>
<a href="javascript:history.back(1)"><b><font size="+1">«</b> {_lang_back}</font></a>
<br />
<br />
<table width="100%" cellpadding="5" cellspacing="1" class="border">
</tr><tr>
<td class="Cmite" width="30%">Nickname</td>
<td class="Cnorm" width="40%"><b>{NAME} {ALTER}</b> </td>
<td class="Cnorm" width="30%" rowspan="{rowspan}" valign="top" align="center">
<br><font color="#5C451B"><font size="3">{RANG}</font></font></i><br><br> <div class="bg11"><br><br>{AVATA}</div>
<button type="button" style="background-color: #625535; color: white ;width:190px ;font: bold 12px Arial" onFocus="if(this.blur) this.blur()" onclick="location.href='index.php?user-usergb-view-{UID}';" >{NAME}´s Gästebuch</button><br><br>
<button type="button" style="background-color: #917D4F; color: white ;width:190px ;font: bold 12px Arial" onFocus="if(this.blur) this.blur()" onclick="javascript:chatWith({UID},'{NAME}')">Livechat mit {NAME}</button><br>
</form></div>
<font class="smalfont"></font><br><br>
</td>
</tr><tr>
<td class="Cmite">{_lang_regsince}</td>
<td class="Cnorm">{JOINED}</td>
</tr><tr>
<td class="Cmite">{_lang_lastactivity}</td>
<td class="Cnorm">{LASTAK}</td>
</tr><tr>
<td class="Cmite">{_lang_posts2}</td>
<td class="Cnorm">{POSTS}, {_lang_perday}: {postpday}</td>
</tr>
{profilefields}
</table>
<br />
<table width="70%" cellpadding="20" cellspacing="1" class="border">
<tr class="Chead"><td class="Cmite" width="70%"><center>{SIG}</center></td></table></tr>
Ich hoffe ich hab an alles gedacht
Danke wenn wer das so hinbekommen kann.