sacqigong
Forum Replies Created
-
Forum: Plugins
In reply to: query_posts function questionThanks for the reply Ogre. In the meantime I got dirty and figured out a way to do this.
In my query.php, I created a new if statement:
————
// Added by Scott for mulit-month searches
if ( $q[‘mult_month’] )
$where .= ” AND MONTH($wpdb->posts.post_date) BETWEEN ” . $q[‘monthnum1’] . ” AND ” .$q[‘monthnum2’] . “”;————and inserted in above these lines in that file:
if ( ” !== $q[‘hour’] )
$where .= ” AND HOUR($wpdb->posts.post_date)='” . $q[‘hour’] . “‘”;if ( ” !== $q[‘minute’] )
$where .= ” AND MINUTE($wpdb->posts.post_date)='” . $q[‘minute’] . “‘”;Then, in my index.php, I call a script that determines the date range I want and runs the query_posts, the code looks like this:
query_posts(“year=$current_year&mult_month=1&monthnum2=$current_month&monthnum1=$last_month&order=DESC&posts_per_page=-1”);
The above references the mult_month variable to use the modified SELECT statement portion from query.php, then my monthnum1 and monthnum2 are the range for the date I need.
This will actually give me some possible trouble around December, so I might have to rework it….argh.
I will look into the function you refer to, thanks!
Forum: Plugins
In reply to: query_posts function questionAh ha. Cool, thanks for the response. Do you know of any other way to accomplish what I’m looking to do, or am I out of luck?