This question may be related to a resolved thread.
Hey guys-
So I have a channel tag + php:
<?php
$ee =& get_instance();
$start_on = "";
if (isset($ee->uri->segments[3])) {
$start_on = $ee->uri->segments[3]."-";
if (isset($ee->uri->segments[4])) { $start_on = $start_on.$ee->uri->segments[4]."-"; } else { $start_on = $start_on."01-"; }
if (isset($ee->uri->segments[5])) { $start_on = $start_on.$ee->uri->segments[5]." "; } else { $start_on = $start_on."01 "; }
}
$start_on = $start_on." 12:00 AM";
if ($start_on == " 00:00") { $start_on = $ee->localize->decode_date('%Y-%m-%d %H:%i', $ee->localize->now); }
// echo $start_on;
?>
{exp:channel:entries channel="event" dynamic="no" show_future_entries="yes" start_on="<?php echo $start_on; ?>" disable="member_data|pagination|trackbacks" orderby="event_start_date" sort="asc"}
etc...So this is working GREAT except for one event, that happens to start ON August 1 at 12:00 AM (using the event helper extension to set start dates to 12:00 AM). $start_on is correctly outputting “2012-08-01 12:00 AM”, which should include that august 1 entry….
Any reason why that entry would be excluded? It’s shown when I go back to July!
Well, I fixed it, but it’s really ugly — thinking through a better way to fix this issue, if anyone knows the “right” way to fix this, i’m all ears!
<?php
$ee =& get_instance();
$start_on = "";
if (isset($ee->uri->segments[3])) {
$start_on = $ee->uri->segments[3]."-";
if (isset($ee->uri->segments[4])) { $start_on = $start_on.$ee->uri->segments[4]."-"; } else { $start_on = $start_on."01-"; }
if (isset($ee->uri->segments[5])) { $start_on = $start_on.$ee->uri->segments[5]." "; } else { $start_on = $start_on."01 "; }
}
$start_on = $start_on." 12:00 AM";
if ($start_on == " 00:00") { $start_on = $ee->localize->decode_date('%Y-%m-%d %H:%i', $ee->localize->now); } else {
$start_on_unix_bug = $ee->localize->convert_human_date_to_gmt($start_on) - 1000;
$start_on = $ee->localize->decode_date('%Y-%m-%d %H:%i', $start_on_unix_bug);
}
?>
{exp:channel:entries channel="event" dynamic="no" show_expired="yes" show_future_entries="yes" start_on="<?php echo $start_on; ?>" disable="member_data|pagination|trackbacks" orderby="event_start_date" sort="asc"}
{if no_results}
etc...Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.