home *** CD-ROM | disk | FTP | other *** search
/ linuxmafia.com 2016 / linuxmafia.com.tar / linuxmafia.com / calendar-2010-08-23.tar.gz / calendar-2010-08-23.tar / calendar / search.php < prev    next >
PHP Script  |  2003-10-12  |  18KB  |  484 lines

  1. <?php
  2.  
  3. define('BASE','./');
  4. $current_view = 'search';
  5. $display_date = $results_lang;
  6. include('./functions/ical_parser.php');
  7.  
  8. if (isset($HTTP_SERVER_VARS['HTTP_REFERER']) && $HTTP_SERVER_VARS['HTTP_REFERER'] != '') {
  9.     $back_page = $HTTP_SERVER_VARS['HTTP_REFERER'];
  10. } else {
  11.     $back_page = BASE.$default_view.'.php?cal='.$cal.'&getdate='.$getdate;
  12. }
  13.  
  14. $search_valid = false;
  15. if (isset($HTTP_GET_VARS['query']) && $HTTP_GET_VARS['query'] != '') {
  16.     $query = $HTTP_GET_VARS['query'];
  17.     $search_valid = true;
  18. }
  19.  
  20. $search_box = '';
  21. // yet to be implemented
  22. switch($HTTP_GET_VARS['mode']) {
  23.     case 'advanced_search':
  24.         // display advanced search stuff
  25.         break;
  26.     case 'search':
  27.         // display simple search stuff
  28.         break;
  29.     case 'results':
  30.         // display results of either simple or advanced search
  31.         break;
  32.     default:
  33.         // some generic thing, maybe same as search
  34. }
  35.  
  36. $search_box .= 
  37.     '<form action="search.php" method="GET">'."\n".
  38.     '<input type="hidden" name="cal" value="'.$cal.'">'."\n".
  39.     '<input type="hidden" name="getdate" value="'.$getdate.'">'."\n".
  40.     '<input type="text" size="15" name="query" value="'.$query.'">'."\n".
  41.     '<INPUT type="image" src="styles/'.$style_sheet.'/search.gif" border=0 height="19" width="18" name="submit" value="Search">'."\n".
  42.     '</form>';
  43.  
  44. $search_started = getmicrotime();
  45. if ($search_valid) {
  46.     $format_search_arr = format_search($query);
  47.     if (!$format_search_arr[0]) {
  48.         $formatted_search = '<b>'.$no_query_lang.'</b>';
  49.     } else {
  50.         $formatted_search = $format_search_arr[0];
  51.     }
  52.     if (isset($master_array) && is_array($master_array)) {
  53.         foreach($master_array as $date_key_tmp => $date_tmp) {
  54.             if (is_array($date_tmp)) {
  55.                 foreach($date_tmp as $time_tmp) {
  56.                     if (is_array($time_tmp)) {
  57.                         foreach ($time_tmp as $uid_tmp => $event_tmp) {
  58.                             if (is_array($event_tmp)) {
  59.                                 if (!isset($the_arr[$uid_tmp]) || isset($event_tmp['exception'])) {
  60.                                     $results1 = search_boolean($format_search_arr,$event_tmp['event_text']);
  61.                                     if (!$results1) {
  62.                                         $results2 = search_boolean($format_search_arr,$event_tmp['description']);
  63.                                     }
  64.                                     if ($results1 || $results2) {
  65.                                         $event_tmp['date'] = $date_key_tmp;
  66.                                         if (isset($event_tmp['recur'])) {
  67.                                             $event_tmp['recur'] = format_recur($event_tmp['recur']);
  68.                                         }
  69.                                         if (isset($the_arr[$uid_tmp])) {
  70.                                             $the_arr[$uid_tmp]['exceptions'][] = $event_tmp;
  71.                                         } else {
  72.                                             $the_arr[$uid_tmp] = $event_tmp;
  73.                                         }
  74.                                     }
  75.                                 }
  76.                             }
  77.                         }
  78.                     }
  79.                 }
  80.             }
  81.         }
  82.     }
  83. } else {
  84.     $formatted_search = '<b>'.$no_query_lang.'</b>';
  85. }
  86. $search_ended = getmicrotime();
  87.  
  88. $search_took = number_format(($search_ended-$search_started),3);
  89.  
  90. include (BASE.'includes/header.inc.php'); 
  91.  
  92. ?>
  93.  
  94. <center>
  95. <table border="0" width="700" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF" class="calborder">
  96.     <tr>
  97.         <td>
  98.             <table width="100%" border="0" cellspacing="0" cellpadding="0">
  99.                   <tr>
  100.                       <td align="left" width="120" class="navback"><?php echo '<a href="'.$back_page.'"><img src="styles/'.$style_sheet.'/back.gif" alt="['.$back_lang.']" border="0" align="left"></a>'; ?></td>
  101.                       <td class="navback">
  102.                           <table width="100%" border="0" cellspacing="0" cellpadding="0">
  103.                               <tr>
  104.                                 <td align="center" class="navback" nowrap valign="middle"><font class="H20"><?php echo $results_lang; ?></font></td>
  105.                               </tr>
  106.                           </table>
  107.                       </td>
  108.                       <td align="right" width="120" class="navback">    
  109.                           <table width="120" border="0" cellpadding="0" cellspacing="0">
  110.                             <tr>
  111.                                 <td><?php echo '<a class="psf" href="day.php?cal='.$cal.'&getdate='.$getdate.'"><img src="styles/'.$style_sheet.'/day_on.gif" alt="'.$day_view_lang.'" border="0"></a></td>'; ?>
  112.                                 <td><?php echo '<a class="psf" href="week.php?cal='.$cal.'&getdate='.$getdate.'"><img src="styles/'.$style_sheet.'/week_on.gif" alt="'.$week_view_lang.'" border="0"></a></td>'; ?>
  113.                                 <td><?php echo '<a class="psf" href="month.php?cal='.$cal.'&getdate='.$getdate.'"><img src="styles/'.$style_sheet.'/month_on.gif" alt="'.$month_view_lang.'" border="0"></a></td>'; ?>
  114.                                 <td><?php echo '<a class="psf" href="year.php?cal='.$cal.'&getdate='.$getdate.'"><img src="styles/'.$style_sheet.'/year_on.gif" alt="'.$year_view_lang.'" border="0"></a></td>'; ?>
  115.                             </tr>
  116.                         </table>
  117.                     </td>
  118.                   </tr>
  119.               </table>
  120.           </td>
  121.     </tr>
  122.     <tr>
  123.         <td colspan="3"  class="dayborder"><img src="images/spacer.gif" width="1" height="5" alt=" "></td>
  124.     </tr>
  125.     <tr>
  126.         <td colspan="3">
  127.                 <table border="0" cellspacing="0" cellpadding="0" width="100%">
  128.                     <tr>
  129.                         <td align="center" valign="top">
  130.                             <table width="100%" border="0" cellspacing="0" cellpadding="0">
  131.                                 <tr>
  132.                                     <td colspan="3" height="1"></td>
  133.                                 </tr>                            
  134.                                 <tr>
  135.                                     <td colspan="3" class="G10B" align="center"><?php echo $query_lang.': '.$formatted_search; ?></td>
  136.                                 </tr>
  137.                                 <tr>
  138.                                     <td colspan="3" class="G10B"> </td>
  139.                                 </tr>                                
  140.                                 <?php    
  141.                                     if (isset($the_arr) && is_array($the_arr)) {
  142.                                         foreach($the_arr as $val) {
  143.                                             $key = $val['date'];
  144.                                             $dayofmonth = strtotime ($key);
  145.                                             $dayofmonth = localizeDate ($dateFormat_day, $dayofmonth);
  146.                                             echo "<tr><td width=\"10\"><img src=\"images/spacer.gif\" width=\"10\" height=\"1\" alt=\" \"></td>\n";
  147.                                             echo "<td align=\"left\" colspan=\"2\"><font class=\"V12\"><b><a class=\"ps3\" href=\"day.php?cal=$cal&getdate=$key\">$dayofmonth</a></b></font></td></tr>";
  148.                                             echo "<tr><td colspan=\"3\"><img src=\"images/spacer.gif\" width=\"1\" height=\"5\" alt=\" \"></td></tr>\n";
  149.                                             
  150.                                             if ($val["event_text"]) {    
  151.                                                 $event_text     = stripslashes(urldecode($val["event_text"]));
  152.                                                 $description     = stripslashes(urldecode($val["description"]));
  153.                                                 $event_start     = $val["event_start"];
  154.                                                 $event_end         = $val["event_end"];
  155.                                                 $event_start     = date ($timeFormat, strtotime ("$event_start"));
  156.                                                 $event_end         = date ($timeFormat, strtotime ("$event_end"));
  157.                                                 $event_start     = "$event_start - $event_end";
  158.                                                 if (!$val["event_start"]) { 
  159.                                                     $event_start = "$all_day_lang";
  160.                                                     $event_start2 = '';
  161.                                                     $event_end = '';
  162.                                                 }
  163.                                                 echo "<tr>\n";
  164.                                                 echo "<td width=\"10\"><img src=\"images/spacer.gif\" width=\"10\" height=\"1\" alt=\" \"></td>\n";
  165.                                                 echo "<td width=\"10\"><img src=\"images/spacer.gif\" width=\"10\" height=\"1\" alt=\" \"></td>\n";
  166.                                                 echo "<td align=\"left\">\n";
  167.                                                 echo "<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"1\">\n";
  168.                                                 echo "<tr>\n";
  169.                                                 echo "<td width=\"120\" class=\"G10BOLD\">$time_lang:</td>\n";
  170.                                                 echo "<td align=\"left\" class=\"G10B\">$event_start</td>\n";
  171.                                                 echo "</tr>\n";
  172.                                                 echo "<tr>\n";
  173.                                                 echo "<td valign=\"top\" width=\"100\" class=\"G10BOLD\">$summary_lang:</td>\n";
  174.                                                 echo "<td valign=\"top\" align=\"left\" class=\"G10B\">$event_text</td>\n";
  175.                                                 echo "</tr>\n";
  176.                                                 if (isset($val['recur'])) {
  177.                                                     $recur = $val['recur'];
  178.                                                     echo "<tr>\n";
  179.                                                     echo "<td valign=\"top\" width=\"100\" class=\"G10BOLD\">Recurring event:</td>\n";
  180.                                                     echo "<td valign=\"top\" align=\"left\" class=\"G10B\">$recur</td>\n";
  181.                                                     echo "</tr>\n";
  182.                                                 }
  183.                                                 if ($val["description"]) {
  184.                                                     echo "<tr>\n";
  185.                                                     echo "<td valign=\"top\" width=\"100\" class=\"G10BOLD\">$description_lang:</td>\n";
  186.                                                     echo "<td valign=\"top\" align=\"left\" class=\"G10B\">$description</td>\n";
  187.                                                     echo "</tr>\n";
  188.                                                 }
  189.                                                 echo "</table>\n";
  190.                                                 echo "</td>\n";
  191.                                                 echo "</tr>\n";            
  192.                                                 echo "<tr><td colspan=\"3\"><img src=\"images/spacer.gif\" width=\"1\" height=\"10\" alt=\" \"></td></tr>\n";
  193.                                                 if (isset($val['exceptions'])) {
  194.                                                     echo "<tr><td colspan=\"3\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n";
  195.                                                     foreach($val['exceptions'] as $val2) {
  196.                                                         $key = $val2['date'];
  197.                                                         $dayofmonth = strtotime ($key);
  198.                                                         $dayofmonth = localizeDate ($dateFormat_day, $dayofmonth);
  199.                                                         echo "<tr><td width=\"20\"><img src=\"images/spacer.gif\" width=\"20\" height=\"1\" alt=\" \"></td>\n";
  200.                                                         echo "<td align=\"left\" colspan=\"2\"><font class=\"V10\"><i>$exception_lang</i>: <a class=\"ps3\" href=\"day.php?cal=$cal&getdate=$key\">$dayofmonth</a></font></td></tr>";
  201.                                                         echo "<tr><td colspan=\"3\"><img src=\"images/spacer.gif\" width=\"1\" height=\"5\" alt=\" \"></td></tr>\n";
  202.                                                         
  203.                                                         if ($val2["event_text"]) {    
  204.                                                             $event_text     = stripslashes(urldecode($val2["event_text"]));
  205.                                                             $description     = stripslashes(urldecode($val2["description"]));
  206.                                                             $event_start     = $val2["event_start"];
  207.                                                             $event_end         = $val2["event_end"];
  208.                                                             $event_start     = date ($timeFormat, strtotime ("$event_start"));
  209.                                                             $event_end         = date ($timeFormat, strtotime ("$event_end"));
  210.                                                             $event_start     = "$event_start - $event_end";
  211.                                                             if (!$val2["event_start"]) { 
  212.                                                                 $event_start = "$all_day_lang";
  213.                                                                 $event_start2 = '';
  214.                                                                 $event_end = '';
  215.                                                             }
  216.                                                             echo "<tr>\n";
  217.                                                             echo "<td width=\"10\"><img src=\"images/spacer.gif\" width=\"10\" height=\"1\" alt=\" \"></td>\n";
  218.                                                             echo "<td width=\"10\"><img src=\"images/spacer.gif\" width=\"10\" height=\"1\" alt=\" \"></td>\n";
  219.                                                             echo "<td align=\"left\">\n";
  220.                                                             echo "<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"1\">\n";
  221.                                                             echo "<tr>\n";
  222.                                                             echo "<td width=\"100\" class=\"V10\">$time_lang:</td>\n";
  223.                                                             echo "<td align=\"left\" class=\"V10\">$event_start</td>\n";
  224.                                                             echo "</tr>\n";
  225.                                                             echo "<tr>\n";
  226.                                                             echo "<td valign=\"top\" width=\"100\" class=\"V10\">$summary_lang:</td>\n";
  227.                                                             echo "<td valign=\"top\" align=\"left\" class=\"V10\">$event_text</td>\n";
  228.                                                             echo "</tr>\n";
  229.                                                             if (isset($val2['recur'])) {
  230.                                                                 $recur = $val2['recur'];
  231.                                                                 echo "<tr>\n";
  232.                                                                 echo "<td valign=\"top\" width=\"100\" class=\"V10\">$recurring_event_lang:</td>\n";
  233.                                                                 echo "<td valign=\"top\" align=\"left\" class=\"V10\">$recur</td>\n";
  234.                                                                 echo "</tr>\n";
  235.                                                             }
  236.                                                             if ($val2["description"]) {
  237.                                                                 echo "<tr>\n";
  238.                                                                 echo "<td valign=\"top\" width=\"100\" class=\"V10\">$description_lang:</td>\n";
  239.                                                                 echo "<td valign=\"top\" align=\"left\" class=\"V10\">$description</td>\n";
  240.                                                                 echo "</tr>\n";
  241.                                                             }
  242.                                                             echo "</table>\n";
  243.                                                             echo "</td>\n";
  244.                                                             echo "</tr>\n";            
  245.                                                             echo "<tr><td colspan=\"3\"><img src=\"images/spacer.gif\" width=\"1\" height=\"10\" alt=\" \"></td></tr>\n";
  246.                                                         }
  247.                                                     }
  248.                                                     echo "</table></td><tr>\n";
  249.                                                 }
  250.                                             }
  251.                                         }
  252.                                     } else {
  253.                                         echo '<tr><td colspan="3" class="G10B" align="center">';
  254.                                         echo $no_results_lang;
  255.                                         echo '</td></tr><tr><td class="G10B"> </td></tr>';
  256.                                     }
  257.                                         
  258.                                     
  259.                                 
  260.                                 ?>
  261.                                 <tr>
  262.                                     <td colspan="3" class="G10B" align="center"><?php echo $search_box; ?></td>
  263.                                 </tr>    
  264.                                 <tr>
  265.                                     <td colspan="3" class="G10B" align="center">
  266.                                     <?php 
  267.                                         echo '<font class="V9G">'.sprintf($search_took_lang,$search_took).'</font><br><br>';
  268.                                     ?>
  269.                                     </td>
  270.                                 </tr>
  271.                             </table>
  272.                         </td>
  273.                     </tr>
  274.                 </table>        
  275.         </td>
  276.     </tr>
  277. </table>
  278. </center>
  279. <?php 
  280.  
  281. include (BASE.'includes/footer.inc.php');
  282.  
  283.  
  284. // takes a boolean search and formats it into an array
  285. // use with sister function search_boolean()
  286. function format_search($search_str) {
  287.     // init arrays
  288.     $and_arr = array();
  289.     $or_arr = array();
  290.     $not_arr = array();
  291.     $or_str_arr = array();
  292.  
  293.     $search_str = strtolower($search_str);
  294.     
  295.     if ($search_str == ' ') return array(false,$and_arr,$or_arr,$not_arr);
  296.     
  297.     // clean up search string
  298.     $search_str = trim($search_str);
  299.     $search_str = str_replace(' and ', ' ', $search_str);
  300.     $search_str = str_replace(' - ', ' ', $search_str);
  301.     $search_str = ereg_replace('[[:space:]]+',' ', $search_str);
  302.     $search_str = str_replace(' not ', ' -', $search_str);
  303.     
  304.     // start out with an AND array of all the items
  305.     $and_arr = explode(' ', $search_str);
  306.     $count = count($and_arr);
  307.     $j = 0;
  308.     
  309.     // build an OR array from the items in AND
  310.     for($i=0;$i<$count;$i++) {
  311.         if ($i != 0 && $and_arr[$i] == 'or') {
  312.             while ($and_arr[$i] == 'or') {
  313.                 $or_arr[$j][] = $and_arr[$i-1];
  314.                 unset($and_arr[$i], $and_arr[$i-1]);
  315.                 $i += 2;
  316.             }
  317.             if (isset($and_arr[$i-1])) {
  318.                 $or_arr[$j][] = $and_arr[$i-1];
  319.                 unset($and_arr[$i-1]);
  320.             }
  321.             $or_str_arr[$j] = implode('</b> OR <b>', $or_arr[$j]);
  322.             $j++;
  323.         }
  324.     }
  325.  
  326.     // build a NOT array from the items in AND
  327.     foreach($and_arr as $key => $val) {
  328.         if (substr($val,0,1) == '-') {
  329.             $not_arr[] = substr($val,1);
  330.             unset($and_arr[$key]);
  331.         } elseif(substr($val,0,1) == '+') {
  332.             $and_arr[] = substr($val,1);
  333.             unset($and_arr[$key]);
  334.         }
  335.     }
  336.     
  337.     // prepare our formatted search string
  338.     if (count($and_arr) > 1) {
  339.         $final_str_arr[] = implode('</b> AND <b>', $and_arr);
  340.     } elseif (isset($and_arr[0]) && $and_arr[0] != '') {
  341.         $final_str_arr[] = $and_arr[0];
  342.     }
  343.     
  344.     if (count($or_str_arr) > 1) {
  345.         $final_str_arr[] = implode('</b> AND <b>', $or_str_arr);
  346.     } elseif (isset($or_str_arr[0]) && $or_str_arr[0] != '') {
  347.         $final_str_arr[] = $or_str_arr[0];
  348.     }
  349.     
  350.     if (count($not_arr) > 1) {
  351.         $final_str_arr[] = '-'.implode('</b> AND <b>-', $not_arr);
  352.     } elseif (isset($not_arr[0]) && $not_arr[0] != '') {
  353.         $final_str_arr[] = '-'.$not_arr[0];
  354.     }
  355.     
  356.     if (count($final_str_arr) > 1) {
  357.         $formatted_search = '<b>'.implode('</b> AND <b>', $final_str_arr).'</b>';
  358.     } else {
  359.         $formatted_search = '<b>'.$final_str_arr[0].'</b>';
  360.     }
  361.     
  362.     return array($formatted_search, $and_arr, $or_arr, $not_arr);
  363. }
  364.  
  365. // takes an array made by format_search() and checks to see if it 
  366. // it matches against a string
  367. function search_boolean($needle_arr, $haystack) {
  368.     // init arrays
  369.     $and_arr = $needle_arr[1];
  370.     $or_arr = $needle_arr[2];
  371.     $not_arr = $needle_arr[3];
  372.     
  373.     if (!$needle_arr[0]) return false;
  374.     if ((sizeof($and_arr) == 0) &&
  375.         (sizeof($or_arr) == 0) &&
  376.         (sizeof($not_arr) == 0)) return false;
  377.     
  378.     // compare lowercase versions of the strings
  379.     $haystack = strtolower($haystack);
  380.  
  381.     // check against the NOT
  382.     foreach($not_arr as $s) {
  383.         if (is_string(strstr($haystack,$s)) == true) {
  384.             return false;
  385.         }
  386.     }
  387.     
  388.     // check against the AND
  389.     foreach($and_arr as $s) {
  390.         if (is_string(strstr($haystack,$s)) == false) {
  391.             return false;
  392.         }
  393.     }
  394.     
  395.     // check against the OR
  396.     foreach($or_arr as $or) {
  397.         $is_false = true;
  398.         foreach($or as $s) {
  399.             if (substr($s,0,1) == '-') {
  400.                 if (is_string(strstr($haystack,substr($s,1))) == false) {
  401.                     $is_false = false;
  402.                     break;
  403.                 }            
  404.             } elseif (is_string(strstr($haystack,$s)) == true) {
  405.                 $is_false = false;
  406.                 break;
  407.             }
  408.         }
  409.         if ($is_false) return false;    
  410.     }
  411.     // if we haven't returned false, then we return true
  412.     return true;
  413. }
  414.  
  415. function format_recur($arr) {
  416.     global $format_recur_lang, $monthsofyear_lang, $daysofweek_lang;
  417.     
  418.     $d = $format_recur_lang['delimiter'];
  419.     $int = $arr['INTERVAL'];
  420.     $tmp = (($int == '1') ? 0 : 1);
  421.     
  422.     $freq = $arr['FREQ'];
  423.     $freq = $format_recur_lang[$freq][$tmp];
  424.     
  425.     if        (isset($arr['COUNT']))    $for = str_replace('%int%',$arr['COUNT'],$format_recur_lang['count']);
  426.     elseif    (isset($arr['UNTIL']))    $for = str_replace('%date%',$arr['UNTIL'], $format_recur_lang['until']);
  427.     else                            $for = '';
  428.     
  429.     $print = $format_recur_lang['start'];
  430.     $print = str_replace('%int%', $int, $print);
  431.     $print = str_replace('%freq%', $freq, $print);
  432.     $print = str_replace('%for%', $for, $print);
  433.     
  434.     if (isset($arr['BYMONTH'])) {
  435.         $list = '';
  436.         $last = count($arr['BYMONTH']) - 1;
  437.         foreach ($arr['BYMONTH'] as $key => $month) {
  438.             if ($key == $last)    $list .= $monthsofyear_lang[($month-1)];
  439.             else                 $list .= $monthsofyear_lang[($month-1)].$d;
  440.         }
  441.         $print .= '<br>'."\n";
  442.         $print .= str_replace('%list%', $list, $format_recur_lang['bymonth']);
  443.     }
  444.     
  445.     if (isset($arr['BYMONTHDAY'])) {
  446.         $list = '';
  447.         if ($arr['BYMONTHDAY'][(count($arr['BYMONTHDAY']) - 1)] == '0') unset($arr['BYMONTHDAY'][$last]);
  448.         $last = count($arr['BYMONTHDAY']) - 1;
  449.         foreach ($arr['BYMONTHDAY'] as $key => $day) {
  450.             ereg('(-{0,1})([0-9]{1,2})',$day,$regs);
  451.             list($junk,$sign,$day) = $regs;
  452.             if ($sign != '')    $list .= $sign;
  453.             if ($key == $last)    $list .= $day;
  454.             else                $list .= $day.$d;
  455.         }
  456.         $print .= '<br>'."\n";
  457.         $print .= str_replace('%list%', $list, $format_recur_lang['bymonthday']);
  458.     }
  459.     
  460.     if (isset($arr['BYDAY'])) {
  461.         $list = '';
  462.         $last = count($arr['BYDAY']) - 1;
  463.         foreach ($arr['BYDAY'] as $key => $day) {
  464.             ereg('([-\+]{0,1})([0-9]{0,1})([A-Z]{2})',$day,$regs);
  465.             list($junk,$sign,$day_num,$day_txt) = $regs;
  466.             $num = two2threeCharDays($day_txt,false);
  467.             if ($sign != '')    $list .= $sign;
  468.             if ($day_num != '')    $list .= $day_num.' ';
  469.             if ($key == $last)    $list .= $daysofweek_lang[$num];
  470.             else                $list .= $daysofweek_lang[$num].$d;
  471.         }
  472.         $print .= '<br>'."\n";
  473.         $print .= str_replace('%list%', $list, $format_recur_lang['byday']);
  474.     }
  475.     
  476.     return $print;
  477. }
  478.  
  479. function getmicrotime() { 
  480.     list($usec, $sec) = explode(' ',microtime()); 
  481.     return ((float)$usec + (float)$sec); 
  482. }
  483. ?>
  484.