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:
|
// if thxbot
if ($thread['thxbot'] && $posts['postid'] == $firstpost['id']) {
$thx_usercount = 0;
$res = $db->query_first("SELECT `userids` FROM `bb".$n."_thxthreads` WHERE `threadid`='".$thread['threadid']."'");
if ($res['userids'] != "") {
$ids = explode(",", $res['userids']);
$thx_usercount = count($ids);
$thx_usernames = implode(" - ", $ids);
}
if($thx_usercount != 0) {
//$where = "`userid` = '".$ids[0]."'";
//for ($i=1; $i<$thx_usercount; $i++) $where .= " OR `userid` = '".$ids[$i]."'";
//$unames = $db->query("SELECT `userid`, `username` FROM `bb".$n."_users` WHERE ".$where);
$where = "u.userid = '".$ids[0]."'";
for ($i=1; $i<$thx_usercount; $i++) $where .= " OR u.userid = '".$ids[$i]."'";
$unames = $db->query("SELECT u.userid, u.username, u.useronlinegroupid, g.useronlinemarking
FROM bb".$n."_users u
LEFT JOIN bb".$n."_groups g ON (u.useronlinegroupid=g.groupid)
WHERE ".$where
);
$usernames = "";
while ($row = $db->fetch_array($unames)) {
$row['username'] = sprintf($row['useronlinemarking'], $row['username']);
if ($usernames == "") $usernames = $lang->get("LANG_THREAD_THX_PROFILELINK", array('$userid' => $row['userid'], '$username' => $row['username'], '$SID_ARG_2ND' => $SID_ARG_2ND));
else $usernames .= ", ".$lang->get("LANG_THREAD_THX_PROFILELINK", array('$userid' => $row['userid'], '$username' => $row['username'], '$SID_ARG_2ND' => $SID_ARG_2ND));
}
$thx_usernames = $usernames;
}
if ($res['userids'] != "" && !strchr($res['userids'], ",")) {
$posts['message'] .= $lang->get("LANG_THREAD_THX_ONE", array('$thx_usercount' => $thx_usercount, '$thx_usernames' => $thx_usernames, '$threadid' => $thread['threadid'], '$SID_ARG_2ND' => $SID_ARG_2ND));
} else {
$posts['message'] .= $lang->get("LANG_THREAD_THX", array('$thx_usercount' => $thx_usercount, '$thx_usernames' => $thx_usernames, '$threadid' => $thread['threadid'], '$SID_ARG_2ND' => $SID_ARG_2ND));
}
}
|