Verzeichnisstruktur phpBB-2.0.0
- Veröffentlicht
- 03.04.2002
So funktioniert es
|
Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück |
Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis. |
|
(Beispiel Datei-Icons)
|
Auf das Icon klicken um den Quellcode anzuzeigen |
usercp_viewprofile.php
001 <?php
002 /***************************************************************************
003 * usercp_viewprofile.php
004 * -------------------
005 * begin : Saturday, Feb 13, 2001
006 * copyright : (C) 2001 The phpBB Group
007 * email : support@phpbb.com
008 *
009 * $Id$
010 *
011 *
012 ***************************************************************************/
013
014 /***************************************************************************
015 *
016 * This program is free software; you can redistribute it and/or modify
017 * it under the terms of the GNU General Public License as published by
018 * the Free Software Foundation; either version 2 of the License, or
019 * (at your option) any later version.
020 *
021 *
022 ***************************************************************************/
023
024 if ( !defined('IN_PHPBB') )
025 {
026 die("Hacking attempt");
027 exit;
028 }
029
030 if ( empty($HTTP_GET_VARS[POST_USERS_URL]) || $HTTP_GET_VARS[POST_USERS_URL] == ANONYMOUS )
031 {
032 message_die(GENERAL_MESSAGE, $lang['No_user_id_specified']);
033 }
034 $profiledata = get_userdata($HTTP_GET_VARS[POST_USERS_URL]);
035
036 if (!$profiledata)
037 {
038 message_die(GENERAL_MESSAGE, $lang['No_user_id_specified']);
039 }
040
041 $sql = "SELECT *
042 FROM " . RANKS_TABLE . "
043 ORDER BY rank_special, rank_min";
044 if ( !($result = $db->sql_query($sql)) )
045 {
046 message_die(GENERAL_ERROR, 'Could not obtain ranks information', '', __LINE__, __FILE__, $sql);
047 }
048
049 $ranksrow = array();
050 while ( $row = $db->sql_fetchrow($result) )
051 {
052 $ranksrow[] = $row;
053 }
054 $db->sql_freeresult($result);
055
056 //
057 // Output page header and profile_view template
058 //
059 $template->set_filenames(array(
060 'body' => 'profile_view_body.tpl')
061 );
062 make_jumpbox('viewforum.'.$phpEx);
063
064 //
065 // Calculate the number of days this user has been a member ($memberdays)
066 // Then calculate their posts per day
067 //
068 $regdate = $profiledata['user_regdate'];
069 $memberdays = max(1, round( ( time() - $regdate ) / 86400 ));
070 $posts_per_day = $profiledata['user_posts'] / $memberdays;
071
072 // Get the users percentage of total posts
073 if ( $profiledata['user_posts'] != 0 )
074 {
075 $total_posts = get_db_stat('postcount');
076 $percentage = ( $total_posts ) ? min(100, ($profiledata['user_posts'] / $total_posts) * 100) : 0;
077 }
078 else
079 {
080 $percentage = 0;
081 }
082
083 $avatar_img = '';
084 if ( $profiledata['user_avatar_type'] && $profiledata['user_allowavatar'] )
085 {
086 switch( $profiledata['user_avatar_type'] )
087 {
088 case USER_AVATAR_UPLOAD:
089 $avatar_img = ( $board_config['allow_avatar_upload'] ) ? '<img src="' . $board_config['avatar_path'] . '/' . $profiledata['user_avatar'] . '" alt="" border="0" />' : '';
090 break;
091 case USER_AVATAR_REMOTE:
092 $avatar_img = ( $board_config['allow_avatar_remote'] ) ? '<img src="' . $profiledata['user_avatar'] . '" alt="" border="0" />' : '';
093 break;
094 case USER_AVATAR_GALLERY:
095 $avatar_img = ( $board_config['allow_avatar_local'] ) ? '<img src="' . $board_config['avatar_gallery_path'] . '/' . $profiledata['user_avatar'] . '" alt="" border="0" />' : '';
096 break;
097 }
098 }
099
100 $poster_rank = '';
101 $rank_image = '';
102 if ( $profiledata['user_rank'] )
103 {
104 for($i = 0; $i < count($ranksrow); $i++)
105 {
106 if ( $profiledata['user_rank'] == $ranksrow[$i]['rank_id'] && $ranksrow[$i]['rank_special'] )
107 {
108 $poster_rank = $ranksrow[$i]['rank_title'];
109 $rank_image = ( $ranksrow[$i]['rank_image'] ) ? '<img src="' . $ranksrow[$i]['rank_image'] . '" alt="' . $poster_rank . '" title="' . $poster_rank . '" border="0" /><br />' : '';
110 }
111 }
112 }
113 else
114 {
115 for($i = 0; $i < count($ranksrow); $i++)
116 {
117 if ( $profiledata['user_posts'] >= $ranksrow[$i]['rank_min'] && !$ranksrow[$i]['rank_special'] )
118 {
119 $poster_rank = $ranksrow[$i]['rank_title'];
120 $rank_image = ( $ranksrow[$i]['rank_image'] ) ? '<img src="' . $ranksrow[$i]['rank_image'] . '" alt="' . $poster_rank . '" title="' . $poster_rank . '" border="0" /><br />' : '';
121 }
122 }
123 }
124
125 $temp_url = append_sid("privmsg.$phpEx?mode=post&" . POST_USERS_URL . "=" . $profiledata['user_id']);
126 $pm_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_pm'] . '" alt="' . $lang['Send_private_message'] . '" title="' . $lang['Send_private_message'] . '" border="0" /></a>';
127 $pm = '<a href="' . $temp_url . '">' . $lang['Send_private_message'] . '</a>';
128
129 if ( !empty($profiledata['user_viewemail']) || $userdata['user_level'] == ADMIN )
130 {
131 $email_uri = ( $board_config['board_email_form'] ) ? append_sid("profile.$phpEx?mode=email&" . POST_USERS_URL .'=' . $profiledata['user_id']) : 'mailto:' . $profiledata['user_email'];
132
133 $email_img = '<a href="' . $email_uri . '"><img src="' . $images['icon_email'] . '" alt="' . $lang['Send_email'] . '" title="' . $lang['Send_email'] . '" border="0" /></a>';
134 $email = '<a href="' . $email_uri . '">' . $lang['Send_email'] . '</a>';
135 }
136 else
137 {
138 $email_img = ' ';
139 $email = ' ';
140 }
141
142 $www_img = ( $profiledata['user_website'] ) ? '<a href="' . $profiledata['user_website'] . '" target="_userwww"><img src="' . $images['icon_www'] . '" alt="' . $lang['Visit_website'] . '" title="' . $lang['Visit_website'] . '" border="0" /></a>' : ' ';
143 $www = ( $profiledata['user_website'] ) ? '<a href="' . $profiledata['user_website'] . '" target="_userwww">' . $profiledata['user_website'] . '</a>' : ' ';
144
145 if ( !empty($profiledata['user_icq']) )
146 {
147 $icq_status_img = '<a href="http://wwp.icq.com/' . $profiledata['user_icq'] . '#pager"><img src="http://web.icq.com/whitepages/online?icq=' . $profiledata['user_icq'] . '&img=5" width="18" height="18" border="0" /></a>';
148 $icq_img = '<a href="http://wwp.icq.com/scripts/search.dll?to=' . $profiledata['user_icq'] . '"><img src="' . $images['icon_icq'] . '" alt="' . $lang['ICQ'] . '" title="' . $lang['ICQ'] . '" border="0" /></a>';
149 $icq = '<a href="http://wwp.icq.com/scripts/search.dll?to=' . $profiledata['user_icq'] . '">' . $lang['ICQ'] . '</a>';
150 }
151 else
152 {
153 $icq_status_img = ' ';
154 $icq_img = ' ';
155 $icq = ' ';
156 }
157
158 $aim_img = ( $profiledata['user_aim'] ) ? '<a href="aim:goim?screenname=' . $profiledata['user_aim'] . '&message=Hello+Are+you+there?"><img src="' . $images['icon_aim'] . '" alt="' . $lang['AIM'] . '" title="' . $lang['AIM'] . '" border="0" /></a>' : ' ';
159 $aim = ( $profiledata['user_aim'] ) ? '<a href="aim:goim?screenname=' . $profiledata['user_aim'] . '&message=Hello+Are+you+there?">' . $lang['AIM'] . '</a>' : ' ';
160
161 $msn_img = ( $profiledata['user_msnm'] ) ? $profiledata['user_msnm'] : ' ';
162 $msn = $msn_img;
163
164 $yim_img = ( $profiledata['user_yim'] ) ? '<a href="http://edit.yahoo.com/config/send_webmesg?.target=' . $profiledata['user_yim'] . '&.src=pg"><img src="' . $images['icon_yim'] . '" alt="' . $lang['YIM'] . '" title="' . $lang['YIM'] . '" border="0" /></a>' : '';
165 $yim = ( $profiledata['user_yim'] ) ? '<a href="http://edit.yahoo.com/config/send_webmesg?.target=' . $profiledata['user_yim'] . '&.src=pg">' . $lang['YIM'] . '</a>' : '';
166
167 $temp_url = append_sid("search.$phpEx?search_author=" . urlencode($profiledata['username']) . "&showresults=posts");
168 $search_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_search'] . '" alt="' . sprintf($lang['Search_user_posts'], $profiledata['username']) . '" title="' . sprintf($lang['Search_user_posts'], $profiledata['username']) . '" border="0" /></a>';
169 $search = '<a href="' . $temp_url . '">' . sprintf($lang['Search_user_posts'], $profiledata['username']) . '</a>';
170
171 //
172 // Generate page
173 //
174 $page_title = $lang['Viewing_profile'];
175 include($phpbb_root_path . 'includes/page_header.'.$phpEx);
176
177 if (function_exists('get_html_translation_table'))
178 {
179 $u_search_author = urlencode(strtr($profiledata['username'], array_flip(get_html_translation_table(HTML_ENTITIES))));
180 }
181 else
182 {
183 $u_search_author = urlencode(str_replace(array('&', ''', '"', '<', '>'), array('&', "'", '"', '<', '>'), $profiledata['username']));
184 }
185
186 $template->assign_vars(array(
187 'USERNAME' => $profiledata['username'],
188 'JOINED' => create_date($lang['DATE_FORMAT'], $profiledata['user_regdate'], $board_config['board_timezone']),
189 'POSTER_RANK' => $poster_rank,
190 'RANK_IMAGE' => $rank_image,
191 'POSTS_PER_DAY' => $posts_per_day,
192 'POSTS' => $profiledata['user_posts'],
193 'PERCENTAGE' => $percentage . '%',
194 'POST_DAY_STATS' => sprintf($lang['User_post_day_stats'], $posts_per_day),
195 'POST_PERCENT_STATS' => sprintf($lang['User_post_pct_stats'], $percentage),
196
197 'SEARCH_IMG' => $search_img,
198 'SEARCH' => $search,
199 'PM_IMG' => $pm_img,
200 'PM' => $pm,
201 'EMAIL_IMG' => $email_img,
202 'EMAIL' => $email,
203 'WWW_IMG' => $www_img,
204 'WWW' => $www,
205 'ICQ_STATUS_IMG' => $icq_status_img,
206 'ICQ_IMG' => $icq_img,
207 'ICQ' => $icq,
208 'AIM_IMG' => $aim_img,
209 'AIM' => $aim,
210 'MSN_IMG' => $msn_img,
211 'MSN' => $msn,
212 'YIM_IMG' => $yim_img,
213 'YIM' => $yim,
214
215 'LOCATION' => ( $profiledata['user_from'] ) ? $profiledata['user_from'] : ' ',
216 'OCCUPATION' => ( $profiledata['user_occ'] ) ? $profiledata['user_occ'] : ' ',
217 'INTERESTS' => ( $profiledata['user_interests'] ) ? $profiledata['user_interests'] : ' ',
218 'AVATAR_IMG' => $avatar_img,
219
220 'L_VIEWING_PROFILE' => sprintf($lang['Viewing_user_profile'], $profiledata['username']),
221 'L_ABOUT_USER' => sprintf($lang['About_user'], $profiledata['username']),
222 'L_AVATAR' => $lang['Avatar'],
223 'L_POSTER_RANK' => $lang['Poster_rank'],
224 'L_JOINED' => $lang['Joined'],
225 'L_TOTAL_POSTS' => $lang['Total_posts'],
226 'L_SEARCH_USER_POSTS' => sprintf($lang['Search_user_posts'], $profiledata['username']),
227 'L_CONTACT' => $lang['Contact'],
228 'L_EMAIL_ADDRESS' => $lang['Email_address'],
229 'L_EMAIL' => $lang['Email'],
230 'L_PM' => $lang['Private_Message'],
231 'L_ICQ_NUMBER' => $lang['ICQ'],
232 'L_YAHOO' => $lang['YIM'],
233 'L_AIM' => $lang['AIM'],
234 'L_MESSENGER' => $lang['MSNM'],
235 'L_WEBSITE' => $lang['Website'],
236 'L_LOCATION' => $lang['Location'],
237 'L_OCCUPATION' => $lang['Occupation'],
238 'L_INTERESTS' => $lang['Interests'],
239
240 'U_SEARCH_USER' => append_sid("search.$phpEx?search_author=" . $u_search_author),
241
242 'S_PROFILE_ACTION' => append_sid("profile.$phpEx"))
243 );
244
245 $template->pparse('body');
246
247 include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
248
249 ?>