sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Querrie-Fehler', '', __LINE__, __FILE__, $sql);
}
$row = $db->sql_fetchrow($result);
if($userdata['user_id'] == $_GET['u'] OR $row['zaehle'] == "1")
{
$server_protocol = ($board_config['cookie_secure']) ? 'https://' : 'http://';
$server_name = preg_replace('#^\/?(.*?)\/?$#', '\1', trim($board_config['server_name']));
$server_port = ($board_config['server_port'] <> 80) ? ':' . trim($board_config['server_port']) : '';
$script_name = preg_replace('#^\/?(.*?)\/?$#', '\1', trim($board_config['script_path']));
$script_name = ($script_name == '') ? $script_name : '/' . $script_name;
$url = append_sid('nickpage.'.$phpEx.'?user='.$profiledata['username']);
$nickpage = '
';
}
else
{
$nickpage = 'nicht eingerichtet';
}
if (!$profiledata)
{
message_die(GENERAL_MESSAGE, $lang['No_user_id_specified']);
}
$sql = "SELECT *
FROM " . RANKS_TABLE . "
ORDER BY rank_special, rank_min";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain ranks information', '', __LINE__, __FILE__, $sql);
}
$ranksrow = array();
while ( $row = $db->sql_fetchrow($result) )
{
$ranksrow[] = $row;
}
$db->sql_freeresult($result);
//
// Output page header and profile_view template
//
$template->set_filenames(array(
'body' => 'profile_view_body.tpl')
);
make_jumpbox('viewforum.'.$phpEx);
//
// Calculate the number of days this user has been a member ($memberdays)
// Then calculate their posts per day
//
$regdate = $profiledata['user_regdate'];
$memberdays = max(1, round( ( time() - $regdate ) / 86400 ));
$posts_per_day = $profiledata['user_posts'] / $memberdays;
// Get the users percentage of total posts
if ( $profiledata['user_posts'] != 0 )
{
$total_posts = get_db_stat('postcount');
$percentage = ( $total_posts ) ? min(100, ($profiledata['user_posts'] / $total_posts) * 100) : 0;
}
else
{
$percentage = 0;
}
$avatar_img = '';
if ( $profiledata['user_avatar_type'] && $profiledata['user_allowavatar'] )
{
switch( $profiledata['user_avatar_type'] )
{
case USER_AVATAR_UPLOAD:
$avatar_img = ( $board_config['allow_avatar_upload'] ) ? '
' : '';
break;
case USER_AVATAR_REMOTE:
$avatar_img = ( $board_config['allow_avatar_remote'] ) ? '
' : '';
break;
case USER_AVATAR_GALLERY:
$avatar_img = ( $board_config['allow_avatar_local'] ) ? '
' : '';
break;
}
}
$poster_rank = '';
$rank_image = '';
if ( $profiledata['user_rank'] )
{
for($i = 0; $i < count($ranksrow); $i++)
{
if ( $profiledata['user_rank'] == $ranksrow[$i]['rank_id'] && $ranksrow[$i]['rank_special'] )
{
$poster_rank = $ranksrow[$i]['rank_title'];
$rank_image = ( $ranksrow[$i]['rank_image'] ) ? '
' : '';
}
}
}
else
{
for($i = 0; $i < count($ranksrow); $i++)
{
if ( $profiledata['user_posts'] >= $ranksrow[$i]['rank_min'] && !$ranksrow[$i]['rank_special'] )
{
$poster_rank = $ranksrow[$i]['rank_title'];
$rank_image = ( $ranksrow[$i]['rank_image'] ) ? '
' : '';
}
}
}
$temp_url = append_sid("privmsg.$phpEx?mode=post&" . POST_USERS_URL . "=" . $profiledata['user_id']);
$pm_img = '
';
$pm = '' . $lang['Send_private_message'] . '';
// Begin Map Mod
$sql = 'SELECT *
FROM ' . MAP_MOD_USER_TABLE . '
WHERE user_id='.$profiledata['user_id'];
if(!$map_result = $db->sql_query($sql))
{
message_die(GENERAL_ERROR, "Couldn't obtain map information.", "", __LINE__, __FILE__, $sql);
}
$map_row = $db->sql_fetchrow($map_result);
if ((intval($map_row['user_id'])<>0) && ((float)$map_row['longitude']<>0.0) && ((float)$map_row['latitude']<>0.0))
{
$map_highlight_id=$profiledata['user_id'];
$template->assign_block_vars('switch_user_map', array());
}
else
{
$map_highlight_id=0;
$template->assign_block_vars('switch_user_no_map', array());
}
$db->sql_freeresult($map_result);
// End Map Mod
if ( !empty($profiledata['user_viewemail']) || $userdata['user_level'] == ADMIN )
{
$email_uri = ( $board_config['board_email_form'] ) ? append_sid("profile.$phpEx?mode=email&" . POST_USERS_URL .'=' . $profiledata['user_id']) : 'mailto:' . $profiledata['user_email'];
$email_img = '
';
$email = '' . $lang['Send_email'] . '';
}
else
{
$email_img = ' ';
$email = ' ';
}
$www_img = ( $profiledata['user_website'] ) ? '
' : ' ';
$www = ( $profiledata['user_website'] ) ? '' . $profiledata['user_website'] . '' : ' ';
if ( !empty($profiledata['user_icq']) )
{
$icq_status_img = '
';
$icq_img = '
';
$icq = '' . $lang['ICQ'] . '';
}
else
{
$icq_status_img = ' ';
$icq_img = ' ';
$icq = ' ';
}
$aim_img = ( $profiledata['user_aim'] ) ? '
' : ' ';
$aim = ( $profiledata['user_aim'] ) ? '' . $lang['AIM'] . '' : ' ';
$msn_img = ( $profiledata['user_msnm'] ) ? $profiledata['user_msnm'] : ' ';
$msn = $msn_img;
$yim_img = ( $profiledata['user_yim'] ) ? '
' : '';
$yim = ( $profiledata['user_yim'] ) ? '' . $lang['YIM'] . '' : '';
$temp_url = append_sid("search.$phpEx?search_author=" . urlencode($profiledata['username']) . "&showresults=posts");
$search_img = '
';
$search = '' . sprintf($lang['Search_user_posts'], $profiledata['username']) . '';
//
if ( !$profiledata['user_allow_viewonline'] && $userdata['user_level'] == ADMIN || $profiledata['user_allow_viewonline'] )
{
$current_time = time();
$expiry_time = $current_time - 300;
if ( $profiledata['user_session_time'] >= $expiry_time )
{
$user_onlinestatus = '
';
if ( !$profiledata['user_allow_viewonline'] && $userdata['user_level'] == ADMIN )
{
$user_onlinestatus = '
';
}
}
else
{
$user_onlinestatus = '
';
if ( !$profiledata['user_allow_viewonline'] && $userdata['user_level'] == ADMIN )
{
$user_onlinestatus = '
';
}
}
}
else
{
$user_onlinestatus = '
';
}
//
//
// Generate page
//
$page_title = $lang['Viewing_profile'];
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
'U_NICKPAGE' => $nickpage,
if (function_exists('get_html_translation_table'))
{
$u_search_author = urlencode(strtr($profiledata['username'], array_flip(get_html_translation_table(HTML_ENTITIES))));
}
else
{
$u_search_author = urlencode(str_replace(array('&', ''', '"', '<', '>'), array('&', "'", '"', '<', '>'), $profiledata['username']));
}
$template->assign_vars(array(
'USERNAME' => $profiledata['username'],
'JOINED' => create_date($lang['DATE_FORMAT'], $profiledata['user_regdate'], $board_config['board_timezone']),
'LAST_ONLINE' => ( $profiledata['user_session_time'] != 0 ) ? create_date($lang['DATE_FORMAT'], $profiledata['user_session_time'], $board_config['board_timezone']) : $lang['no_logins_yet'],
'POSTER_RANK' => $poster_rank,
'RANK_IMAGE' => $rank_image,
'POSTS_PER_DAY' => $posts_per_day,
'POSTS' => $profiledata['user_posts'],
'PERCENTAGE' => $percentage . '%',
'POST_DAY_STATS' => sprintf($lang['User_post_day_stats'], $posts_per_day),
'POST_PERCENT_STATS' => sprintf($lang['User_post_pct_stats'], $percentage),
'SEARCH_IMG' => $search_img,
'SEARCH' => $search,
'PM_IMG' => $pm_img,
'PM' => $pm,
'EMAIL_IMG' => $email_img,
'EMAIL' => $email,
'WWW_IMG' => $www_img,
'WWW' => $www,
'ICQ_STATUS_IMG' => $icq_status_img,
'ICQ_IMG' => $icq_img,
'ICQ' => $icq,
'AIM_IMG' => $aim_img,
'AIM' => $aim,
'MSN_IMG' => $msn_img,
'MSN' => $msn,
'YIM_IMG' => $yim_img,
'YIM' => $yim,
// Begin Map Mod
'U_USER_MAP' => append_sid("map.$phpEx?highlight=".$map_highlight_id),
'L_USER_MAP' => $lang['map_show_user'],
// End Map Mod
'LOCATION' => ( $profiledata['user_from'] ) ? $profiledata['user_from'] : ' ',
'OCCUPATION' => ( $profiledata['user_occ'] ) ? $profiledata['user_occ'] : ' ',
'INTERESTS' => ( $profiledata['user_interests'] ) ? $profiledata['user_interests'] : ' ',
//
'USER_ONLINESTATUS' => $user_onlinestatus,
//
'AVATAR_IMG' => $avatar_img,
'L_VIEWING_PROFILE' => sprintf($lang['Viewing_user_profile'], $profiledata['username']),
'L_ABOUT_USER' => sprintf($lang['About_user'], $profiledata['username']),
'L_AVATAR' => $lang['Avatar'],
'L_POSTER_RANK' => $lang['Poster_rank'],
'L_JOINED' => $lang['Joined'],
'L_LAST_ONLINE' => $lang['last_online'],
'L_TOTAL_POSTS' => $lang['Total_posts'],
'L_SEARCH_USER_POSTS' => sprintf($lang['Search_user_posts'], $profiledata['username']),
'L_CONTACT' => $lang['Contact'],
'L_EMAIL_ADDRESS' => $lang['Email_address'],
'L_EMAIL' => $lang['Email'],
'L_PM' => $lang['Private_Message'],
'L_ICQ_NUMBER' => $lang['ICQ'],
'L_YAHOO' => $lang['YIM'],
'L_AIM' => $lang['AIM'],
'L_MESSENGER' => $lang['MSNM'],
'L_WEBSITE' => $lang['Website'],
'L_LOCATION' => $lang['Location'],
'L_OCCUPATION' => $lang['Occupation'],
'L_INTERESTS' => $lang['Interests'],
'U_SEARCH_USER' => append_sid("search.$phpEx?search_author=" . $u_search_author),
'S_PROFILE_ACTION' => append_sid("profile.$phpEx"))
);
$template->pparse('body');
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
?>