важные | все | Матрица | Shizgara | Hollywood | Лондон "; */ //set_today(); //$now = mktime ( 3, 0, 0, $thismonth, $thisday, $thisyear ); $nowYmd = date("Ymd"); $nowtime = date("His"); $place_add=intval($_GET['place_add']); $SQL_ADD=''; //if ($site=="spb") $SQL_ADD .=" AND talk_in_forum=85 "; if ($place_add > 0) $SQL_ADD .=" AND cal_category=$place_add "; $SQL_ADD_1="OR (cal_date > $nowYmd AND (cal_priority > 0 OR sms_status>14))"; // только важные события /* if ($all ==true) { $SQL_ADD_1="OR cal_date > $nowYmd"; // все события } */ if ($place_add > 0) { $sql = "SELECT cal_id, cal_date, cal_time, cal_name, cal_priority, cal_category, sms_status, wc.cat_name as place, wc.cat_city as city FROM webcal_entry LEFT JOIN webcal_categories as wc ON wc.cat_id=cal_category WHERE cal_date >= $nowYmd $SQL_ADD AND cal_category=".$place_add." AND cal_status=0 ORDER by cal_date asc, cal_time asc limit 100 "; } else{ $sql = "SELECT cal_id, cal_date, cal_time, cal_name, cal_priority, cal_category, sms_status, wc.cat_name as place, wc.cat_city as city FROM webcal_entry LEFT JOIN webcal_categories as wc ON wc.cat_id=cal_category WHERE (cal_date = $nowYmd ".$SQL_ADD_1.") $SQL_ADD AND cal_status=0 ORDER by cal_date asc, cal_time asc limit 100 "; } $date_old=''; $res = db_query($sql); echo ""; while($out = mysql_fetch_array($res)) { $id=$out['cal_id']; $date=$out['cal_date']; $time=$out['cal_time']; $name=$out['cal_name']; $priority=$out['cal_priority']; $place=$out['cal_category']; $city=$club_city[$out['city']]; $sms_status=$out['sms_status']; // Находим место if ($out['place']!='') $place=$out['place'].""; elseif ($out['cal_category']!='0') $place=$out['cal_category'].""; else $place=''; if ($place && $city && $city!='Нижний Новгород') $place=$place." ($city)"; $time= display_time ($time); // проверяем дату if ($date!=date("Ymd")) $date=date_to_str ($date, "__dd__ __month__, __week__", true, false, '', 1); else $date="Сегодня"; if ($date==$date_old) $date_out=""; else if ($date_old!='') $date_out=""; else $date_out=""; echo $date_out; // если не указано время не пишем его if (substr($time,0,2)=="-1: ") $time=''; echo show_afisha_index($id,$name,$place,$time); $date_old=$date; } echo "
$date
$date
";