vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   [SOLVED] I want to get all the users who participated in this thread (https://vborg.vbsupport.ru/showthread.php?t=315751)

omardealo 12-01-2014 02:11 PM

[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 !

Dave 12-01-2014 02:23 PM

You can do something like this:
PHP Code:

SELECT DISTINCT userid FROM `postwhere threadid threadid 


omardealo 12-01-2014 02:45 PM

Quote:

Originally Posted by Dave (Post 2525119)
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 !

Dave 12-01-2014 03:19 PM

Not that I know of.

Lynne 12-01-2014 04:38 PM

1 Attachment(s)
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

omardealo 12-01-2014 05:18 PM

Quote:

Originally Posted by Dave (Post 2525122)
Not that I know of.

okay brother , thanks

Quote:

Originally Posted by Lynne (Post 2525137)
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 ?

kh99 12-01-2014 07:31 PM

The code for that is in misc.php, the section that starts with if ($_REQUEST['do'] == 'whoposted')

omardealo 12-02-2014 03:59 PM

Quote:

Originally Posted by kh99 (Post 2525160)
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
    "
); 



All times are GMT. The time now is 05:10 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01153 seconds
  • Memory Usage 1,736KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (3)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete