Got both of my above comments to work.
Here you go for those interested (change what's in
Red):
Code:
ob_start();
// %d
$show_count = 1;
$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 )
{
$format = sprintf("On %s%s %s %s",date("j",$event['dateline_from'])+1, date("S",$event['dateline_from']), date("M",$event['dateline_from']), date("Y",$event['dateline_from']));
} else {
$format = sprintf("From %s to %s",date('jS M Y',$event['dateline_from']),date('jS M Y',$event['dateline_to']));
}
$output_bits .= sprintf('
<div class = "cms_widget_post_bit"><center><a href="calendar.php?do=getinfo&e=%d"><img src="http://www.YourForum.com/forum/images/event.jpg" width="200px" alt="Upcoming Event"/><h4 class="cms_widget_post_header">%s</a></h4>
<p class="cms_widget_post_content">%s</p></center>
</div>
',$event['eventid'],$event['title'],$format);
}
$output = $output_bits;
ob_end_clean();
return $output;
What this does is add a picture centered above the upcoming event. The picture is uploaded to 'images/' as event.jpg. You can change that to whatever you want. It also corrects the issue I had with the date. It's now projecting the proper date.
What I'd really like to do is replace the code related to the image with a piece of code that uses an image that was either attached or placed between img tags in the event.
NOTE:
I changed the number of events to display to 1.
I do not need the range on my forum so I did not test that part.