View Full Version : [SOLVED] I want to get all the users who participated in this thread
omardealo
12-01-2014, 02:11 PM
HELLO ,
I want to query all the users who participated in this thread ..
Example: there is threadid = 30 and Contains 5 posts
I want to get the userid of those who wrote 5 posts without repeating .
Is there function for this or should I use a query ?!
Thank you !
You can do something like this:
SELECT DISTINCT userid FROM `post` where threadid = threadid
omardealo
12-01-2014, 02:45 PM
You can do something like this:
SELECT DISTINCT userid FROM `post` where threadid = threadid
thanks Dave , so there is no vb-function to do that !
Lynne
12-01-2014, 04:38 PM
If you go to the forumdisplay page and click on the number of replies to the thread, you will get a pop-up that shows all the users who posted in the thread and then number of times they posted.
151072
omardealo
12-01-2014, 05:18 PM
Not that I know of.
okay brother , thanks
If you go to the forumdisplay page and click on the number of replies to the thread, you will get a pop-up that shows all the users who posted in the thread and then number of times they posted.
151072
thanks Lynne , okay i search about this code and found it on template whopostedbit
<tr>
<td class="$bgclass">
<if condition="$show['memberlink']">
<a href="member.php?$session[sessionurl]u=$post[userid]" target="_blank">$post[username]</a>
<else />
$post[username]
</if>
</td>
<td class="$bgclass"><if condition="$post['userid']"><a href="search.php?$session[sessionurl]do=finduser&userid=$post[userid]&searchthreadid=$threadinfo[threadid]" onclick="opener.location=('search.php?$session[sessionurl]do=finduser&userid=$post[userid]&searchthreadid=$threadinfo[threadid]'); self.close();">$post[posts]</a><else />$post[posts]</if></td>
</tr>
but where i found this function to use it on showthread template ?
The code for that is in misc.php, the section that starts with if ($_REQUEST['do'] == 'whoposted')
omardealo
12-02-2014, 03:59 PM
The code for that is in misc.php, the section that starts with if ($_REQUEST['do'] == 'whoposted')
thanks kh99
it's same , code get info by a query like what Dave put it
$posts = $db->query_read_slave("
SELECT COUNT(postid) AS posts,
post.username AS postuser,user.userid,user.username
FROM " . TABLE_PREFIX . "post AS post
LEFT JOIN " . TABLE_PREFIX . "user AS user USING(userid)
WHERE threadid = $threadinfo[threadid]
AND visible = 1
GROUP BY userid
ORDER BY posts DESC
");
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.