Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Search By Day Instead of From Day Details »»
Search By Day Instead of From Day
Version: 1.00, by Ming Keong Ming Keong is offline
Developer Last Online: Jul 2011 Show Printable Version Email this Page

Version: 3.0.1 Rating:
Released: 05-30-2004 Last Update: Never Installs: 2
 
No support by the author.

Search By Day Instead of From Day
By: Ming Keong
Inspiration: https://vborg.vbsupport.ru/showthread.php?t=64172


Estimated Installation Time: 1-5 mins
File changes: 1 PHP


History
31May04:Initial creation
01Jun04:Added option to retain original getdaily functionality by using getdailyfrom instead


Comments
I'm not sure how many of you will find this useful, but I'll just post it anyway so that it'll benefit anyone who wants it. It's a simple hack that will probably be useful for people who run news sites.


Description
Converts 'getdaily' searches to retrieve posts for the particular day, instead of from the particular day.

getdaily -> Gets all posts X days ago
getdailyfrom -> Gets all posts from X days ago till now


Example Usage
http://www.pdatrends.com/search.php?...ys=1&forumid=6 -> Get News 1 Day Ago
http://www.pdatrends.com/search.php?...ys=3&forumid=6 -> Get News 3 Days Ago
http://www.pdatrends.com/search.php?...ys=1&forumid=6 -> Get News From 1 Day Ago Till Now
http://www.pdatrends.com/search.php?...ys=3&forumid=6 -> Get News From 3 Days Ago Till Now


Code Modifications
In search.php:

Find:
PHP Code:
$threads $DB_site->query(
        SELECT threadid 
        FROM " 
TABLE_PREFIX "thread AS thread 
        LEFT JOIN " 
TABLE_PREFIX "deletionlog AS delthread ON(delthread.primaryid = thread.threadid AND delthread.type = 'thread') 
        WHERE forumid IN(" 
implode(', '$forumids) . ") 
        AND thread.lastpost >= 
$datecut 
        AND visible = 1 
        AND delthread.primaryid IS NULL 
        ORDER BY lastpost DESC 
        LIMIT 
$vboptions[maxresults] 
    "
); 
Replace with:
PHP Code:
if ($_REQUEST['do'] == 'getdaily') { 
        
$datecutplus $datecut + (24 60 60); 
        
$dayonly "AND thread.lastpost <= $datecutplus"
    } 
    
$threads $DB_site->query(
        SELECT threadid 
        FROM " 
TABLE_PREFIX "thread AS thread 
        LEFT JOIN " 
TABLE_PREFIX "deletionlog AS delthread ON(delthread.primaryid = thread.threadid AND delthread.type = 'thread') 
        WHERE forumid IN(" 
implode(', '$forumids) . ") 
        AND thread.lastpost >= 
$datecut 
        "
.$dayonly.
        AND visible = 1 
        AND delthread.primaryid IS NULL 
        ORDER BY lastpost DESC 
        LIMIT 
$vboptions[maxresults] 
    "
); 

Optional, if you want to retain the previous getdaily functionality:

Find:
PHP Code:
if ($_REQUEST['do'] == 'getnew' OR $_REQUEST['do'] == 'getdaily'
Replace with:
PHP Code:
if ($_REQUEST['do'] == 'getnew' OR $_REQUEST['do'] == 'getdaily' OR $_REQUEST['do'] == 'getdailyfrom'
Find:
PHP Code:
$_REQUEST['do'] = 'getdaily'
Replace with:
PHP Code:
if ($_REQUEST['do'] != 'getdaily') {
    
$_REQUEST['do'] = 'getdailyfrom';



Known Limitations
- Retrieves x days ago relative to current time. Eg, it cannot retrieve posts for 28 May 2004. If the current time is 12pm on 29 May 2004, retrieving 1 day ago will search for all posts from 28 May 2004 12pm till 29 May 2004 12pm.

Show Your Support

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

Comments
  #2  
Old 05-31-2004, 05:57 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can you please put this in a text file for those who want to download the hack and keep a backup of it also? Thank you.

And I guess I'm still not exactly clear on what this does. Does it get the posts from 3 days ago and only for that day?
Reply With Quote
  #3  
Old 05-31-2004, 08:51 PM
msimplay's Avatar
msimplay msimplay is offline
 
Join Date: Aug 2002
Location: UK
Posts: 1,059
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Boofo
Can you please put this in a text file for those who want to download the hack and keep a backup of it also? Thank you.

And I guess I'm still not exactly clear on what this does. Does it get the posts from 3 days ago and only for that day?
basicly from what i can tell it does posts from the actual day only ie
2 days ago from today would only get those posts
not all posts from two days ago up until today

so it limits posts to particular days instead of the usual way all posts from 2 days ago till today

i guess its better filtering and in depth searching

the option to have both types is more appealing
Reply With Quote
  #4  
Old 06-01-2004, 02:33 AM
Ming Keong's Avatar
Ming Keong Ming Keong is offline
 
Join Date: Apr 2004
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

msimplay is correct with regards to the usage.

I've added a txt attachment and the option to retain the getdaily functionality by using getdailyfrom.
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 11:16 AM.


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.03764 seconds
  • Memory Usage 2,255KB
  • Queries Executed 19 (?)
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
  • (6)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (4)post_thanks_box
  • (4)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (4)post_thanks_postbit_info
  • (3)postbit
  • (4)postbit_onlinestatus
  • (4)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
  • 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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete