$element) { $element = trim($element); $element = stripslashes($element); if( $element == "***client_name***" ) { echo $client_name; } else if( $element == "***calendar selection***" ) { if( $pass_style == month ) display_selection_button(); else display_selection(); } else if( $element == "***calendar content***" ) { display_calendar(); } else if( $element == "***large month view***" ) { display_large_month_view_link(); } else if( $element == "***list view***" ) { display_list_view_link(); } else if( $element == "***event list year***" ) { display_event_list_year(); } else if( $element == "***event list prev next***" ) { display_event_list_prev_next(); } else if( $element == "***event list***" ) { display_event_list(); } else { echo $element."\n"; } } // foreach($template as $key=>$element) // main function end ?> dayNames; } /* Set the array of strings used to label the days of the week. This array must contain seven elements, one for each day of the week. The first entry in this array represents Sunday. */ function setDayNames($names) { $this->dayNames = $names; } /* Get the array of strings used to label the months of the year. This array contains twelve elements, one for each month of the year. The first entry in this array represents January. */ function getMonthNames() { return $this->monthNames; } /* Set the array of strings used to label the months of the year. This array must contain twelve elements, one for each month of the year. The first entry in this array represents January. */ function setMonthNames($names) { $this->monthNames = $names; } /* Gets the start day of the week. This is the day that appears in the first column of the calendar. Sunday = 0. */ function getStartDay() { return $this->startDay; } /* Sets the start day of the week. This is the day that appears in the first column of the calendar. Sunday = 0. */ function setStartDay($day) { $this->startDay = $day; } /* Gets the start month of the year. This is the month that appears first in the year view. January = 1. */ function getStartMonth() { return $this->startMonth; } /* Sets the start month of the year. This is the month that appears first in the year view. January = 1. */ function setStartMonth($month) { $this->startMonth = $month; } /* Return the URL to link to in order to display a calendar for a given month/year. You must override this method if you want to activate the "forward" and "back" feature of the calendar. Note: If you return an empty string from this function, no navigation link will be displayed. This is the default behaviour. If the calendar is being displayed in "year" view, $month will be set to zero. */ function getCalendarLink($pass_category, $month, $year, $pass_style) { return ""; } /* Return the URL to link to for a given date. You must override this method if you want to activate the date linking feature of the calendar. Note: If you return an empty string from this function, no navigation link will be displayed. This is the default behaviour. */ function getDateLink($day, $month, $year) { return ""; } /* Return the HTML for the current month */ function getCurrentMonthView() { $d = getdate(time()); return $this->getMonthView($d["mon"], $d["year"]); } /* Return the HTML for the current year */ function getCurrentYearView() { $d = getdate(time()); return $this->getYearView($d["year"]); } /* Return the HTML for a specified month */ function getMonthView($pass_category, $month, $year, $pass_style) { return $this->getMonthHTML($pass_category, $month, $year, $pass_style); } function getMonthView_month($pass_category, $month, $year, $pass_style) { return $this->getMonthHTML_month($pass_category, $month, $year, $pass_style); } /* Return the HTML for a specified year */ function getYearView($year) { return $this->getYearHTML($year); } /******************************************************************************** The rest are private methods. No user-servicable parts inside. You shouldn't need to call any of these functions directly. *********************************************************************************/ /* Calculate the number of days in a month, taking into account leap years. */ function getDaysInMonth($month, $year) { if ($month < 1 || $month > 12) { return 0; } $d = $this->daysInMonth[$month - 1]; if ($month == 2) { // Check for leap year // Forget the 4000 rule, I doubt I'll be around then... if ($year%4 == 0) { if ($year%100 == 0) { if ($year%400 == 0) { $d = 29; } } else { $d = 29; } } } return $d; } /* Generate the HTML for a given month */ function getMonthHTML($pass_category, $m, $y, $pass_style, $showYear = 1) { global $client_name; global $calendar_title; $s = ""; $a = $this->adjustDate($m, $y); $month = $a[0]; $year = $a[1]; if( strlen($month ) == 1 ) $month0 = "0".$month ; else $month0 = $month ; $daysInMonth = $this->getDaysInMonth($month, $year); $date = getdate(mktime(12, 0, 0, $month, 1, $year)); $first = $date["wday"]; $monthName = $this->monthNames[$month - 1]; $prev = $this->adjustDate($month - 1, $year); $next = $this->adjustDate($month + 1, $year); if ($showYear == 1) { $prevMonth = $this->getCalendarLink($pass_category, $prev[0], $prev[1], $pass_style); $nextMonth = $this->getCalendarLink($pass_category, $next[0], $next[1], $pass_style); $currentMonth = $this->getCalendarLink($pass_category, date("m"), date("Y"), $pass_style); } else { $prevMonth = ""; $nextMonth = ""; } $header = $monthName . (($showYear > 0) ? " " . $year : ""); /* $s .= "\n"; $s .= "\n"; $s .= "\n"; $s .= "\n"; $s .= "
".$client_name."
$calendar_title
\n"; */ $s .= "\n"; $s .= "\n"; $s .= "\n"; $s .= "\n"; $s .= "
$header
\n"; $s .= "\n"; // $s .= "\n"; // $s .= "\n"; // $s .= "\n"; $s .= "\n"; $s .= "\n"; $s .= "\n"; $s .= "\n"; $s .= "\n"; $s .= "\n"; $s .= "\n"; $s .= "\n"; $s .= "\n"; $s .= "\n"; $s .= "\n"; $s .= "\n"; $s .= "\n"; $s .= "\n"; // We need to work out what date to start at so that the first appears in the correct column $d = $this->startDay + 1 - $first; while ($d > 1) { $d -= 7; } // Make sure we know when today is, so that we can use a different CSS style $today = getdate(time()); while ($d <= $daysInMonth) { $s .= "\n"; for ($i = 0; $i < 7; $i++) { if ($d > 0 && $d <= $daysInMonth) { if( strlen($d ) == 1 ) $d0 = "0".$d ; else $d0 = $d ; $class = ($year == $today["year"] && $month == $today["mon"] && $d == $today["mday"]) ? "calendarToday" : "calendar"; $s .= "\n"; $d++; } $s .= "\n"; } $s .= "
$header
Next
" . $this->dayNames[($this->startDay)%7] . "" . $this->dayNames[($this->startDay+1)%7] . "" . $this->dayNames[($this->startDay+2)%7] . "" . $this->dayNames[($this->startDay+3)%7] . "" . $this->dayNames[($this->startDay+4)%7] . "" . $this->dayNames[($this->startDay+5)%7] . "" . $this->dayNames[($this->startDay+6)%7] . "
"; $link = $this->getDateLink($pass_category, $d, $month, $year, $pass_style); $s .= (($link == "") ? "$d" : "$d"); } else { $s .= ""; $s .= " "; } $s .= "
\n"; return $s; } /* Generate the HTML for a given month */ function getMonthHTML_month($pass_category, $m, $y, $pass_style, $showYear = 1) { global $client_name; global $calendar_title; $s = ""; $a = $this->adjustDate($m, $y); $month = $a[0]; $year = $a[1]; $daysInMonth = $this->getDaysInMonth($month, $year); $date = getdate(mktime(12, 0, 0, $month, 1, $year)); $first = $date["wday"]; $monthName = $this->monthNames[$month - 1]; $prev = $this->adjustDate($month - 1, $year); $next = $this->adjustDate($month + 1, $year); if ($showYear == 1) { $prevMonth = $this->getCalendarLink($pass_category, $prev[0], $prev[1], $pass_style); $nextMonth = $this->getCalendarLink($pass_category, $next[0], $next[1], $pass_style); $currentMonth = $this->getCalendarLink($pass_category, date("m"), date("Y"), $pass_style); } else { $prevMonth = ""; $nextMonth = ""; } $header = $monthName . (($showYear > 0) ? " " . $year : ""); /* $s .= "\n"; $s .= "\n"; $s .= "\n"; $s .= "\n"; $s .= "
".$client_name."
$calendar_title
\n"; */ $s .= "\n"; $s .= "\n"; $s .= "\n"; $s .= "\n"; $s .= "
$header
\n"; $s .= "\n"; // $s .= "\n"; // $s .= "\n"; // $s .= "\n"; $s .= "\n"; $s .= "\n"; $s .= "\n"; $s .= "\n"; $s .= "\n"; $s .= "\n"; $s .= "\n"; $s .= "\n"; $s .= "\n"; $s .= "\n"; $s .= "\n"; $s .= "\n"; $s .= "\n"; $s .= "\n"; // We need to work out what date to start at so that the first appears in the correct column $d = $this->startDay + 1 - $first; while ($d > 1) { $d -= 7; } // Make sure we know when today is, so that we can use a different CSS style $today = getdate(time()); while ($d <= $daysInMonth) { $s .= "\n"; for ($i = 0; $i < 7; $i++) { if ($d > 0 && $d <= $daysInMonth) { $class = ($year == $today["year"] && $month == $today["mon"] && $d == $today["mday"]) ? "calendarToday" : "calendar"; $s .= "\n"; $d++; } $s .= "\n"; } $s .= "
$header
PREVCURRENTNEXT
" . $this->dayNames[($this->startDay)%7] . "" . $this->dayNames[($this->startDay+1)%7] . "" . $this->dayNames[($this->startDay+2)%7] . "" . $this->dayNames[($this->startDay+3)%7] . "" . $this->dayNames[($this->startDay+4)%7] . "" . $this->dayNames[($this->startDay+5)%7] . "" . $this->dayNames[($this->startDay+6)%7] . "
"; $link = $this->getDateLink($pass_category, $d, $month, $year, $pass_style); $s .= (($link == "") ? "$d" : "$d
$link"); $s .= ""; } else { $s .= "
"; $s .= " "; } $s .= "
\n"; return $s; } /* Generate the HTML for a given year */ function getYearHTML($year) { $s = ""; $prev = $this->getCalendarLink(0, $year - 1); $next = $this->getCalendarLink(0, $year + 1); $s .= "\n"; $s .= ""; $s .= "\n"; $s .= "\n"; $s .= "\n"; $s .= "\n"; $s .= ""; $s .= "\n"; $s .= "\n"; $s .= "\n"; $s .= "\n"; $s .= "\n"; $s .= "\n"; $s .= "\n"; $s .= "\n"; $s .= "\n"; $s .= "\n"; $s .= "\n"; $s .= "\n"; $s .= "\n"; $s .= "\n"; $s .= "\n"; $s .= "\n"; $s .= "\n"; $s .= "\n"; $s .= "\n"; $s .= "
" . (($prev == "") ? " " : "<<") . "" . (($this->startMonth > 1) ? $year . " - " . ($year + 1) : $year) ."" . (($next == "") ? " " : ">>") . "
" . $this->getMonthHTML(0 + $this->startMonth, $year, 0) ."" . $this->getMonthHTML(1 + $this->startMonth, $year, 0) ."" . $this->getMonthHTML(2 + $this->startMonth, $year, 0) ."
" . $this->getMonthHTML(3 + $this->startMonth, $year, 0) ."" . $this->getMonthHTML(4 + $this->startMonth, $year, 0) ."" . $this->getMonthHTML(5 + $this->startMonth, $year, 0) ."
" . $this->getMonthHTML(6 + $this->startMonth, $year, 0) ."" . $this->getMonthHTML(7 + $this->startMonth, $year, 0) ."" . $this->getMonthHTML(8 + $this->startMonth, $year, 0) ."
" . $this->getMonthHTML(9 + $this->startMonth, $year, 0) ."" . $this->getMonthHTML(10 + $this->startMonth, $year, 0) ."" . $this->getMonthHTML(11 + $this->startMonth, $year, 0) ."
\n"; return $s; } /* Adjust dates to allow months > 12 and < 0. Just adjust the years appropriately. e.g. Month 14 of the year 2001 is actually month 2 of year 2002. */ function adjustDate($month, $year) { $a = array(); $a[0] = $month; $a[1] = $year; while ($a[0] > 12) { $a[0] -= 12; $a[1]++; } while ($a[0] <= 0) { $a[0] += 12; $a[1]--; } if( $a[0] < 10 && ( strlen($a[0] ) == 1 ) ) $a[0] = "0".$a[0] ; return $a; } /* The start day of the week. This is the day that appears in the first column of the calendar. Sunday = 0. */ var $startDay = 0; /* The start month of the year. This is the month that appears in the first slot of the calendar in the year view. January = 1. */ var $startMonth = 1; /* The labels to display for the days of the week. The first entry in this array represents Sunday. */ var $dayNames = array("Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"); /* The labels to display for the months of the year. The first entry in this array represents January. */ var $monthNames = array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"); /* The number of days in each month. You're unlikely to want to change this... The first entry in this array represents January. */ var $daysInMonth = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31); } class MyCalendar extends Calendar { function getCalendarLink($pass_category, $month, $year, $pass_style) { // Redisplay the current page, but with some parameters // to set the new month and year $s = getenv('SCRIPT_NAME'); return "$s?pass_category=$pass_category&month=$month&year=$year&pass_style=$pass_style"; } function getDateLink($pass_category, $day, $month, $year, $pass_style) { global $calendar_data_file; if( strlen($day) == 1 ) $day = "0".$day; if( strlen($month) == 1 ) $month = "0".$month; // Only link the first day of every month $link = ""; // if ($day == 1) // { // $link = "Events for $month/$day/$year
link"; // } // return $link; //$file_name = "pressold.data"; $file_name = $calendar_data_file; $file_pointer = fopen($file_name, "r"); // "r" is the mode, or the action we're // going to perform on the file if (!$file_pointer) { die("Failed to open file $calendar_data_file."); } $count = 0; $printcount = 0; $s = fgets($file_pointer, 10000); while (!feof($file_pointer)) { list($index_no,$title,$category,$description,$address,$citystzip,$contact,$phone,$fax,$date1mm,$date1dd,$date1yy,$date2mm,$date2dd,$date2yy,$date3mm,$date3dd,$date3yy,$date4mm,$date4dd,$date4yy,$date5mm,$date5dd,$date5yy,$email,$pass_register, $pass_cost, $pass_marquee, $pass_address2, $pass_location, $pass_room, $date6mm, $date6dd, $date6yy, $date7mm, $date7dd, $date7yy, $date8mm, $date8dd, $date8yy, $date9mm, $date9dd, $date9yy, $date10mm, $date10dd, $date10yy, $pass_time1, $pass_time2, $pass_time3, $pass_time4, $pass_time5, $pass_time6, $pass_time7, $pass_time8, $pass_time9, $pass_time10)=explode("|",$s); if (trim($category) == $pass_category || $pass_category == 0) { $checkyear = substr($year,2); if ($date1yy == $year) { if ($date1mm == $month) { if ($date1dd == $day) { if ($printcount <= 2) { $printcount = $printcount + 1; $link = $link . "$title". "

"; } $count = $count + 1; } } } if ($date2yy == $year) { if ($date2mm == $month) { if ($date2dd == $day) { if ($printcount <= 2) { $printcount = $printcount + 1; $link = $link . "$title". "

"; } $count = $count + 1; } } } if ($date3yy == $year) { if ($date3mm == $month) { if ($date3dd == $day) { if ($printcount <= 2) { $printcount = $printcount + 1; $link = $link . "$title". "

"; } $count = $count + 1; } } } if ($date4yy == $year) { if ($date4mm == $month) { if ($date4dd == $day) { if ($printcount <= 2) { $printcount = $printcount + 1; $link = $link . "$title". "

"; } $count = $count + 1; } } } if ($date5yy == $year) { if ($date5mm == $month) { if ($date5dd == $day) { if ($printcount <= 2) { $printcount = $printcount + 1; $link = $link . "$title". "

"; } $count = $count + 1; } } } if ($date6yy == $year) { if ($date6mm == $month) { if ($date6dd == $day) { if ($printcount <= 2) { $printcount = $printcount + 1; $link = $link . "$title". "

"; } $count = $count + 1; } } } if ($date7yy == $year) { if ($date7mm == $month) { if ($date7dd == $day) { if ($printcount <= 2) { $printcount = $printcount + 1; $link = $link . "$title". "

"; } $count = $count + 1; } } } if ($date8yy == $year) { if ($date8mm == $month) { if ($date8dd == $day) { if ($printcount <= 2) { $printcount = $printcount + 1; $link = $link . "$title". "

"; } $count = $count + 1; } } } if ($date9yy == $year) { if ($date9mm == $month) { if ($date9dd == $day) { if ($printcount <= 2) { $printcount = $printcount + 1; $link = $link . "$title". "

"; } $count = $count + 1; } } } if ($date10yy == $year) { if ($date10mm == $month) { if ($date10dd == $day) { if ($printcount <= 2) { $printcount = $printcount + 1; $link = $link . "$title". "

"; } $count = $count + 1; } } } } // if ($category == $pass_category || $pass_category == 0) $s = fgets($file_pointer, 10000); } // while (!feof($file_pointer)) if (($count > 3) && ($printcount == 3)) { $link = $link . "More...". "

"; $count=0; } fclose($file_pointer); return $link; } // end of getDateLink } // end of class ?>
\n"; echo "\n"; echo "\n"; echo ''; echo "\n"; echo "\n"; echo '\n"; echo "\n"; echo "\n"; echo '\n"; echo "\n"; echo "
Search By
Category
\n"; echo "\n"; $file_name = $calendar_category_data_file; $file_pointer = fopen($file_name, "r"); // "r" is the mode, or the action we're // going to perform on the file if (!$file_pointer) { // die("Failed to open file pressold.data."); die("Failed to open file category.data."); } $s = fgets($file_pointer, 10000); while (!feof($file_pointer)) { list($index, $name)=explode("|", $s); $index_no[] = $index; $name_arr[] = $name; $s = fgets($file_pointer, 10000); } fclose($file_pointer); array_multisort($name_arr, SORT_ASC, SORT_STRING, $index_no); for( $i=0; $i$name_arr[$i]\n"; } else { echo "\n"; } } echo "\n"; echo "
Date
'; select_y_m_style( "month", $month, "year", $year, 2003, 2010, "n", "class=\"c_date_dropdown\"" ); echo "
'; echo "\n"; echo "
\n"; echo "
\n"; /* echo "
\n"; $d2 = getdate(time()); $curmonth = $d2["mon"]; $curyear = $d2["year"]; echo "\n"; echo "\n"; echo "\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; */ } function display_large_month_view_link(){ global $pass_category; global $month; global $year; $base_url = "$PHP_SELF?pass_category=$pass_category&month=$month&year=$year"; echo ''; echo ' '; echo ' '; echo ' '; echo ' '; echo '
Large Month View
'; } function display_event_list_year(){ global $pass_category; global $month; global $year; global $pass_style; $cal = new MyCalendar; $monthName = $cal->monthNames[$month - 1]; $header = "$monthName $year"; echo $header; } function display_event_list_prev_next(){ global $pass_category; global $month; global $year; global $pass_style; $cal = new MyCalendar; $a = $cal->adjustDate($month, $year); $month = $a[0]; $year = $a[1]; $prev = $cal->adjustDate($month - 1, $year); $next = $cal->adjustDate($month + 1, $year); $prevMonth = $cal->getCalendarLink($pass_category, $prev[0], $prev[1], $pass_style); $nextMonth = $cal->getCalendarLink($pass_category, $next[0], $next[1], $pass_style); $currentMonth = $cal->getCalendarLink($pass_category, date("m"), date("Y"), $pass_style); echo ''; echo ' '; echo ' '; echo ' '; echo ' '; echo ' '; echo '
PrevCurrentNext
'; } function display_list_view_link() { global $pass_category; global $month; global $year; $base_url = "$PHP_SELF?pass_category=$pass_category&month=$month&year=$year"; ?>
Print
\n"; echo '\n"; echo '\n"; echo "\n"; echo "
Search By: \n"; echo "\n"; $file_name = $calendar_category_data_file; $file_pointer = fopen($file_name, "r"); // "r" is the mode, or the action were // going to perform on the file if (!$file_pointer) { // die("Failed to open file pressold.data."); die("Failed to open file category.data."); } $s = fgets($file_pointer, 10000); while (!feof($file_pointer)) { list($index, $name)=explode("|", $s); $index_no[] = $index; $name_arr[] = $name; $s = fgets($file_pointer, 10000); } fclose($file_pointer); array_multisort($name_arr, SORT_ASC, SORT_STRING, $index_no); for( $i=0; $i$name_arr[$i]\n"; } else { echo "\n"; } } echo "\n"; echo "'; select_y_m_style( "month", $month, "year", $year, 2003, 2010, "n", "class=\"c_date_dropdown\"" ); echo "'; echo "\n"; echo "
\n"; echo "
\n"; /* echo "
\n"; $d2 = getdate(time()); $curmonth = $d2["mon"]; $curyear = $d2["year"]; echo "\n"; echo "\n"; echo "\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; */ } ?> getMonthView_month($pass_category, $month, $year, $pass_style); else echo $cal->getMonthView($pass_category, $month, $year, $pass_style); } function display_event_list() { global $calendar_data_file; global $pass_category; global $day; global $month; global $year; if( strlen($day) == 1 ) $day = "0".$day; if( strlen($month) == 1 ) $month = "0".$month; // Only link the first day of every month $link = ""; $data = file($calendar_data_file); foreach($data as $key=>$element) { $element = trim($element); $element = stripslashes($element); $pieces = explode("|", $element); //list($index_no,$title,$category_id,$description,$address,$citystzip,$contact,$phone,$fax,$mm1,$dd1,$yy1,$mm2,$dd2,$yy2,$mm3,$dd3,$yy3,$mm4,$dd4,$yy4,$mm5,$dd5,$yy5,$email)=explode("\t",$s); // 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24 if (trim($pieces[2]) == $pass_category || $pass_category == 0) { $checkyear = substr($year,2); if( ($pieces[11] == $year) && $pieces[9] == $month ) { $index_no[] = $pieces[0]; $title[] = $pieces[1]; $description[] = $pieces[2]; $datemm[] = $pieces[9]; $datedd[] = $pieces[10]; $dateyy[] = $pieces[11]; $category[] = $pieces[2]; } // date 1 if( $pieces[14] == $year && $pieces[12] == $month ) { $index_no[] = $pieces[0]; $title[] = $pieces[1]; $description[] = $pieces[2]; $datemm[] = $pieces[12]; $datedd[] = $pieces[13]; $dateyy[] = $pieces[14]; $category[] = $pieces[2]; } // date 2 if( $pieces[17] == $year && $pieces[15] == $month ) { $index_no[] = $pieces[0]; $title[] = $pieces[1]; $description[] = $pieces[2]; $datemm[] = $pieces[15]; $datedd[] = $pieces[16]; $dateyy[] = $pieces[17]; $category[] = $pieces[2]; } // date 3 if( $pieces[20] == $year && $pieces[18] == $month ) { $index_no[] = $pieces[0]; $title[] = $pieces[1]; $description[] = $pieces[2]; $datemm[] = $pieces[18]; $datedd[] = $pieces[19]; $dateyy[] = $pieces[20]; $category[] = $pieces[2]; } // date 4 if( $pieces[23] == $year && $pieces[21] == $month ) { $index_no[] = $pieces[0]; $title[] = $pieces[1]; $description[] = $pieces[2]; $datemm[] = $pieces[21]; $datedd[] = $pieces[22]; $dateyy[] = $pieces[23]; $category[] = $pieces[2]; } // date 5 if( $pieces[33] == $year && $pieces[31] == $month ) { $index_no[] = $pieces[0]; $title[] = $pieces[1]; $description[] = $pieces[2]; $datemm[] = $pieces[31]; $datedd[] = $pieces[32]; $dateyy[] = $pieces[33]; $category[] = $pieces[2]; } // date 6 if( $pieces[36] == $year && $pieces[34] == $month ) { $index_no[] = $pieces[0]; $title[] = $pieces[1]; $description[] = $pieces[2]; $datemm[] = $pieces[34]; $datedd[] = $pieces[35]; $dateyy[] = $pieces[36]; $category[] = $pieces[2]; } // date 7 if( $pieces[39] == $year && $pieces[37] == $month ) { $index_no[] = $pieces[0]; $title[] = $pieces[1]; $description[] = $pieces[2]; $datemm[] = $pieces[37]; $datedd[] = $pieces[38]; $dateyy[] = $pieces[39]; $category[] = $pieces[2]; } // date 8 if( $pieces[42] == $year && $pieces[40] == $month ) { $index_no[] = $pieces[0]; $title[] = $pieces[1]; $description[] = $pieces[2]; $datemm[] = $pieces[40]; $datedd[] = $pieces[41]; $dateyy[] = $pieces[42]; $category[] = $pieces[2]; } // date 9 if( $pieces[45] == $year && $pieces[43] == $month ) { $index_no[] = $pieces[0]; $title[] = $pieces[1]; $description[] = $pieces[2]; $datemm[] = $pieces[43]; $datedd[] = $pieces[44]; $dateyy[] = $pieces[45]; $category[] = $pieces[2]; } // date 10 } // category } // foreach($data as $key=>$element) if( count($index_no) > 0 ) array_multisort($dateyy, $datemm, $datedd, $title, SORT_ASC, SORT_STRING, $category, $index_no, $description); echo "\n"; for( $i=0; $i\n"); echo("\n"); echo("\n"); echo("\n"); echo("\n"); } echo("
$datemm[$i]/$datedd[$i]/$checkyear
$title[$i]
\n"); if( count($index_no) == 0 ) echo("No Events Found.\n"); } // end of getDateLink ?>