Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Beta Releases

Reply
 
Thread Tools
Search All Posts From Date (Day Search) Details »»
Search All Posts From Date (Day Search)
Version: 1.00, by jschefdog jschefdog is offline
Developer Last Online: May 2011 Show Printable Version Email this Page

Version: 3.0.0 Rating:
Released: 04-20-2004 Last Update: Never Installs: 7
Is in Beta Stage  
No support by the author.

This is so simple I'm almost embarrased to post it here with all these great hacks, but I did some searching and only found posts from others who were looking for this feature. There is a hack for version 2 called Day Search which allows searching for all posts in the last xx days. I had added this hack for our v2 installation and wanted something similar for v3. After some searching here I didn't find anything, so I started tinkering with the search.php file and found a really simple way to make the standard Search page allow you to do something like this. All you have to do is defeat the test which checks if a keyword or user name was entered in the search form and then stops the search if they are both blank.

If anyone wants to try it, edit the search.php file and search for the following lines (at about line 250).
Code:
// error if no search terms
if (empty($query) AND empty($searchuser) AND empty($replyless))
Replace the "if" statement with the following line
Code:
if (empty($query) AND empty($searchuser) AND empty($replyless) AND ($searchdate == 0))
This will cause the 'searchspecifyterms' message to be bypassed provided the "Find Posts From" field is changed from the default of "Any Date". Actually, it will even work if you just comment out the whole if statement around this line, but then it will return lots of posts if the user leaves it at Any Date.

I can't believe it could be this simple, but I ran some tests and it seems to work. It even works with other search options such as selecting particular forums. I couldn't find any problems with it.

The next step is to figure out how to add some more "Find Posts From" options, such as "Last 2 Days", "Last 3 Days", etc. I haven't had a chance to look into this yet, but suspect it might be possible by changing the search_forum template. If I figure out how to do it I will post it here.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 04-21-2004, 05:56 PM
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 11,440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by jschefdog
That's a nice hack, and much more handy and obvious. This is the kind of feature I had hoped would be part of vB 3. To save people the trouble of hunting it down, here is the link.

http://www.vbulletin.com/forum/showthread.php?p=657712

The only real advantage my hack has is that it provides more search control, such as only showing recent posts in selected forums.
You should be able to exclude, or only look at one specific forum as well

forumid=X
exclode=X,Y,Z
Reply With Quote
  #13  
Old 04-21-2004, 07:48 PM
jschefdog jschefdog is offline
 
Join Date: May 2002
Location: Sunnyvale, CA.
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Zachery
You should be able to exclude, or only look at one specific forum as well

forumid=X
exclode=X,Y,Z
Thanks for the tip Zachery. I tried these and they work fine. For example:

search.php?do=getdaily&days=30&forumid=26
search.php?do=getdaily&days=30&exclude=28,29

Specifying the forumid will also include children, which is nice. This would allow adding buttons to do specific searches such as "Last Month for Forum X" or "Last Week for Category Y", but does not provide the flexibility of being able to do "Last X Days" searches from the Advanced Search form. With the hack described in this thread, you can select any combination of forums (thanks to the great new search features in vb 3) and then view all the posts from the last x days in those forums. You can also list the results by posts, which I don't think is possible with getdaily.
Reply With Quote
  #14  
Old 04-21-2004, 08:06 PM
jschefdog jschefdog is offline
 
Join Date: May 2002
Location: Sunnyvale, CA.
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Related to this topic, it seems that whenever you run a search using "getdaily", the Search Results web page always says:

Search: Posts From Last Day

Regardless of the number of days you specify. Not a big deal, but it would be nice if it listed the number of days used in the search.
Reply With Quote
  #15  
Old 05-25-2004, 09:15 PM
Jon Matcho Jon Matcho is offline
 
Join Date: Apr 2004
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by jschefdog
...I'm almost embarrased to post it here with all these great hacks...
The simplicity of this hack is near algorithmic poetry. I salute you for finding this gem!!!

Bravo, and thank you!
Reply With Quote
  #16  
Old 06-01-2004, 07:14 PM
MickDoneDee MickDoneDee is offline
 
Join Date: Mar 2003
Location: Sydney
Posts: 170
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

So simple, but so useful - qualities of a great hack. Should be included in future versions. I've also added the optional enhancements. It works like a charm.
Reply With Quote
  #17  
Old 06-02-2004, 01:22 AM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Like some posters said, this feature is built into vB - you just need to add the template mod described above - no hack needed.
Reply With Quote
  #18  
Old 01-14-2007, 11:35 PM
jksgvb jksgvb is offline
 
Join Date: Jan 2007
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by jschefdog View Post
...With the hack described in this thread, you can select any combination of forums (thanks to the great new search features in vb 3) and then view all the posts from the last x days in those forums. You can also list the results by posts, which I don't think is possible with getdaily.
Thanks so much for posting this. This is exactly the way I need the advanced search in my forum to work. Unfortunately, when I modify the search.php file as described, searching operates just as before--still returning the error if 'key word' and 'user name' fields are left blank.

This is the code I found in my search.php file:
Code:
// error if no search terms
	if (empty($vbulletin->GPC['query']) AND empty($vbulletin->GPC['searchuser']) AND empty($vbulletin->GPC['replyless']))
and this is what I changed it to:

Code:
// error if no search terms
	if (empty($vbulletin->GPC['query']) AND empty($vbulletin->GPC['searchuser']) AND
empty($vbulletin->GPC['searchdate == 0']) AND empty($vbulletin->GPC['replyless']))
I'm running vBulletin 3.6.4 btw.

Is there some other setting I need to change? Thanks.
Reply With Quote
  #19  
Old 01-15-2007, 08:22 PM
jksgvb jksgvb is offline
 
Join Date: Jan 2007
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I see my mistake. I need to remove the "empty" command in front of the 'searchdate' pointer. All is OK now.
Reply With Quote
Reply

Thread Tools

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 01:06 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.04447 seconds
  • Memory Usage 2,285KB
  • Queries Executed 23 (?)
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
  • (4)bbcode_code
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (8)postbit
  • (9)postbit_onlinestatus
  • (9)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_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
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete