I think that some coders already know the answer, but do not show us how?
a friend of mine has been added to my code (or the entire code) =
PHP Code:
ob_start();
$show_count = 5;
$query = sprintf("SELECT * FROM ".TABLE_PREFIX."event WHERE visible = 1 AND (dateline_from > '%d' || ( dateline_from > '%d' AND dateline_to < '%d' )) ORDER BY dateline_from ASC LIMIT %d",TIMENOW,TIMENOW,TIMENOW,$show_count);
$event_get = vB::$db->query_read($query);
$output_bits = '';
while($event = vB::$db->fetch_array($event_get)) {
if($event['dateline_to'] == 0 )
{
$datefrom = date('j',$event['dateline_from']);
$datefrom = $datefrom+1;
$format = sprintf("On ".$datefrom."th %s",date('M Y',$event['dateline_from']));
} else {
$datefrom = date('j',$event['dateline_from']);
$datefrom = $datefrom + 1;
$dateto = date('j',$event['dateline_to']);
$dateto = $dateto + 1;
$format = sprintf("From ".$datefrom."th %s to ".$dateto."th %s",date('M Y',$event['dateline_from']),date('M Y',$event['dateline_to']));
}
$output_bits .= sprintf('
<div class = "cms_widget_post_bit"><h4 class="cms_widget_post_header"><a href="calendar.php?do=getinfo&e=%d">%s</a></h4>
<p class="cms_widget_post_content">%s</p>
</div>
',$event['eventid'],$event['title'],$format);
}
$output = $output_bits;
ob_end_clean();
Set your GMT time, standard for me + 1 (change it) and it should work.
if a coder could take the data from the + or - GMT time and replacing the code in my (+ 1)then it should work. but what I was thinking. is that the data is taken from a wrong place.