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:
|
<?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']);
$posts['userid'] = $user_info['userid'];
$posts['username'] = $user_info['username'];
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($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")."\";");
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")."\";");
/** Kiss-Hack Start **/
if($action == kiss_who){
eval("\$tpl->output(\"".$tpl->get("profile_kiss_who")."\");");
exit;
}
elseif($action == kiss_give){
if($wbbuserdata['userid'] AND $wbbuserdata['userid'] != $user_info['userid']){
$kiss = $user_info['kiss'] + 1;
$db->query("UPDATE bb".$n."_users SET kiss='$kiss' WHERE userid = '$user_info[userid]'");
if($user_info['kiss_who'] == "") $user = $wbbuserdata['username'];
else $user = $user_info['kiss_who'] . ", " . $wbbuserdata['username'];
$db->query("UPDATE bb".$n."_users SET kiss_who='$user' WHERE userid = '$user_info[userid]'");
eval("\$tpl->output(\"".$tpl->get("profile_kiss_give")."\");");
exit;
}
else eval("\$tpl->output(\"".$tpl->get("profile_kiss_error")."\");");
exit;
}
/** Kiss-Hack Ende **/
/* Gästebuch Anfang */
$canusegbook = $db->query_first("SELECT * FROM bb".$n."_groups WHERE groupid='".$user_info['groupid']."'");
if($canusegbook['canusegbook']=="1") {
$zusatz = $canusegbook['postspersite'];
$gbook_entrys = $db->query_first("SELECT COUNT(id)as anzahl FROM bb".$n."_gbook WHERE profileid='".$_GET['userid']."'");
$seiten = $gbook_entrys['anzahl'] / $zusatz;
$seiten = ceil($seiten);
$seitenav = "";
if($_GET['letzt']=="") $letzt="0";
if($_GET['seite']=="") $seite="1";
eval ("\$seitenav .= \"".$tpl->get("profile_gbook_navi1")."\";");
for($i = 1; $i <= $seiten; $i++) {
$neuletzt = ($i * $zusatz) - $zusatz;
eval ("\$seitenav .= \"".$tpl->get("profile_gbook_navi2")."\";");
}
$result = mysql_query("SELECT * FROM bb".$n."_gbook WHERE profileid='".$user_info['userid']."' ORDER BY timestamp DESC LIMIT $letzt, $zusatz");
if(mysql_num_rows($result)){
while($zeile = mysql_fetch_assoc($result)){
$user = $db->query_first("SELECT * FROM bb".$n."_users WHERE userid='".$zeile['userid']."'");
$username = $user['username'];
$ava = $db->query_first("SELECT * FROM bb".$n."_avatars WHERE avatarid='".$user['avatarid']."'");
$avatar = "avatar-".$ava['avatarid'].".".$ava['avatarextension'];
$datum = date("d.m.Y",$zeile['timestamp']);
$zeit = date("H:i", $zeile['timestamp']);
$userid = $zeile['userid'];
$gbentryid = $zeile['id'];
$parse = new parse(1,75,1,1,1,1);
$kommentar=$parse->doparse($zeile['kommentar'],1,0,1,1);
if($user_info['userid']==$wbbuserdata['userid']) eval ("\$del_gbentry_btn = \"".$tpl->get("profile_del_gbentry_btn")."\";");
eval ("\$gbentrys .= \"".$tpl->get("profile_gbentry")."\";");
}
}
if($wbbuserdata['userid']) eval ("\$gbentry_btn .= \"".$tpl->get("profile_gbentry_btn")."\";");
eval ("\$gbook = \"".$tpl->get("profile_gbook")."\";");
}
/* Gästebuch Ende */
eval("\$tpl->output(\"".$tpl->get("profile")."\");");
?>
|