Quote:
Originally Posted by rhody401
I have modified this a bit to make it in a format for USA Month Day Year, and some other small changes. (my modified code below)
It would be REALLY nice if I could find a way to have it exclude some calendar items that have a specific string of text in the title. I just don't know where to put the hook to make this happen. Any suggestions appreciated!  THANK YOU
example: If a calendar event has "BOARD MEETING" anywhere in the TITLE, it gets overlooked/ignored by this code. It displays everything else, but these events.
Here is my (current/modified from above) code:
Thanks in advance if anyone has the time to look at this and give some advice.
Much appreciated! :up:
Rhody
|
PHP Code:
ob_start();
// %d
$show_count = 9;
$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(!strpos($event['title'], "BOARD MEETING")) // do not show event
{
if($event['dateline_to'] == 0 )
{
$format = sprintf(" ");
//changed code 2/6/13 adds a day to fix issue, and reformat for USA m/d/y
$format = sprintf("On %s", vbdate('M jS, Y',$event['dateline_from']+86400), vbdate('g:i A', $event['dateline_from']));
}
else
{
$format = sprintf("From %s to %s",vbdate('M jS',$event['dateline_from']),vbdate('M jS Y',$event['dateline_to']));
}
$output_bits .= sprintf('
<div class = "cms_widget_post_bit"><center><a href="calendar.php?do=getinfo&e=%d"><h4 class="cms_widget_post_header"><font size="2">%s</font></a></h4>
<p class="cms_widget_post_content"><font size="1">%s </font></p><p><font size="1"> </font></p></center>
</div>
',$event['eventid'],$event['title'],$format);
}
}
$output = $output_bits;
ob_end_clean();
return $output;
i have added a simple check if(!strpos($event['title'], "BOARD MEETING")) which says if the title does not contain BOARD MEETING. if it does have BOARD MEETING it skips the event and moves to the next one.
i havnt tested it but it should work.