Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 12-01-2014, 02:11 PM
omardealo's Avatar
omardealo omardealo is offline
 
Join Date: Nov 2008
Location: egypt
Posts: 235
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default [SOLVED] I want to get all the users who participated in this thread

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 !
Reply With Quote
  #2  
Old 12-01-2014, 02:23 PM
Dave Dave is offline
 
Join Date: May 2010
Posts: 2,583
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You can do something like this:
PHP Code:
SELECT DISTINCT userid FROM `postwhere threadid threadid 
Reply With Quote
Благодарность от:
omardealo
  #3  
Old 12-01-2014, 02:45 PM
omardealo's Avatar
omardealo omardealo is offline
 
Join Date: Nov 2008
Location: egypt
Posts: 235
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dave View Post
You can do something like this:
PHP Code:
SELECT DISTINCT userid FROM `postwhere threadid threadid 
thanks Dave , so there is no vb-function to do that !
Reply With Quote
  #4  
Old 12-01-2014, 03:19 PM
Dave Dave is offline
 
Join Date: May 2010
Posts: 2,583
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Not that I know of.
Reply With Quote
  #5  
Old 12-01-2014, 04:38 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.

Attachment 151072
Reply With Quote
  #6  
Old 12-01-2014, 05:18 PM
omardealo's Avatar
omardealo omardealo is offline
 
Join Date: Nov 2008
Location: egypt
Posts: 235
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dave View Post
Not that I know of.
okay brother , thanks

Quote:
Originally Posted by Lynne View Post
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.
Attachment 151072
thanks Lynne , okay i search about this code and found it on template whopostedbit

Code:
<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&amp;userid=$post[userid]&amp;searchthreadid=$threadinfo[threadid]" onclick="opener.location=('search.php?$session[sessionurl]do=finduser&amp;userid=$post[userid]&amp;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 ?
Reply With Quote
  #7  
Old 12-01-2014, 07:31 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The code for that is in misc.php, the section that starts with if ($_REQUEST['do'] == 'whoposted')
Reply With Quote
  #8  
Old 12-02-2014, 03:59 PM
omardealo's Avatar
omardealo omardealo is offline
 
Join Date: Nov 2008
Location: egypt
Posts: 235
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kh99 View Post
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

PHP Code:
    $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
    "
); 
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:15 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04352 seconds
  • Memory Usage 2,264KB
  • Queries Executed 14 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (3)bbcode_php
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (1)post_thanks_box_bit
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete