All pastes #949787 Raw Edit

Miscellany

public php v1 · immutable
·published 2008-03-20 01:17 UTC
rendered paste body
<?class iCalendar{	/**	 * Create iCalendar Event	 * 	 * @param - $info (array) - Item Information, 'title' and 'msg' elements	 * @param - $data (arra) - 'start' and 'end' in unix_timestamp()	 * @param - $filename (string) - Filename to create as	 */	function create ($info, $date, $filename = "RANDOM")	{		global $main;				header("Content-Type: text/x-vCalendar");		    		if ($filename == "RANDOM")		{			$main->core->build->create_uid("6", "alphanumeric");		}				header("Content-Disposition: inline; filename=" . $filename . ".vcs");				$info['title'] = preg_replace("/[\r\n]/", " ", $info['title']);		$info['msg'] = preg_replace("/[\r\n]/", "=0D=0A=\n", $info['msg']);		$date['start'] = date("Ymd\THi00", $date['start']);		$date['end'] = date("Ymd\THi00", $date['end']);				print "BEGIN:VCALENDAR\n";		print "VERSION:1.0\n";		print "PRODID:Upkeep Content Management System\n";		print "TZ:+12\n";		print "BEGIN:VEVENT\n";		print "SUMMARY:" . $info['title'] . "\n";		print "DESCRIPTION;ENCODING=QUOTED-PRINTABLE: " . $info['msg'] . "\n";		print "DTSTART:" . $date['start'] . "\n";		print "DTEND:" . $date['end'] . "\n";		print "END:VEVENT\n";		print "END:VCALENDAR";		exit();				}}?>