vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Search for Posts in Thread by Username (https://vborg.vbsupport.ru/showthread.php?t=91629)

Andreas 07-03-2005 10:00 PM

Search for Posts in Thread by Username
 
<font size="3">Search for Posts in Thread by Username</font>

Description
Do you know that? You are searching for that one Post in a single Thread made by a specific User, but you can't remember the Text.
Unfortunately the Thread is several hundred Posts long - and the User has tons of Posts in the Forum that Thread belongs to.
So searching for Keywords in the Thread doesn't work, and searching for the Posts made by the User also doesn't help much.
This Hack solves the Problem by allowing you to search for Posts from a specific User made in a specific Thread.

Details
1 Plugin XML
1 Template Edit

History
1.0.0
Initial Version

1.0.1
vBulletin 3.5.2 compatibility

Please only click Install if you actually have installed/are using this Hack, and click Uninstall whan you don't use it any longer!

Chris M 07-04-2005 09:57 PM

Excellent :)

Should be in vB by default :)

Satan

Chris M 07-04-2005 10:00 PM

I think your instructions are a bit flawed Kirby:p

Quote:

2) In Template FORUMHOME
FIND
----------------------------------------------------------------------
<input type="text" class="bginput" name="query" size="20" />$gobutton<br />
----------------------------------------------------------------------
I think you mean [high]SHOWTHREAD[/high] ;)

Not had much sleep?:p

Satan

Andreas 07-04-2005 10:03 PM

Aargh ... too tired ;)
Of course it is SHOWTHREAD.

Gonna re-upload the File now (I'love the creation process - just one click to rebuild the ZIP :D)

Chris M 07-04-2005 10:04 PM

Quote:

Originally Posted by KirbyDE
Aargh ... too tired ;)
Of course it is SHOWTHREAD.

Gonna re-upload the File now (I'love the creation process - just one click to rebuild the ZIP :D)

:) Go inject some coffee into your eyes ;)

That'll wake you up, and also cause you to lose your sight for several hours :p

Satan

KTBleeding 07-04-2005 11:24 PM

Wow.. I've wanted this for vB for so long. Guess this gives me a reason to upgrade.

Allan 07-05-2005 04:28 AM

very nice KirbyDE :)

artonex 09-12-2005 11:08 AM

Very nice im going to install it now :)

Mathiau 09-14-2005 10:01 PM

i love you - i had made a request for something like this back in 2.* days. hope it works on RC3..

Andreas 09-14-2005 10:08 PM

Should work just fine in RC3

buro9 09-15-2005 06:21 AM

This is good... and so close to what I had hacked into 3.0.x

What I'm looking for is a search function that can be given a threadid and userid, not username. And that can be called from a GET query, such as search.php?threadid=123&userid=123 and then show the results as posts.

Where I put this is on the popup showing number of people who posted in a thread. I made the numbers clickable so that the opener window changed to show which posts they were.

That should be in vBulletin by default and is not.

But my question is... how could I adjust the hack to use userid, and what should be the URL I would need to see the results?

EasyTarget 09-15-2005 02:14 PM

How could I edit this so that the boxes are separated by a title? One box that says Username and one that says Keyword.

Like the hack that lets you search posts and titles.

Andreas 09-15-2005 02:17 PM

Just modify the Template as you like :)

EasyTarget 09-16-2005 08:48 AM

Code:

<div class="vbmenu_popup" id="threadsearch_menu" style="display:none">
<form action="search.php" method="post">
        <table cellpadding="4" cellspacing="1" border="0">
        <tr>
                <td class="thead">$vbphrase[search_this_thread]<a name="goto_threadsearch"></a></td>
        </tr>
        <tr>
                <td class="vbmenu_option" title="nohilite">
                        <input type="hidden" name="s" value="$session[sessionhash]" />
                        <input type="hidden" name="do" value="process" />
                        <input type="hidden" name="searchthread" value="1" />
                        <input type="hidden" name="showposts" value="1" />
                        <input type="hidden" name="searchthreadid" value="$threadid" />
                        <if condition="$show['searchthreaduser']">
                        <div class="vbmenu_option">$vbphrase[username]:</div>
                        <input type="text" class="bginput" name="searchuser" size="20" /><br />
                        </if>
Keyword:<br>
                        <input type="text" class="bginput" name="query" size="20" />$gobutton<br />
                </td>
        </tr>
        <tr>
                <td class="vbmenu_option"><a href="search.php$session[sessionurl_q]">$vbphrase[advanced_search]</a></td>
        </tr>
        </table>
</form>
</div>

is there anything I should add or fix from this code so that its more correct? I changed the div class to vbmenu_option and I added the word 'keyword:'. Is there some other/better way to do this?

The Wise One 10-10-2005 03:08 PM

installed. thanks.

buro9 10-10-2005 03:25 PM

Is there a way to call this with a URL like:
search.php?threadid=XXX&userid=YYY

And have it show everything that someone has posted in a thread?

cnutter 10-10-2005 05:25 PM

I tried to install this but It didnt seem to work so what did I miss?

I made teh proper edit in the templet and installed the plugin any ideas?

Andreas 10-10-2005 05:28 PM

@buro9
Yes, it's possible.
do=process&searchthreadid=X&userid=Y

@cnutter
What exactly does not work?

cnutter 10-10-2005 05:33 PM

Quote:

Originally Posted by KirbyDE
@cnutter
What exactly does not work?


KirbyDE,

Maybe, I am not getting it but when I went to a forum to do a search in a very large thread on my site to test it I couldnt find/see the search field as show in your screen shot of the hack.

I maybe missing something.... :ermm:

cnutter 10-10-2005 05:46 PM

KirbyDE

I figured it out....

Code:

<input type="text" class="bginput" name="query" size="20" />$gobutton<br />
There are two instances of this exact line in the SHOWTHREAD templet.

I had put it above the wrong one.

Its fixxed now.... thanx....

Andreas 10-10-2005 05:56 PM

Whoops :)
Gonna have to update the instructions then.
Thanks for pointing that out.

buro9 10-10-2005 09:52 PM

Quote:

Originally Posted by KirbyDE
@buro9
Yes, it's possible.
do=process&searchthreadid=X&userid=Y

Fantastic... installed.

But... there's a bug.

If I search a thread for a user:
search.php?do=process&amp;searchthreadid=133&amp;u serid=267

And then perform a search for another user against the same thread:

search.php?do=process&amp;searchthreadid=133&amp;u serid=389

The first results always comes back.

It's as if vBulletin caches the search result according to the threadid and pays no attention to the userid.


If you want to view this on mine, just click the Who Posted link and you'll see that I've made the Who Posted popup link back via the postcount to the search result. Except... it has that bug.

Andreas 10-10-2005 10:03 PM

Yes, vBulletin does cache the results without taking the Username into account - and there is no way to get around this limitation without editing search.php.
(Except "disabling" caching results for this search, which I did on my site).

buro9 10-11-2005 04:13 AM

Quote:

Originally Posted by KirbyDE
Yes, vBulletin does cache the results without taking the Username into account - and there is no way to get around this limitation without editing search.php.
(Except "disabling" caching results for this search, which I did on my site).

I can totally do that :) How though?

I already have search result sharing disabled in my AdminCp > vBulletin Options > Message Searching Options.

Is there another way around this... did you comment out some code to achieve this?

(btw... disabling the search cache would fix a bug in vBulletin where it's possible to get someone elses search results and have the results ordered incorrectly).

So totally up for this, how though :)

buro9 10-11-2005 09:48 PM

Quote:

Originally Posted by buro9
I can totally do that :) How though?

Done it... commented out a chunk of search.php :)

Andreas 10-11-2005 09:54 PM

I used a somewhat dirty trick to avoid file edits :)

search_process_start
PHP Code:

if ($searchuser AND $vbulletin->GPC['searchthreadid'] AND !$vbulletin->GPC['query'])
{
$realuserid $vbulletin->userinfo['userid'];
$vbulletin->userinfo['userid'] = -1;



search_process_fullsearch
PHP Code:

$vbulletin->userinfo['userid'] = $realuserid

This way vBulletin does not find a valid searchhash and performs a new search.

buro9 10-11-2005 09:59 PM

Quote:

Originally Posted by KirbyDE
I used a somewhat dirty trick to avoid file edits :)

search_process_start
PHP Code:

if ($searchuser AND $vbulletin->GPC['searchthreadid'] AND !$vbulletin->GPC['query'])
{
$realuserid $vbulletin->userinfo['userid'];
$vbulletin->userinfo['userid'] = -1;



search_process_fullsearch
PHP Code:

$vbulletin->userinfo['userid'] = $realuserid

This way vBulletin does not find a valid searchhash and performs a new search.

Brilliant and very amusing.

I think I'll stick with file edits though, I'm comfortable with them and can upgrade even my heavily modded board in less than 30 minutes with all hacks migrated... a short enough time for me to care about, and at least I have no plugin overhead.

Hey... have you published your private hack to prevent pulling in plugins all the time? You have one don't you? (imagines it writes .php files out during plugin installs and just puts include statements into the hooks)

Andreas 10-11-2005 10:03 PM

I've got a neat Windows proggy to slipstream plugins into vBulletin, yes. :)
But I havn't updated it to process product XMLs ... yet.

My board is so hacked that even with Tools like Beyond Compare, the last upgrade (3.0.0 RC2 -> 3.0.6) took some hours to get it working again without errors, although the new Version had been tested before by the whole team for some days.
Not to mention the Style stuff which took weeks.

Neal-UK 10-11-2005 10:07 PM

Quote:

Originally Posted by KirbyDE
I've got a neat Windows proggy to slipstream plugins into vBulletin, yes. :)
But I havn't updated it to process product XMLs ... yet.

My board is so hacked that even with Tools like Beyond Compare, the last upgrade (3.0.0 RC2 -> 3.0.6) took some hours to get it working agin without errors, although the new Version had been tested before by the whole team for some days.
Not to mention the Style stuff which took weeks.

excellent mod, nice one again

buro9 10-12-2005 04:28 AM

Quote:

Originally Posted by KirbyDE
My board is so hacked that even with Tools like Beyond Compare, the last upgrade (3.0.0 RC2 -> 3.0.6) took some hours to get it working again without errors, although the new Version had been tested before by the whole team for some days.

Not to mention the Style stuff which took weeks.

Yeah, that's where mine is. I eventually invested in Slick Edit and keep a very tightly controlled set of conventions over marking up hacks within the code, the changes made, etc. Done well file changes are easy to migrate and not too time consuming.

Style changes take time though, that I'll admit, but that would be the case even with the plugin system. Especially because most of the time I cut 'n' paste the templates into Slick Edit so that I can use a powerful diff and merge tool to make the new version.

I dread to think how difficult it will be to upgrade when I finish the XHTML Strict style I've been hacking together for weeks (reduced tables, highly semantic).

Andreas 12-08-2005 01:39 PM

A variable name has changed.

Andreas 12-08-2005 02:13 PM

Why not just import the new XML?

Lea Verou 12-09-2005 07:39 AM

Quote:

Originally Posted by mini2
I know you're a busy man (very), but will you be fixing this one for us, it's something my users like a lot?

:)

Great!! I will install in a few days :)

Suggestion: The 2 editboxes look kinda messy. It would be better to have 2 radio buttons underneath one editbox like:
(o) Text ( ) Username
What do you think?

Andreas 12-09-2005 07:41 AM

Then you would not be able to search for posts by foo containing bar, which is possible with the current implementation ;)

Lea Verou 12-09-2005 07:43 AM

I think it doesn't matter if you lose some of the functionality to make it look neater. :)
Of course some people might prefer it this way so I think if it's not hard you could make a second version of the hack for people who prefer it that way :)
What do you think? :)

Andreas 12-09-2005 07:45 AM

Quote:

Originally Posted by mini2
That hasn't worked. The new zip contains plugins, not a product, and I coulnd't get them to work either as a replacement, or alongside, the 1.0.0 version?

LOL, I zipped the wrong file ^.^
Should be the correct one now.

Quote:

Originally Posted by Michelle
What do you think? :)

I think I prefer it this way and see no need for a crippled version :)

Lea Verou 12-09-2005 07:49 AM

Quote:

Originally Posted by Andreas
I think I prefer it this way and see no need for a crippled version :)

Ok... :( :( You made me sad :( :( :( :p

Lea Verou 12-09-2005 07:53 AM

Quote:

Originally Posted by mini2
Thanks. ;) Works again now.

As for the "neatness", I just changed the template a bit so it's more broken up, and says

Username:
[INPUT BOX]
And/Or Keywords:
[INPUT BOX]

I think that looks OK myself. Each to their own.

Hmm yeah, that sounds a little better :)

Andreas 12-09-2005 07:56 AM

Quote:

Originally Posted by mini2
Username:
[INPUT BOX]
And/Or Keywords:
[INPUT BOX]

That's almost as I got it (except the And/Or). Isn't that how the template edit instructions are?

FleaBag 12-12-2005 11:07 AM

Just installed... Many thanks. Your thread still says vB 3.5.0 - just so you know. ;)


All times are GMT. The time now is 04:49 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.01432 seconds
  • Memory Usage 1,845KB
  • 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
  • (2)bbcode_code_printable
  • (4)bbcode_php_printable
  • (15)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete