vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Different way to display posts of a user (https://vborg.vbsupport.ru/showthread.php?t=197727)

Marcus_Fenix 12-01-2008 07:35 AM

Different way to display posts of a user
 
Hi,

I want to tweak a call to search.php, so it does something similar as "search.php?do=finduser&u=[insert_userid]", but it doesn't display a list of posts of that user, but a list of the threads the user has replied in ( Quite similar to the list that you get when using search.php?do=getnew and ordered by the date of the last reply (of any user) in that thread )

Is that even possible with a different call to search.php?
If it's not, is there a plug-in that implements this "my active threads"-feature?

Lynne 12-01-2008 02:37 PM

If you look at the Advanced Search page you'll see a checkbox for whether you want the results returned as Thread or Posts:
HTML Code:

<fieldset class="fieldset">
                                <legend>Show Results as</legend>
                                <div style="padding:3px">
                                        <label for="rb_showposts_0"><input type="radio" name="showposts" value="0" id="rb_showposts_0" checked="checked" />Threads</label>
                                        <label for="rb_showposts_1"><input type="radio" name="showposts" value="1" id="rb_showposts_1"  />Posts</label>
                                </div>
                        </fieldset>

So, it looks like the variable you want is "showposts" and you want to set it to "0"

Marcus_Fenix 12-02-2008 09:16 AM

Hmm, that is a clue in the right direction :)

How do I incorporate this showposts in an url? So I want something like this, but not exactly this, because this example doesn't work: ;)
/search.php?do=finduser&u=1095&showposts=0

Lynne 12-02-2008 02:43 PM

It doesn't look like that is a valid parameter for finduser (look around line 3468 in search.php). If you look at the Advanced Search page, you'll see that you can do what you want, you just don't use finduser as the 'do' variable. Take a look at the form and see if you can figure it out. If not, post back and I'll take a look at it.

Marcus_Fenix 12-08-2008 01:11 PM

Thank you for your help Lynne. You're probably a good teacher, because you pointed me in the right direction, without giving me the answer immediately :)

Code:


<form name="MyAT" method="post" action="search.php?do=process">
        <input type="hidden" value="process" name="do"/>
        <input type="hidden" value="1" name="quicksearch"/>
        <input type="hidden" value="1" name="childforums"/>
        <input type="hidden" value="1" name="exactname"/>
        <input type="hidden" value="" name="s"/>
        <input type="hidden" value="0" name="showposts" />
        <input type="hidden" value="$bbuserinfo[securitytoken]" name="securitytoken"/>
        <input type="hidden" value="$bbuserinfo[username]" name="searchuser" />
        <input class="button" type="submit" value="My Active Topics"/>
</form>

Now I just need to change the button into a textlink with javascript :)

Lynne 12-08-2008 02:36 PM

So you got it to work? All right!

Marcus_Fenix 12-11-2008 06:47 AM

Quote:

Originally Posted by Lynne (Post 1680958)
So you got it to work? All right!

Yup, it works! :) And the users like it.... but it saves (it has some sort of searchcache?) the query and doesn't update real-time. Is there any way to turn this off for this search?

Lynne 12-11-2008 03:03 PM

Hmmm, I do know that search looks to see if the query has already been performed recently - see the code around line 440. So, if you have 'nocache' set to true, it will not do that. I'm not sure if that is something you can set in your form as a hidden input? It might be worth a try.

Marcus_Fenix 12-15-2008 07:32 AM

Works! You're my new internethero ;)


All times are GMT. The time now is 03:34 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.01154 seconds
  • Memory Usage 1,734KB
  • 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
  • (1)bbcode_html_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)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