From: Roger R. <eps...@us...> - 2002-04-29 00:27:40
|
Update of /cvsroot/pn-modules/PN_PostCalendar/modules/PostCalendar In directory usw-pr-cvs1:/tmp/cvs-serv21013 Modified Files: pnuserapi.php Log Message: new repeating events implementation started - CVS IS UNSTABLE Index: pnuserapi.php =================================================================== RCS file: /cvsroot/pn-modules/PN_PostCalendar/modules/PostCalendar/pnuserapi.php,v retrieving revision 1.68 retrieving revision 1.69 diff -C2 -d -r1.68 -r1.69 *** pnuserapi.php 29 Apr 2002 00:06:38 -0000 1.68 --- pnuserapi.php 29 Apr 2002 00:27:36 -0000 1.69 *************** *** 1207,1217 **** $timer->stop(); $output->Linebreak(); ! //$profile = array_pop($timer->getProfiling()); ! ob_start(); ! $profile = print_r($timer->getProfiling()); ! ! //$output->Text('<center><font style="font-size: 6pt;">'.$profile['total'].'</font></center>'); ! $output->Text('<pre>'.ob_get_contents().'</pre>'); ! ob_end_clean(); $output->Linebreak(); } --- 1207,1212 ---- $timer->stop(); $output->Linebreak(); ! $profile = array_pop($timer->getProfiling()); ! $output->Text('<center><font style="font-size: 6pt;">'.$profile['total'].'</font></center>'); $output->Linebreak(); } *************** *** 2493,2511 **** $dow = Date_Calc::dayOfWeek($nd,$nm,$ny); if($dow == 1 || $dow == 3) { ! list($ny,$nm,$nd) = explode('-',Date('Y-m-d',mktime(0,0,0,$nm,($nd+2),$ny))); ! $next = Date_Calc::dateToDays($nd,$nm,$ny); ! $nextday = $nextday+($next-$nextday); } elseif($dow == 5) { ! list($ny,$nm,$nd) = explode('-',Date('Y-m-d',mktime(0,0,0,$nm,($nd+3+($freq*7)),$ny))); ! $next = Date_Calc::dateToDays($nd,$nm,$ny); ! $nextday = $nextday+($next-$nextday); } else { // increment by one day until we get a mon, wed or fri match for $dow ! list($ny,$nm,$nd) = explode('-',Date('Y-m-d',mktime(0,0,0,$nm,($nd+1),$ny))); ! $next = Date_Calc::dateToDays($nd,$nm,$ny); ! $nextday = $nextday+($next-$nextday); } } ! $event_nextdate[$event['eid']] = $nextday; } --- 2488,2512 ---- $dow = Date_Calc::dayOfWeek($nd,$nm,$ny); if($dow == 1 || $dow == 3) { ! $nextday = $nextday+2; } elseif($dow == 5) { ! $nextday = $nextday+3+($freq*7); } else { // increment by one day until we get a mon, wed or fri match for $dow ! $nextday++; } } ! if($nextday == $startday) { ! list($ny,$nm,$nd) = explode('-',Date_Calc::daysToDate($daycount,'%Y-%m-%d')); ! $dow = Date_Calc::dayOfWeek($nd,$nm,$ny); ! if($dow == 0 || $dow == 2 || $dow == 4) { ! $event_nextdate[$event['eid']] = $nextday+1; ! } elseif($dow == 6) { ! $event_nextdate[$event['eid']] = $nextday+2; ! } else { ! $event_nextdate[$event['eid']] = $nextday; ! } ! } else { ! $event_nextdate[$event['eid']] = $nextday; ! } } *************** *** 2516,2526 **** $dow = Date_Calc::dayOfWeek($nd,$nm,$ny); if($dow == 1 || $dow == 3) { ! list($ny,$nm,$nd) = explode('-',Date('Y-m-d',mktime(0,0,0,$nm,($nd+2),$ny))); ! $next = Date_Calc::dateToDays($nd,$nm,$ny); ! $nextday = $nextday+($next-$nextday); } elseif($dow == 5) { ! list($ny,$nm,$nd) = explode('-',Date('Y-m-d',mktime(0,0,0,$nm,($nd+3+($freq*7)),$ny))); ! $next = Date_Calc::dateToDays($nd,$nm,$ny); ! $nextday = $nextday+($next-$nextday); } $event_nextdate[$event['eid']] = $nextday; --- 2517,2523 ---- $dow = Date_Calc::dayOfWeek($nd,$nm,$ny); if($dow == 1 || $dow == 3) { ! $nextday = $nextday+2; } elseif($dow == 5) { ! $nextday = $nextday+3+($freq*7); } $event_nextdate[$event['eid']] = $nextday; |