Return to the eDigest

"; $result_digest = mysql_query ("select event_id,headline,text,date_submitted,user_date_range, event_time, event_location from events where (status = 'ap' or status = 'em' or status = 'ex') and event_type = 'digest' and date_submitted>=(CURDATE() -INTERVAL 30 DAY) order by date_submitted DESC, event_id") or die (mysql_error()); $the_date = ""; while ($row_digest = mysql_fetch_row ($result_digest)) { $info=''; $info.=($row_digest[4]?', '.$row_digest[4]:''); $info.=($row_digest[5]?', '.$row_digest[5]:''); $info.=($row_digest[6]?', '.$row_digest[6]:''); $description = $row_digest[2]; # $pattern = "(\w+://[A-Za-z0-9./_]+[^ .<\r])"; #$pattern = "(\w+://[A-Za-z0-9/\\-_.]+)"; $pattern = "(\w+://[\w-/_.?=&~]+[a-zA-Z0-9])"; $replacement = "$0"; $description = preg_replace("([^http://]www\.)"," http://www.",$description); $description = preg_replace($pattern,$replacement,$description); if ($the_date == $row_digest[3]) {} else { list($year,$month,$day) = split('-', $row_digest[3]); echo "


$month/$day/$year Digest


"; $the_date = $row_digest[3]; } print ("

$row_digest[1] $info

$description

"); } mysql_free_result ($result_digest); echo "

Return to the eDigest

"; echo"

\"\"
"; } ?>

The Smith eDigest is sent to all campus email accounts on Tuesday and Thursday each week during the academic year, and on Tuesday during the summer, providing important notices, college news, links to articles of general interest to the community, deadline notifications, and other college information.

'0000-00-00' AND admin_date$x>(date_add($search_interval)) ". " GROUP BY admin_date$x"; $result=mysql_query($query); while($row=mysql_fetch_row($result)) array_push($array_dates,$row[0]); } $array_dates=array_unique($array_dates); sort($array_dates); $array_dates=array_reverse($array_dates); //find the last pub date (could be today). $pub_date_prev=''; foreach($array_dates as $the_date) //search most recent back in time { if($the_date<=$today_date && !$pub_date_prev) $pub_date_prev=$the_date; //could be current day if today is pub date (and items have been processed) } //get all items from the previous pub date $result_digest = mysql_query ("select event_id,headline, text, date_submitted, cal_header, rank, sort_order, user_date_range, event_time, event_location, arch_ver_img_name from events LEFT JOIN event_categories ON events.cal_header=event_categories.category where (status = 'ap' or status = 'em') and event_type = 'digest' and ( (admin_date1='$pub_date_prev' AND admin_date1=date_submitted) OR (admin_date2='$pub_date_prev' AND admin_date2=date_submitted) OR (admin_date3='$pub_date_prev' AND admin_date3=date_submitted) OR (admin_date4='$pub_date_prev' AND admin_date4=date_submitted) ) order by sort_order, rank, admin_sort_date, event_id"); $the_cat=""; $the_date = ""; while ($row_digest = mysql_fetch_array ($result_digest)) if ($row_digest['cal_header'] != "Gate Story") { { $info=''; $info.=($row_digest['user_date_range']?'
'.$row_digest['user_date_range']:''); $info.=($row_digest['event_time']?', '.$row_digest['event_time']:''); $info.=($row_digest['event_location']?', '.$row_digest['event_location']:''); $description = $row_digest['text']; # $pattern = "(\w+://[A-Za-z0-9./_]+[^ .<\r])"; #$pattern = "(\w+://[A-Za-z0-9/\\-_.]+)"; $pattern = "(\w+://[\w-/_.?=&~]+[a-zA-Z0-9])"; $replacement = "$0"; $description = preg_replace("([^http://]www\.)"," http://www.",$description); $description = preg_replace($pattern,$replacement,$description); if ($the_date == $row_digest['date_submitted']) {} //show header once else { list($year,$month,$day) = split('-', $row_digest['date_submitted']); echo "


$month/$day/$year Digest


"; $the_date = $row_digest['date_submitted']; } if ($the_cat == $row_digest['cal_header']) {} else { $cat_img=''; $the_cat = $row_digest['cal_header']; //show image if there is one, otherwise header text echo '

'.($row_digest['cal_header']).'

'; } echo '

'.$row_digest['headline'].$info.'

'; echo '

'.$description.'

'; } } mysql_free_result ($result_digest); ?>