Location: PHPKode > projects > PhpMyForum > phpmyforum_4_1_1/profile.php
<?php
define('PMF_INCLUDE', 1);
require('head.php');
require($_cfg['MAIN'].'/lib/post.inc.php');
access('profile');

//per ID
if (is_numeric($_GET['id'])) {
    $id = $_GET['id'];
} else {
    $id = user_id( urldecode( gpc_stripslashes($_GET['name'])));
}

// nicht gefunden !
if (!$id) msg('error_profile_fault', 'back()');


#
#
### Benutzer Daten
$userinfo = get_user_info($id);

// nicht gefunden !
if (!$userinfo['id']) msg('error_profile_fault', 'back()');


// Avatar
$avatar = avatar($userinfo['avatar'], $userinfo['avatar_size']);

// Reg. seit
$userinfo['reg_date'] = pmf_date($userinfo['reg']);

$userinfo['geb_format'] = pmf_birthday($userinfo['geb']);

// letzte aktion
$userinfo['last_action_date'] = pmf_date($userinfo['last_action']);
$userinfo['last_action_time'] = pmf_time($userinfo['last_action']);

// Status
$status = get_user_title($userinfo['group_id'], $userinfo['posts'], $userinfo['gender']);
$userinfo['status_stars'] = $status['filename'];
$userinfo['status_name'] = $status['name'];

// letztes Thema
$Topic = $_db->fetch_first('SELECT t.name, t.id, p.post_date
                            FROM `'.$_cfg['DB_PREFIX'].'topic` AS t, `'.$_cfg['DB_PREFIX'].'post` AS p
                            WHERE p.id = '.intval($userinfo['last_post']).'
                              AND p.topic_id = t.id
                              AND t.board_id IN ('.get_aviable_boards('topic').')');
$userinfo['lasttopic_id'] = $Topic['id'];
$userinfo['lasttopic_name'] = $Topic['name'];
$userinfo['lasttopic_date'] = pmf_date($Topic['post_date']);
$userinfo['lasttopic_time'] = pmf_time($Topic['post_date']);

// Gesamt Beitr�ge
$total = $_db->fetch_first('SELECT COUNT(*) AS anz FROM `'.$_cfg['DB_PREFIX'].'post`');
$userinfo['points_total'] = ($userinfo['posts'] && $total['anz']) ? round($userinfo['posts']*100 / $total['anz'], 2) : 0;

// Beitr�ge je Tag
$userinfo['rag_days'] = (time()-$userinfo['reg']) / 86400;
$userinfo['points_day'] = ($userinfo['posts'] && $userinfo['rag_days'] >= 1) ? round($userinfo['posts'] / $userinfo['rag_days'], 2) : number_format($userinfo['posts'], 2);

// Gruppen
$result = $_db->query('SELECT name FROM `'.$_cfg['DB_PREFIX'].'group` WHERE id IN ('.implode(',', $userinfo['access']['groups']).') ORDER BY name');
while ($Daten = $_db->fetch_array($result)) {
    $groups[] = $Daten['name'];
}
$groups = implode('<br />', $groups);

// variable Benutzerfelder
$result = $_db->query('SELECT f.`name_edit`, f.`name`
                       FROM `'.$_cfg['DB_PREFIX'].'user_field` AS f
                       WHERE f.`profile` = 1
                       ORDER BY f.`rang`');
$optional_fields = '';
while ($field = $_db->fetch_array($result)) {
    $optional_fields .= eval('return("'.$_style->get('profile_field_line').'");');
}

eval ('echo "'.$_style->get("profile").'";');
footer();
?>
Return current item: PhpMyForum