$briefcase_5=""; $briefcase_5.="<div class=\""; //make sure that this isn't repeating an event that's already been listed if($korbin_row['date']<=$the_date) { if($korbin_row['region']=="ALU") { $briefcase_5.="ALU_long"; } if($korbin_row['region']=="AREA") { $briefcase_5.="AREA_long"; } if($korbin_row['region']=="CATN") { $briefcase_5.="CATN_long"; } if($korbin_row['region']=="CTX") { $briefcase_5.="CTX_long"; } if($korbin_row['region']=="DEVICE") { $briefcase_5.="DEVICE_long"; } if($korbin_row['region']=="ERC") { $briefcase_5.="ERC_long"; } if($korbin_row['region']=="FL") { $briefcase_5.="FL_long"; } if($korbin_row['region']=="GAAL") { $briefcase_5.="GAAL_long"; } if($korbin_row['region']=="HGC") { $briefcase_5.="HGC_long"; } if($korbin_row['region']=="SCTL") { $briefcase_5.="SCTL_long"; } } $briefcase_5.="\">"; $briefcase_5 .="<div class=\""; if(stripslashes($korbin_row['state'])=="North Carolina") { $briefcase_5.="North_Carolina"; } elseif(stripslashes($korbin_row['state'])=="South Carolina") { $briefcase_5.="South_Carolina"; } else { $briefcase_5.=stripslashes($korbin_row['state']); } $briefcase_5.="\">"; //$briefcase_5.=$korbin_row['event_id'].' - ' .$korbin_row['date']; $briefcase_5.=" <a href=\"#\" onclick=\"javascript:void window.open('event_description.php?id="; $briefcase_5.=$korbin_row['id']; $briefcase_5.="','1435862141298','width=610,height=560,toolbar=0,menubar=0,location=0,status=0,scrollbars=0,resizable=1,left=0,top=0');return false;\" class=\""; //here you've got to determine if this date is the initial date of a multi day event, or if it's part of a succession. If so, you don't want to display the text. The other thing you need to look at //is the day. If it's Sunday, you need to display the text and if it's the first day of the month, you need to display the text $day_of_week=date("l", strtotime($the_date)); //$date_of_month=date("d", strtotime($korbin_row['date'])); if($day_of_week=="Sunday" OR date("d", strtotime($the_date))==01 OR $korbin_row['date']==$the_date) { if($korbin_row['region']=="ALU") { $briefcase_5.="tooltip_date_ALU_long"; $text_style="ALU"; } if($korbin_row['region']=="AREA") { $briefcase_5.="tooltip_date_AREA_long"; $text_style="AREA"; } if($korbin_row['region']=="CATN") { $briefcase_5.="tooltip_date_CATN_long"; $text_style="CATN"; } if($korbin_row['region']=="CTX") { $briefcase_5.="tooltip_date_CTX_long"; $text_style="CTX"; } if($korbin_row['region']=="DEVICE") { $briefcase_5.="tooltip_date_DEVICE_long"; $text_style="DEVICE"; } if($korbin_row['region']=="ERC") { $briefcase_5.="tooltip_date_ERC_long"; $text_style="ERC"; } if($korbin_row['region']=="FL") { $briefcase_5.="tooltip_date_FL_long"; $text_style="FL"; } if($korbin_row['region']=="GAAL") { $briefcase_5.="tooltip_date_GAAL_long"; $text_style="GAAL"; } if($korbin_row['region']=="HGC") { $briefcase_5.="tooltip_date_HGC_long"; $text_style="HGC"; } if($korbin_row['region']=="SCTL") { $briefcase_5.="tooltip_date_SCTL_long"; $text_style="SCTL"; } } else { if($korbin_row['region']=="ALU") { $briefcase_5.="tooltip_date_ALU"; $text_style="area"; } if($korbin_row['region']=="AREA") { $briefcase_5.="tooltip_date_AREA"; $text_style="AREA"; } if($korbin_row['region']=="CATN") { $briefcase_5.="tooltip_date_CATN"; $text_style="CATN"; } if($korbin_row['region']=="CTX") { $briefcase_5.="tooltip_date_CTX"; $text_style="CTX"; } if($korbin_row['region']=="DEVICE") { $briefcase_5.="tooltip_date_DEVICE"; $text_style="DEVICE"; } if($korbin_row['region']=="ERC") { $briefcase_5.="tooltip_date_ERC"; $text_style="ERC"; } if($korbin_row['region']=="FL") { $briefcase_5.="tooltip_date_FL"; $text_style="FL"; } if($korbin_row['region']=="GAAL") { $briefcase_5.="tooltip_date_GAAL"; $text_style="GAAL"; } if($korbin_row['region']=="HGC") { $briefcase_5.="tooltip_date_HGC"; $text_style="HGC"; } if($korbin_row['region']=="SCTL") { $briefcase_5.="tooltip_date_SCTL"; $text_style="SCTL"; } } //right here you're going to put your search stylings... if(isset($_GET['search'])&&$_GET['search']==$korbin_row['event_id']) { $briefcase_5.="\" style=\"background-color:#ecfa05; color:#000000;\">"; } else { $briefcase_5.="\">"; } $position = 10; $message = $korbin_row['short_name']; $post = substr($message,$position,1); if($post !=" ") { $length = strlen( $message ); while($post !=" " && $position < $length){ $b =1; $position = $position+$b; $post = substr($message,$position,1); } } $post = substr($message,0,$position); if(strlen($post)>10) { $briefcase_5.=stripslashes($post).'...'; } else { $briefcase_5.=stripslashes($post); } //$briefcase_5.=$korbin_row['id']; $briefcase_5.="<span><img class=\"callout_area\" src=\"images/callout.gif\" alt=\"callout\" /><b>"; $briefcase_5.=date("n/j/Y", strtotime($start_date_3)).' - '.date("n/j/Y", strtotime($korbin_row['end_date'])); $briefcase_5.="</b><div style=\"float:right;\"><div class=\""; $briefcase_5.=$text_style; $briefcase_5.="\">"; $briefcase_5.=stripslashes($korbin_row['state']).' | '.stripslashes($korbin_row['region']); $briefcase_5.="</div></div><br><br><u>"; $briefcase_5.=stripslashes($korbin_row['short_name']); $briefcase_5.="</u><br>"; $position_1 = 100; $message_1 = $korbin_row['description']; $post_1 = substr($message_1,$position_1,1); if($post_1 !=" ") { $length_1 = strlen( $message_1 ); while($post_1 !=" " && $position_1 < $length_1){ $a =1; $position_1 = $position_1+$a; $post_1 = substr($message_1,$position_1,1); } } $post_1 = substr($message_1,0,$position_1); if(strlen($post_1)>10) { $briefcase_5.=stripslashes($post_1).'...'; } else { $briefcase_5.=stripslashes($post_1); } $briefcase_5.="</span> </a><br></div>"; $briefcase_5.="</div>"; echo $briefcase_5;