1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:
181:
182:
183:
184:
185:
186:
187:
188:
189:
190:
191:
192:
193:
194:
195:
196:
197:
198:
199:
200:
201:
202:
203:
204:
205:
206:
207:
208:
209:
210:
211:
212:
213:
214:
215:
216:
217:
218:
219:
220:
221:
222:
223:
224:
225:
226:
227:
228:
229:
230:
231:
232:
233:
234:
235:
236:
237:
238:
239:
240:
241:
242:
243:
244:
245:
246:
247:
248:
249:
250:
251:
252:
253:
254:
255:
256:
257:
258:
259:
260:
261:
262:
263:
264:
265:
266:
267:
268:
269:
270:
271:
272:
273:
274:
275:
276:
277:
278:
279:
280:
281:
282:
283:
284:
285:
286:
287:
288:
289:
290:
291:
292:
293:
294:
295:
296:
297:
298:
299:
300:
301:
302:
303:
304:
305:
306:
307:
308:
309:
310:
311:
312:
313:
314:
315:
316:
317:
318:
319:
320:
321:
322:
323:
324:
325:
326:
327:
328:
329:
330:
|
<?php
// ************************************************************************************//
// * WoltLab Burning Board 2
// ************************************************************************************//
// * Copyright (c) 2001-2004 WoltLab GmbH
// * Web http://www.woltlab.de/
// * License http://www.woltlab.de/products/burning_board/license_en.php
// * http://www.woltlab.de/products/burning_board/license.php
// ************************************************************************************//
// * WoltLab Burning Board 2 is NOT free software.
// * You may not redistribute this package or any of it's files.
// ************************************************************************************//
// * $Date: 2004-10-20 13:24:57 +0200 (Wed, 20 Oct 2004) $
// * $Author: Burntime $
// * $Rev: 1453 $
// ************************************************************************************//
$filename = 'profile.php';
require('./global.php');
require_once('./acp/lib/vghacks.inc.php');
if ($wbbuserdata['can_view_profile'] == 0) access_error();
require('./acp/lib/class_parse.php');
$lang->load('MEMBERS,THREAD');
$userid = intval($_GET['userid']);
$username = $_GET['username'];
if ( (!$userid) && ($username==""))
error ("Internal Error [0111471508] please report to gonz.");
// error($lang->get("LANG_GLOBAL_ERROR_FALSELINK", array('$adminmail' => $adminmail)));
if (!$userid)
{
$userid_info = $db->query_first("SELECT * FROM bb".$n."_users WHERE username='$username'");
$userid = $userid_info['userid'];
}
$user_info = $db->query_first("SELECT ".
"u.*, ".
"uf.*, ".
"r.rankimages, r.ranktitle, ".
"a.avatarextension, a.width, a.height, ".
"s.lastactivity AS s_lastactivity, s.boardid, s.threadid, s.request_uri ".
($showlanguageinprofile == 1 ? ", l.languagepackname " : "").
"FROM bb".$n."_users u ".
"LEFT JOIN bb".$n."_userfields uf USING (userid) ".
"LEFT JOIN bb".$n."_avatars a ON (a.avatarid=u.avatarid) ".
"LEFT JOIN bb".$n."_ranks r ON (r.rankid=u.rankid) ".
"LEFT JOIN bb".$n."_sessions s ON (s.userid=u.userid) ".
($showlanguageinprofile == 1 ? "LEFT JOIN bb".$n."_languagepacks l ON (l.languagepackid=u.langid) " : "").
"WHERE u.userid='$userid'");
if (!$user_info['userid']) error($lang->get("LANG_GLOBAL_ERROR_FALSELINK", array('$adminmail' => $adminmail)));
$user_info['username'] = htmlconverter($user_info['username']);
$lang->items['LANG_MEMBERS_PROFILE_TITLE'] = $lang->get("LANG_MEMBERS_PROFILE_TITLE", array('$username' => $user_info['username']));
/* regdate */
$regdate = formatdate($wbbuserdata['dateformat'], $user_info['regdate']);
/* last activity */
if ($user_info['invisible'] == 0 || $wbbuserdata['a_can_view_ghosts'] == 1) {
$la_date = formatdate($wbbuserdata['dateformat'], $user_info['lastactivity'], 1);
$la_time = formatdate($wbbuserdata['timeformat'], $user_info['lastactivity']);
}
else {
$la_date = $lang->items['LANG_MEMBERS_PROFILE_NODECLARATION'];
$la_time = '';
}
/* posts per day */
$regdays = (time() - $user_info['regdate']) / 86400;
if ($regdays < 1) $postperday = $user_info['userposts'];
else $postperday = $user_info['userposts'] / $regdays;
$postperday = number_format($postperday, 2, $lang->get("LANG_GLOBAL_DEC_POINT"), $lang->get("LANG_GLOBAL_THOUSANDS_SEP"));
$lang->items['LANG_MEMBERS_PROFILE_POSTSPERDAY'] = $lang->get("LANG_MEMBERS_PROFILE_POSTSPERDAY", array('$postperday' => $postperday));
/* usertext */
if ($user_info['usertext']) $user_text = nl2br(htmlconverter(textwrap($user_info['usertext'], 40)));
else $user_text = '';
/* Gender Mod by CSchulle & edit fürs Board2.3 by Yve*/
if($user_info['gender']) {
if($user_info['gender']==1) eval ("\$gender = \"".$lang->get4eval("LANG_MEMBERS_PROFILE_MALE")."\";");
if($user_info['gender']==2) eval ("\$gender = \"".$lang->get4eval("LANG_MEMBERS_PROFILE_FEMALE")."\";");
if($user_info['gender']==3) eval ("\$gender = \"".$lang->get4eval("LANG_MEMBERS_PROFILE_PAAR")."\";");
if($user_info['gender']==4) eval ("\$gender = \"".$lang->get4eval("LANG_MEMBERS_PROFILE_TV_TS")."\";");
if($user_info['gender']==0) eval ("\$gender = \"".$lang->get4eval("LANG_MEMBERS_PROFILE_NODECLARATION")."\";");
}
/* usertitle */
if ($user_info['title']) $user_info['ranktitle'] = htmlconverter($user_info['title']);
else $user_info['ranktitle'] = getlangvar($user_info['ranktitle'], $lang);
$rankimages = formatRI($user_info['rankimages']);
/* avatar */
if ($user_info['avatarid'] && $showavatar == 1 && $wbbuserdata['showavatars'] == 1) {
$avatarname = "images/avatars/avatar-$user_info[avatarid].".htmlconverter($user_info['avatarextension']);
$avatarwidth = $user_info['width'];
$avatarheight = $user_info['height'];
if ($user_info['avatarextension'] == "swf" && $allowflashavatar == 1) {
eval("\$useravatar = \"".$tpl->get("avatar_flash")."\";");
}
elseif ($user_info['avatarextension'] != "swf") eval("\$useravatar = \"".$tpl->get("avatar_image")."\";");
}
/* useremail */
if ($user_info['showemail'] == 1) {
$user_info['email'] = getASCIICodeString($user_info['email']);
$useremail = makehreftag("mailto:".$user_info['email'], $user_info['email']);
}
else $useremail = $lang->items['LANG_MEMBERS_PROFILE_NODECLARATION'];
/* homepage */
if ($user_info['homepage']) {
$user_info['homepage'] = htmlconverter($user_info['homepage']);
$userhomepage = makehreftag($user_info['homepage'], $user_info['homepage'], "_blank");
}
else $userhomepage = $lang->items['LANG_MEMBERS_PROFILE_NODECLARATION'];
/* icq, aim, yim, msn */
if (!$user_info['icq']) $user_info['icq'] = $lang->items['LANG_MEMBERS_PROFILE_NODECLARATION'];
if (!$user_info['aim']) $user_info['aim'] = $lang->items['LANG_MEMBERS_PROFILE_NODECLARATION'];
else $user_info['aim'] = htmlconverter($user_info['aim']);
if (!$user_info['yim']) $user_info['yim'] = $lang->items['LANG_MEMBERS_PROFILE_NODECLARATION'];
else $user_info['yim'] = htmlconverter($user_info['yim']);
if (!$user_info['msn']) $user_info['msn'] = $lang->items['LANG_MEMBERS_PROFILE_NODECLARATION'];
else $user_info['msn'] = htmlconverter($user_info['msn']);
/* birthday */
if ($user_info['birthday'] && $user_info['birthday'] != '0000-00-00') {
$birthday_array = explode('-', $user_info['birthday']);
if ($birthday_array[0] == '0000') $birthday = $birthday_array[2].".".$birthday_array[1].".";
else $birthday = $birthday_array[2].".".$birthday_array[1].".".$birthday_array[0];
}
else $birthday = $lang->items['LANG_MEMBERS_PROFILE_NODECLARATION'];
/* profilefields */
$profilefields = '';
$result = $db->unbuffered_query("SELECT profilefieldid, title, fieldtype FROM bb".$n."_profilefields".(($wbbuserdata['a_can_view_hidden'] == 0) ? (" WHERE hidden=0") : (""))." ORDER BY fieldorder ASC");
while ($row = $db->fetch_array($result)) {
$fieldid = "field".$row['profilefieldid'];
if (!$user_info[$fieldid] || $user_info[$fieldid] == "0000-00-00") $user_info[$fieldid] = $lang->items['LANG_MEMBERS_PROFILE_NODECLARATION'];
else {
if ($row['fieldtype'] == "multiselect") $user_info[$fieldid] = htmlconverter(textwrap(str_replace("\n", "; ", $user_info[$fieldid]), 50));
elseif ($row['fieldtype'] == "date") {
$row_datearray = explode("-", $user_info[$fieldid]);
if ($row_datearray[0] == "0000") $user_info[$fieldid] = $row_datearray[2].".".$row_datearray[1].".";
else $user_info[$fieldid] = $row_datearray[2].".".$row_datearray[1].".".$row_datearray[0];
}
else $user_info[$fieldid] = htmlconverter(textwrap($user_info[$fieldid], 50));
}
$row['title'] = getlangvar($row['title'], $lang);
eval("\$profilefields .= \"".$tpl->get("profile_userfield")."\";");
}
/* users lastpost */
$showlastpost = 0;
if ($showlastpostinprofile == 1 && $wbbuserdata['can_enter_board'] == 1) {
$boardids = '';
$permissioncache = getPermissions();
$result = $db->unbuffered_query("SELECT boardid, password, invisible FROM bb".$n."_boards");
while ($row = $db->fetch_array($result)) {
if ($row['password'] != '' || $row['invisible'] == 2) continue;
if (!isset($permissioncache[$row['boardid']]['can_enter_board']) || $permissioncache[$row['boardid']]['can_enter_board'] != 0) $boardids .= ",".$row['boardid'];
}
if ($boardids != '') {
$lastpost = $db->query_first("SELECT p.postid, p.posttime, t.topic, t.boardid, b.title FROM bb".$n."_posts p, bb".$n."_threads t
LEFT JOIN bb".$n."_boards b ON (t.boardid=b.boardid)
WHERE p.threadid=t.threadid AND t.boardid IN (0$boardids) AND p.userid = '$userid' AND p.visible=1
ORDER BY p.posttime DESC", 1);
if ($lastpost['postid']) {
$lastpostdate = formatdate($wbbuserdata['dateformat'], $lastpost['posttime'], 1);
$lastposttime = formatdate($wbbuserdata['timeformat'], $lastpost['posttime']);
$lastpost['topic'] = htmlconverter(textwrap($lastpost['topic']));
$lastpost['title'] = getlangvar($lastpost['title'], $lang);
$showlastpost = 1;
}
}
}
/* buttons for search, buddy, pm, email */
$username = $user_info['username'];
$lang->items['LANG_MEMBERS_SEARCH'] = $lang->get("LANG_MEMBERS_SEARCH", array('$username' => $username));
$lang->items['LANG_MEMBERS_BUDDY'] = $lang->get("LANG_MEMBERS_BUDDY", array('$username' => $username));
if ($user_info['receivepm'] == 1 && $wbbuserdata['can_use_pms'] == 1) $lang->items['LANG_MEMBERS_PM'] = $lang->get("LANG_MEMBERS_PM", array('$username' => $username));
if ($user_info['showemail'] == 0 && $user_info['usercanemail'] == 1) $lang->items['LANG_MEMBERS_SENDEMAIL'] = $lang->get("LANG_MEMBERS_SENDEMAIL", array('$username' => $username));
/* user online */
if (($user_info['invisible'] == 0 || $wbbuserdata['a_can_view_ghosts'] == 1) && $user_info['lastactivity'] >= time() - $useronlinetimeout * 60) {
$user_online = 1;
$lang->items['LANG_MEMBERS_USERONLINE'] = $lang->get("LANG_MEMBERS_USERONLINE", array('$username' => $username));
}
else {
$user_online = 0;
$lang->items['LANG_MEMBERS_USEROFFLINE'] = $lang->get("LANG_MEMBERS_USEROFFLINE", array('$username' => $username));
}
/* wiw */
$userlocation = '';
if ($showuserlocation == 1 && $user_info['s_lastactivity'] >= (time() - 60 * $useronlinetimeout)) {
include('./acp/lib/class_useronline.php');
include('./acp/lib/class_wiw.php');
$lang->load('WIW');
$wiw = &new WIW($wbbuserdata['a_can_view_ghosts']);
$wiw->insert($user_info);
$wiw->cache();
if ($row = $wiw->get()) $userlocation = $row['location'];
}
/* userrating */
if ($userratings == 1) $userrating = userrating($user_info['ratingcount'], $user_info['ratingpoints'], $user_info['userid']);
else $userrating = '';
/* userlevel */
if ($userlevels == 1) $userlevel = userlevel($user_info['userposts'], $user_info['regdate']);
else $userlevel = '';
if ($user_info['userposts'] >= 1000) $user_info['userposts'] = number_format($user_info['userposts'], 0, "", $lang->get("LANG_GLOBAL_THOUSANDS_SEP"));
/* languagepack */
if ($showlanguageinprofile == 1) {
$languagepackname = getlangvar($user_info['languagepackname'], $lang);
}
else $languagepackname = '';
/* VGProfil Galerie by Viktor */
$vgpgal_anz = 0;
$bild = '';
$bildmid = '';
if($wbbuserdata['can_show_vgprofil_gal']==1) {
list($vgpgal_anz) = $db->query_first("SELECT count(id) FROM bb".$n."_vgprofil_gal_user_bilder WHERE userid = '".$user_info['userid']."'");
if($vgpgal_anz!=0) {
$vgprofilgal_anz = '';
$lang->items['LANG_MEMBERS_PROFILE_VGPROFIL_GAL_USTAT_EINZEL'] = $lang->get("LANG_MEMBERS_PROFILE_VGPROFIL_GAL_USTAT_EINZEL", array('$vgprofilgal_ustat' => $vgpgal_anz));
$lang->items['LANG_MEMBERS_PROFILE_VGPROFIL_GAL_USTAT_MEHR'] = $lang->get("LANG_MEMBERS_PROFILE_VGPROFIL_GAL_USTAT_MEHR", array('$vgprofilgal_ustat' => $vgpgal_anz));
if($vgpgal_anz==1) $vgprofilgal_anz = $lang->items['LANG_MEMBERS_PROFILE_VGPROFIL_GAL_USTAT_EINZEL'];
else $vgprofilgal_anz = $lang->items['LANG_MEMBERS_PROFILE_VGPROFIL_GAL_USTAT_MEHR'];
/* Profilbild holen */
$prof_info = $db->query_first("SELECT * FROM bb".$n."_vgprofil_gal_user_bilder WHERE userid = '".$user_info['userid']."' AND defau = '1'");
if($prof_info['id']) {
$id = $prof_info['id'];
$vgprofilwidth = $prof_info['owidth'] + 60;
$vgprofilheight = $prof_info['oheight'] + 100;
eval ("\$bildmid = \"".$tpl->get("vgprofil_gal_pic_show_mid")."\";");
}
/* Anzahl der freigegebenen Bilder ermitteln */
list($bildercount) = $db->query_first("SELECT count(u.id)
FROM bb".$n."_vgprofil_gal_user_bilder u
LEFT JOIN bb".$n."_vgprofil_gal_user_frei uf USING (id)
WHERE u.userid = '".$user_info['userid']."' AND u.frei = '1' AND u.defau = '0'
OR ( u.userid = '".$user_info['userid']."' AND uf.id = u.id AND uf.userid = '".$wbbuserdata['userid']."')");
/* Wie viele Bilder auf einer Seite */
list($bilderperpage) = $db->query_first("SELECT config_value FROM bb".$n."_vgprofil_gal_config WHERE config_name = 'anzahl_prof'");
if(isset($_REQUEST['page'])){
$page = intval($_REQUEST['page']);
if($page == "0") $page = "1";
}
else $page = "1";
$pages = ceil($bildercount / $bilderperpage);
$result = $db->query("SELECT u.* FROM bb".$n."_vgprofil_gal_user_bilder u
LEFT JOIN bb".$n."_vgprofil_gal_user_frei uf USING (id)
WHERE u.userid = '".$user_info['userid']."' AND u.frei = '1' AND u.defau = '0'
OR ( u.userid = '".$user_info['userid']."' AND uf.id = u.id AND uf.userid = '".$wbbuserdata['userid']."' ) ORDER by u.datum ASC",$bilderperpage,$bilderperpage*($page-1));
while($row=$db->fetch_array($result)) {
$id = $row['id'];
$vgprofilwidth = $row['owidth'] + 60;
$vgprofilheight = $row['oheight'] + 100;
eval ("\$bild .= \"".$tpl->get("vgprofil_gal_pic_show_thumbnail")."\";");
}
if($bildercount) $countfrom = 1+$bilderperpage*($page-1);
else $countfrom=0;
$countto = $bilderperpage*$page;
if($countto > $bildercount) $countto = $bildercount;
if($pages > 1) $pagelink = makepagelink_pgal("profile.php?userid=$userid$SID_ARG_2ND",$page,$pages,2);
}
}
/* VGProfil Galerie by Viktor */
// ### Begin User-Pic by Viktor
if($wbbuserdata['can_use_userpicupload_show']) {
$ownuserpic = $db->query_first("SELECT userpicid, userpicextension, width, height, freis FROM bb".$n."_userpic WHERE userid = '".$userid."'");
if ($ownuserpic['userpicid']) {
if($ownuserpic['freis']=='0') {
$lang->load('USERCP');
$userpicid = $ownuserpic['userpicid'];
$userpicname = "userpic/userpic-".$ownuserpic['userpicid'].".".$ownuserpic['userpicextension'];
if($ownuserpic['width']>$wbbuserdata['max_avatar_width'] && $ownuserpic['height']>$wbbuserdata['max_avatar_height']) {
$userpicwidth = $wbbuserdata['max_avatar_width'];
$userpicheight = $wbbuserdata['max_avatar_height'];
} else {
$userpicwidth = $ownuserpic['width'];
$userpicheight = $ownuserpic['height'];
}
$userpicwidth_pop = 640;
$userpicheight_pop = 480;
if ($ownuserpic['userpicextension'] == "swf") {
eval("\$userpic_ausgabe = \"".$tpl->get("userpic_flash")."\";");
}
elseif ($ownuserpic['userpicextension'] != "swf") eval("\$userpic_ausgabe = \"".$tpl->get("userpic_image")."\";");
eval("\$userpicausgabe = \"".$tpl->get("userpic_profile")."\";");
eval("\$userpicausgabe_text = \"".$tpl->get("userpic_profile_text")."\";");
}
}
}
// ### End User-Pic by Viktor
eval("\$tpl->output(\"".$tpl->get("profile")."\");");
?> |