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:
|
<?php
$filename="profile.php";
require("./global.php");
if($wbbuserdata['canviewprofile']==0) access_error();
require_once("./acp/lib/class_parse.php");
$userid=intval($_GET['userid']);
if(!$userid) eval("error(\"".$tpl->get("error_falselink")."\");");
$user_info = $db->query_first("SELECT
u.*,
uf.*,
r.rankimages, r.ranktitle,
a.avatarextension, a.width, a.height
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)
WHERE u.userid='$userid'");
if(!$user_info['userid']) eval("error(\"".$tpl->get("error_falselink")."\");");
$regdate = formatdate($dateformat,$user_info['regdate']);
$regdays_anz = round((time() - $user_info['regdate']) / 86400,0);
if($regdays_anz < 1) {
$regdays_anz = "1";
$daydays = "Tag";
}
if($regdays_anz == 1) {
$daydays = "Tag";
} else {
$daydays = "Tage";
}
$la_d = formatdate($dateformat,$user_info['lastactivity'],1);
$la_t = formatdate($timeformat,$user_info['lastactivity']);
if ($regdays < 1) $bytesperday = "$countbytes";
else $bytesperday = sprintf("%.2f",($countbytes / $regdays));
list($countbytes)=$db->query_first("SELECT sum(length(message)) as lang FROM bb".$n."_posts WHERE userid='$userid'");
if ($countbytes) $laengepost = $countbytes;
else $laengepost = '0';
if ($countbytes["durch"]) $bytespost = $countbytes["durch"];
else $bytespost = '0';
if ($countbytes)
{
$countdays = ((time()-$user_info[regdate])/86400);
if ($countdays <1) $countdays = 1;
$bytesday = round($countbytes/$countdays,2);
}
else $bytesday = '0';
if ($user_info[userposts] >0)
{
$bytesbeitrag = round($countbytes/$user_info[userposts],2);
}
else $bytesbeitrag = '0';
$posts['userid'] = $user_info['userid'];
$posts['username'] = $user_info['username'];
$totalposts = $db->query_first("SELECT COUNT(*) AS posts FROM bb".$n."_posts");
$prozposts = round($user_info[userposts] / $totalposts[posts] * 100,2);
$totalthreads = $db->query_first("SELECT COUNT(*) AS threads FROM bb".$n."_threads");
$user = $db->query_first("SELECT COUNT(*) AS threads FROM bb".$n."_threads WHERE starterid = '$user_info[userid]'");
$prozthreads = round($user[threads] / $totalthreads[threads] * 100,2);
if(($user_info['invisible']==0 || $wbbuserdata['canuseacp']==1) && $user_info['lastactivity']>=time()-$useronlinetimeout*60) eval ("\$user_online = \"".$tpl->get("thread_user_online")."\";");
else eval ("\$user_online = \"".$tpl->get("thread_user_offline")."\";");
$regdays = (time() - $user_info[regdate]) / 86400;
if ($regdays < 1) $postperday = "$user_info[userposts]";
else $postperday = sprintf("%.2f",($user_info['userposts'] / $regdays));
if ($regdays < 1) $threadperday = "$user[threads]";
else $threadperday = sprintf("%.2f",($user['threads'] / $regdays));
if($user_info['usertext']) $user_text=parse::textwrap($user_info['usertext'],40);
if($user_info['gender']) {
if($user_info['gender']==1) eval ("\$gender = \"".$tpl->get("profile_male")."\";");
else eval ("\$gender = \"".$tpl->get("profile_female")."\";");
}
else eval ("\$gender = \"".$tpl->get("profile_nodeclaration")."\";");
if($user_info['title']) $user_info['ranktitle']=$user_info['title'];
$rankimages=formatRI($user_info['rankimages']);
if($user_info['avatarid'] && $showavatar==1 && $wbbuserdata['showavatars']==1) {
$avatarname="images/avatars/avatar-$user_info[avatarid].$user_info[avatarextension]";
$avatarwidth=$user_info['width'];
$avatarheight=$user_info['height'];
eval ("\$useravatar = \"".$tpl->get("avatar_image")."\";");
}
if($user_info['showemail']==1) $useremail = makehreftag("mailto:$user_info[email]",$user_info['email']);
else eval ("\$useremail = \"".$tpl->get("profile_nodeclaration")."\";");
if($user_info['homepage']) $userhomepage = makehreftag($user_info['homepage'],$user_info['homepage'],"_blank");
else eval ("\$userhomepage = \"".$tpl->get("profile_nodeclaration")."\";");
if(!$user_info['icq']) eval ("\$user_info[icq] = \"".$tpl->get("profile_nodeclaration")."\";");
if(!$user_info['aim']) eval ("\$user_info[aim] = \"".$tpl->get("profile_nodeclaration")."\";");
if(!$user_info['yim']) eval ("\$user_info[yim] = \"".$tpl->get("profile_nodeclaration")."\";");
if(!$user_info['msn']) eval ("\$user_info[msn] = \"".$tpl->get("profile_nodeclaration")."\";");
//--lastfm-hack by Cady
$lastfm_info = $db->query_first("SELECT u.* FROM bb".$n."_users u WHERE u.userid='$userid'");
if($lastfm_info['lastfm']!="") eval ("\$btn_lastfm = \"".$tpl->get("profile_lastfm")."\";");
//--lastfm-hack by Cady
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 eval ("\$birthday = \"".$tpl->get("profile_nodeclaration")."\";");
$result = $db->query("SELECT profilefieldid, title FROM bb".$n."_profilefields".ifelse($wbbuserdata['canuseacp']==0," WHERE hidden=0")." ORDER BY fieldorder ASC");
while($row=$db->fetch_array($result)) {
$fieldid="field".$row['profilefieldid'];
if(!$user_info[$fieldid]) eval ("\$user_info[$fieldid] = \"".$tpl->get("profile_nodeclaration")."\";");
else $user_info[$fieldid]=parse::textwrap($user_info[$fieldid],50);
eval ("\$profilefields .= \"".$tpl->get("profile_userfield")."\";");
}
if($profilefields) eval ("\$hr = \"".$tpl->get("profile_hr")."\";");
if($user_info['showemail']==0 && $user_info['usercanemail']==1) eval ("\$btn_email = \"".$tpl->get("thread_formmail")."\";");
if($user_info['userposts']!=0) eval ("\$btn_search = \"".$tpl->get("thread_search")."\";");
if($user_info['receivepm']==1 && $wbbuserdata['canusepms']==1) eval ("\$btn_pm = \"".$tpl->get("thread_pm")."\";");
if($user_info['lastfm']) eval ("\$btn_lastfm = \"".$tpl->get("profile_lastfm")."\";");
#letztes posting vom user
$boardids="";
$permissioncache=array();
$result = $db->query("SELECT * FROM bb".$n."_permissions WHERE groupid = '$wbbuserdata[groupid]'");
while ($row = $db->fetch_array($result)) $permissioncache[$row['boardid']] = $row;
$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']]['boardpermission']) || $permissioncache[$row['boardid']]['boardpermission']!=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($dateformat,$lastpost['posttime'],1);
$lastposttime=formatdate($timeformat,$lastpost['posttime']);
$lastpost['topic']=htmlspecialchars($lastpost['topic']);
$lastpost['title']=$lastpost['title'];
eval ("\$lastpost = \"".$tpl->get("profile_lastpost")."\";");
} else eval ("\$lastpost = \"".$tpl->get("profile_nodeclaration")."\";");
} else eval ("\$lastpost = \"".$tpl->get("profile_nodeclaration")."\";");
#letztes posting vom user
$result = $db->query("SELECT ratingcount, ratingpoints FROM bb".$n."_users WHERE userid = '$userid'");
$row = $db->fetch_array($result);
$rating = userrating($row['ratingcount'], $row['ratingpoints'], $userid);
eval("\$tpl->output(\"".$tpl->get("profile")."\");");
?>
|