Note: this list is kept only as a demonstration for CVSNotice. For the latest CVS notices, see the Xaraya and Postnuke sites
View Statistics - Next Notice - Previous NoticeDirectory filter : [ all ] / postnuke_modules / postcalendar [ view in CVS ]
Date | Directory [filter] | File(s) [view] | Author [filter] |
07 Sep 2002 15:39:40 | postnuke_modules/postcalendar | pnadmin.php,1.27,1.28 pnadminapi.php,1.8,1.9 pnuser.php,1.53,1.54 pnuserapi.php,1.102,1.103 | Roger Raymond |
template clean up new modifiers |
Update of /home/cvsroot/postnuke_modules/postcalendar In directory ns7.hostnuke.net:/tmp/cvs-serv29655 Modified Files: pnadmin.php pnadminapi.php pnuser.php pnuserapi.php Log Message: template clean up new modifiers Index: pnadmin.php =================================================================== RCS file: /home/cvsroot/postnuke_modules/postcalendar/pnadmin.php,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** pnadmin.php 17 Jul 2002 17:28:33 -0000 1.27 --- pnadmin.php 7 Sep 2002 15:39:38 -0000 1.28 *************** *** 26,31 **** */ - /** * the main administration function --- 26,40 ---- */ + //************************************************************************ [...1544 lines suppressed...] + + $tpl->assign('FormSubmit',$form_submit); + + $output->Text($tpl->fetch($template_name.'/admin/submit.html')); + //$output->Text(postcalendar_footer()); return $output->GetOutput(); } *************** *** 2082,2086 **** $output->URL(pnModURL('postcalendar','admin','categories'),_EDIT_PC_CONFIG_CATEGORIES); $output->Text(' | '); ! $output->URL(pnModURL('postcalendar','admin','new'),_PC_CREATE_EVENT); //$output->Text(' | '); $output->Linebreak(); --- 2018,2022 ---- $output->URL(pnModURL('postcalendar','admin','categories'),_EDIT_PC_CONFIG_CATEGORIES); $output->Text(' | '); ! $output->URL(pnModURL('postcalendar','admin','submit'),_PC_CREATE_EVENT); //$output->Text(' | '); $output->Linebreak(); Index: pnadminapi.php =================================================================== RCS file: /home/cvsroot/postnuke_modules/postcalendar/pnadminapi.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** pnadminapi.php 19 Jul 2002 20:36:52 -0000 1.8 --- pnadminapi.php 7 Sep 2002 15:39:38 -0000 1.9 *************** *** 288,290 **** --- 288,493 ---- return true; } + function postcalendar_adminapi_eventDetail($args) + { + // get the theme globals :: is there a better way to do this? + pnThemeLoad(pnUserGetTheme()); + global $bgcolor1, $bgcolor2, $bgcolor3, $bgcolor4, $bgcolor5; + global $textcolor1, $textcolor2; + + extract($args); + if(!isset($eid)) { + return false; + } + if(!isset($nopop)) { + $nopop = false; + } + $uid = pnUserGetVar('uid'); + $output = new pnHTML(); + $output->SetInputMode(_PNH_VERBATIMINPUT); + + // let's load the User API so we can use it + if(!pnModAPILoad('postcalendar','user')) { + die('Could not load PostCalendar user API'); + } + // let's get the DB information + //pnModDBInfoLoad('postcalendar'); + list($dbconn) = pnDBGetConn(); + $pntable = pnDBGetTables(); + + $event = postcalendar_userapi_pcGetEventDetails($eid); + + $useinternationaldates = pnModGetVar('postcalendar','useinternationaldates'); + $eventsopeninnewwindow = pnModGetVar('postcalendar','eventsopeninnewwindow'); + $time24hours = pnModGetVar('postcalendar','time24hours'); + + /******************************************************************************** + START PAGE DISPLAY AREA + ********************************************************************************/ + $topics_table = $pntable['topics']; + $topics_column = &$pntable['topics_column']; + $topicsql = "SELECT $topics_column[topictext],$topics_column[topicimage] + FROM $topics_table + WHERE $topics_column[topicid] = $event[topic] + LIMIT 1"; + $topic_result = $dbconn->Execute($topicsql); + list($topictext,$topicimage) = $topic_result->fields; + + $Date_Array = explode("-", $event['eventDate']); + $endDate_Array = explode("-", $event['endDate']); + $Date_Array2 = explode(" ", $event['time']); + $Date_Array2 = explode("-",$Date_Array2[0]); + + if ($time24hours) { + $startTime = substr($event['startTime'],0,5); + //$endTime = substr($event['endTime'],0,5); + } else { + $startTime = pnModAPIFunc('postcalendar','user','getTime',array('time'=>$event['startTime'])); + //$endTime = pnModAPIFunc('postcalendar','user','getTime',array('time'=>$event['endTime'])); + } + + switch ($useinternationaldates) { + case 0: + $start_date_text = "$Date_Array[1]/$Date_Array[2]/$Date_Array[0]"; + $end_date_text = "$endDate_Array[1]/$endDate_Array[2]/$endDate_Array[0]"; + break; + case 1: + $start_date_text = "$Date_Array[2]/$Date_Array[1]/$Date_Array[0]"; + $end_date_text = "$endDate_Array[2]/$endDate_Array[1]/$endDate_Array[0]"; + break; + } + + $output->Text("<table cellspacing=\"0\" cellpadding=\"1\" bgcolor=$bgcolor2 width=\"100%\" valign=\"top\"><tr><td>"); + + $start_date_modurl = pnModURL('postcalendar','user','view',array('viewtype'=>'day','Date'=>$Date_Array[1].'/'.$Date_Array[2].'/'.$Date_Array[0])); + $end_date_modurl = pnModURL('postcalendar','user','view',array('viewtype'=>'day','Date'=>$endDate_Array[1].'/'.$endDate_Array[2].'/'.$endDate_Array[0])); + /*** START EVENT HEADER INFORMATION TABLE ***/ + $output->Text("<table cellspacing=\"0\" cellpadding=\"5\" bgcolor=$bgcolor2 width=\"100%\" valign=\"top\"><tr>"); + $output->Text('<td width="50%" align="left" valign="top">'); + $output->Text('<h2><img hspace="2" align="left" src="images/topics/'.$topicimage.'">'); + $output->Text(pnVarPrepForDisplay($event['title']).'</h2>'); + $output->Linebreak(); + $output->Text('</td><td>'); + + $target=''; + if($eventsopeninnewwindow && !$nopop) { + $target = 'target="csCalendar"'; + } + + $output->Text('<table width="100%" border="0" cellpadding="2" cellspacing="0"><tr>'); + $output->Text('<th align="left" valign="top">'._CALEVENTDATEPREVIEW.'</th>'); + $output->Text('<th align="left" valign="top">'._CALENDDATEPREVIEW.'</th>'); + $output->Text('</tr><tr>'); + $output->Text('<td align="left" valign="top">'); + $output->Text("<a class=\"pn-normal\" href=\"$start_date_modurl\" $target>$start_date_text</a>"); + $output->Text('</td>'); + + if (strtotime($event['eventDate']) != strtotime($event['endDate'])) { + $output->Text('<td align="left" valign="top">'); + $output->Text("<a class=\"pn-normal\" href=\"$end_date_modurl\" $target>$end_date_text</a>"); + $output->Text('</td>'); + } else { + $output->Text('<td align="left" valign="top">'); + $output->Text("<a class=\"pn-normal\" href=\"$end_date_modurl\" $target>"._CALSAMEDAY."</a>"); + $output->Text('</td>'); + } + + if (!$event['alldayevent']) { + $output->Text('<tr><td align="left" valign="top">'.$startTime.'</th>'); + //$output->Text('<td align="left" valign="top">'.$endTime.'</th></tr>'); + } elseif (pnModGetVar('postcalendar','showtimeonevents')) { + // all day events can have a start time + $output->Text('<tr><td align="left" valign="top">'.$startTime.'</td>'); + //$output->Text('<td align="left" valign="top">'.$endTime.'</th></tr>'); + } + + $output->Text("</tr></table>"); + + $output->Text("</td></tr></table>"); + /*** END EVENT HEADER INFORMATION TABLE ***/ + + /*** START EVENT INFORMATION TABLE ***/ + $output->Text("<table bgcolor=\"$bgcolor1\" width=\"100%\">"); + + $output->Text('<tr><td width="25%" valign="top"><font class="pn-normal">'._CALARTICLETEXT.'</td>'); + $output->Text('<td width="100%" valign="top"><b>'.pnVarPrepHTMLDisplay($event['hometext']).'</b></font></td></tr>'); + + if (!empty($location)) { + $output->Text('<tr><td width="25%" valign="top"><font class="pn-normal">'._CALLOCATION.'</td>'); + $output->Text('<td width="100%" valign="top"><b>'.pnVarPrepForDisplay($event['location']).'</b></font></td></tr>'); + } + if (!empty($conttel)) { + $output->Text('<tr><td width="25%" valign="top"><font class="pn-normal">'._CONTTEL.'</td>'); + $output->Text('<td width="100%" valign="top"><b>'.pnVarPrepForDisplay($event['conttel']).'</b></font></td></tr>'); + } + if (!empty($contname)) { + $output->Text('<tr><td width="25%" valign="top"><font class="pn-normal">'._CONTNAME.'</td>'); + $output->Text('<td width="100%" valign="top"><b>'.pnVarPrepForDisplay($event['contname']).'</b></font></td></tr>'); + } + if (!empty($contemail)) { + $output->Text('<tr><td width="25%" valign="top"><font class="pn-normal">'._CONTEMAIL.'</td>'); + $output->Text('<td width="100%" valign="top"><b>'.pnVarPrepForDisplay($event['contemail']).'</b></font></td></tr>'); + } + if (!empty($website)) { + $output->Text('<tr><td width="25%" valign="top"><font class="pn-normal">'._CONTWEBSITE.'</td>'); + $output->Text('<td width="100%" valign="top"><b>'.pnVarPrepForDisplay($event['website']).'</b></font></td></tr>'); + } + if (!empty($fee)) { + $output->Text('<tr><td width="25%" valign="top"><font class="pn-normal">'._FEE.'</td>'); + $output->Text('<td width="100%" valign="top"><b>'.pnVarPrepForDisplay($event['fee']).'</b></font></td></tr>'); + } + + $output->Text("</td></tr></table>"); + /*** END EVENT INFORMATION TABLE ***/ + + // format the posted on date + if(isset($event['time'])) { + list($posteddate,$postedtime) = explode(' ',$event['time']); + list($y,$m,$d) = explode('-',$posteddate); + list($h,$min,$s) = explode(':',$postedtime); + + if($useinternationaldates) { + $datePosted = date('d/m/Y',mktime($h,$min,$s,$m,$d,$y)); + } else { + $datePosted = date('m/d/Y',mktime($h,$min,$s,$m,$d,$y)); + } + + if($time24hours) { + $timePosted = date('H:i',mktime($h,$min,$s,$m,$d,$y)); + } else { + $timePosted = date('h:i A',mktime($h,$min,$s,$m,$d,$y)); + } + } + + /*** START EVENT FOOTER INFORMATION TABLE ***/ + $output->Text("<table bgcolor=\"$bgcolor1\" width=\"100%\"><tr><td width=\"100%\" valign=\"top\">"); + $output->Text("<font class=\"pn-tiny\">"._CALPOSTEDBY." <a href=\"user.php?op=userinfo&uname=$event[uname]\" target=\"csCalendar\">$event[uname]</a> "._CALPOSTEDON); + $output->Text(" $datePosted $timePosted</font></center>"); + $output->Text('</td></tr></table>'); + /*** END EVENT FOOTER INFORMATION TABLE ***/ + + $output->Text('</td></tr></table>'); + /*** START ADMIN LINKS ***/ + if (pnSecAuthAction(0, 'PostCalendar::', '::', ACCESS_EDIT)) { + $admin_edit_url = pnModURL('postcalendar','admin','submit',array('pc_event_id'=>$eid)); + $admin_delete_url = pnModURL('postcalendar','admin','adminevents',array('action'=>_ACTION_DELETE,'pc_event_id'=>$eid)); + + $output->Text("<center>[ <a class=\"pn-normal\" href=\"$admin_edit_url\" $target>"._EDIT."</a> | "); + $output->Text("<a class=\"pn-normal\" href=\"$admin_delete_url\" $target>"._DELETE."</a> ]</center>\n"); + } + /*** START USER ADMIN LINKS ***/ + if (pnSecAuthAction(0, "PostCalendar::", "$uid::$eid", ACCESS_EDIT)) { + //$admin_edit_url = pnModURL('postcalendar','admin','new',array('pc_event_id[]'=>$eid)); + //$admin_delete_url = pnModURL('postcalendar','admin','adminevents',array('action'=>_ACTION_DELETE,'pc_event_id[]'=>$eid)); + + //$output->Text("<center>[ <a class=\"pn-normal\" href=\"$admin_edit_url\" $target>"._EDIT."</a> | "); + //$output->Text("<a class=\"pn-normal\" href=\"$admin_delete_url\" $target>"._DELETE."</a> ]</center>\n"); + //$output->Text('JustGottaKnowImHere'); + } + + /******************************************************************************** + END PAGE DISPLAY AREA + ********************************************************************************/ + + return $output->GetOutput(); + } ?> Index: pnuser.php =================================================================== RCS file: /home/cvsroot/postnuke_modules/postcalendar/pnuser.php,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** pnuser.php 19 Jul 2002 21:11:31 -0000 1.53 --- pnuser.php 7 Sep 2002 15:39:38 -0000 1.54 *************** *** 69,74 **** function postcalendar_user_view() { - // Security check - important to do this as early as possible to avoid - // potential security holes or just too much wasted processing if (!pnSecAuthAction(0, 'PostCalendar::', '::', ACCESS_READ)) { $output->Text(_POSTCALENDARNOAUTH); --- 69,72 ---- *************** *** 116,119 **** --- 114,125 ---- function postcalendar_user_display($args) { + $output = new pnHTML(); + $output->SetInputMode(_PNH_VERBATIMINPUT); + + if (!pnSecAuthAction(0, 'PostCalendar::', '::', ACCESS_READ)) { + $output->Text(_POSTCALENDARNOAUTH); + return $output->GetOutput(); + } + list($eid, $viewtype, $Date) = pnVarCleanFromInput('eid', 'viewtype', 'Date'); extract($args); *************** *** 128,133 **** } - $output = new pnHTML(); - $output->SetInputMode(_PNH_VERBATIMINPUT); $imgsrc = '<img src="images/global/print.gif" border="0" alt="print" />'; --- 134,137 ---- Index: pnuserapi.php =================================================================== RCS file: /home/cvsroot/postnuke_modules/postcalendar/pnuserapi.php,v retrieving revision 1.102 retrieving revision 1.103 diff -C2 -d -r1.102 -r1.103 *** pnuserapi.php 19 Jul 2002 20:36:52 -0000 1.102 --- pnuserapi.php 7 Sep 2002 15:39:38 -0000 1.103 *************** *** 86,89 **** --- 86,90 ---- require_once('modules/'.$pcDir.'/pnincludes/Date/Calc.php'); require_once('modules/'.$pcDir.'/pnincludes/Benchmark/Timer.php'); + require_once('modules/'.$pcDir.'/smarty_plugins.php'); @define('SMARTY_DIR',"modules/$pcDir/pnincludes/Smarty/"); *************** *** 577,580 **** --- 578,582 ---- $tpl->register_function('pc_date_select','postcalendar_smarty_pcDateSelect'); $tpl->register_function('pc_url','postcalendar_smarty_pcURL'); + $tpl->register_modifier('pc_date_format','postcalendar_smarty_pc_date_format'); //================================================================= *************** *** 634,638 **** // Parse the template //================================================================= ! $output->Text($tpl->fetch($template_name.'/views/'.$viewtype.'/'.$template_view_load.'_view.html')); //================================================================= --- 636,640 ---- // Parse the template //================================================================= ! $output->Text($tpl->fetch($template_name.'/views/'.$viewtype.'/'.$template_view_load.'.html')); //================================================================= *************** *** 662,803 **** } - function postcalendar_userapi_createEventLink($args) - { - // get the theme globals :: is there a better way to do this? - pnThemeLoad(pnUserGetTheme()); - global $bgcolor1, $bgcolor2, $bgcolor3, $bgcolor4, $bgcolor5, $textcolor1, $textcolor2; - - extract($args); - // check the incoming arguments - if(!isset($event)) { return false; } - if(!isset($current_date)) { $current_date = date('Y-m-d'); } - if(!isset($dayofweek)) { $dayofweek = 1; } - if(!isset($forblock)) { $forblock = false; } - if(!isset($search)) { $search = false; } - if(!isset($usepopups)) { $usepopups = pnModGetVar('postcalendar','usepopups'); } - if(!isset($showdates)) { $showdates = false; } - if(!isset($notable)) { $notable = false; } - if(!isset($viewtype)) { $viewtype = 'month'; } - // get the PostCaledar Default Settings (if not overridden) - if(!isset($showtimeonevents)) { $showtimeonevents=pnModGetVar('postcalendar','showtimeonevents'); } - if(!isset($useinternationaldates)) { $useinternationaldates=pnModGetVar('postcalendar','useinternationaldates');} - if(!isset($eventsopeninnewwindow)) { $eventsopeninnewwindow=pnModGetVar('postcalendar','eventsopeninnewwindow');} - if(!isset($displayballs)) { $displayballs=pnModGetVar('postcalendar','displayballs');} - if(!isset($time24hours)) { $time24hours=pnModGetVar('postcalendar','time24hours');} - if(!isset($displaytopics)) { $displaytopics=pnModGetVar('postcalendar','displaytopics');} - - // grab the module's information - $modinfo = pnModGetInfo(pnModGetIDFromName('postcalendar')); - - // check the event's permissions - if (!pnSecAuthAction(0,'PostCalendar::Event',"$event[title]:$event[catname]:$event[eid]",ACCESS_READ)) { - return false; - } - - if ($eventsopeninnewwindow) { - $link = 'javascript:opencal('.$event['eid'].');'; - } else { - $link = pnModURL('postcalendar','user','view',array('viewtype'=>'details','eid'=>$event['eid'])); - } - - $output = new pnHTML(); - $output->SetInputMode(_PNH_VERBATIMINPUT); - $output->SetOutputMode(_PNH_KEEPOUTPUT); - - // source for the blank image so the table cell gets colored on most browsers - $img_src = '<img width="1" height="1" src="modules/'.pnVarPrepForOS($modinfo['directory']).'/pnimages/blankbar.gif" border="0"> '; - // text version - $colored_dot = '<font size="+2" color="'.$event['catcolor'].'"><b>·</b></font>'; - - $date_text = ''; - if($showdates) { - list($sy,$sm,$sd) = explode('-',$current_date); - if($useinternationaldates) { - $startDate = $sd.'/'.$sm.'/'.$sy; - } else { - $startDate = $sm.'/'.$sd.'/'.$sy; - } - $date_text = $startDate; - } - - if($showtimeonevents && !$event['alldayevent']) { - if (pnModGetVar('postcalendar','time24hours')) { - $time_Array = explode(":",$event['startTime']); - $startTime = $time_Array[0].":".$time_Array[1]; - } else { - $startTime = pnModAPIFunc('postcalendar','user','getTime',array('time'=>$event['startTime'])); - } - $time_text = $startTime.' '; - $time_text_popup = $startTime.' '; - if($viewtype != 'week') { - $time_text .= '<br />'; - $time_text_popup .= '<br />'; - } - } else { - $time_text = ''; - $time_text_popup = ''; - } - - if($search) { - $time_text = $event['eventDate'].' '.$startTime.'<br />'; - $time_text_popup = $event['eventDate'].' '.$startTime.'<br />'; - } - - if($usepopups) { - // clean up the results to make them javascript friendly - $desc = preg_replace('/[\r\n]/','<br /><br />',$event['hometext']); - $desc = preg_replace('/(<br[ \f\r\t\n\v\/]*>){3,}/i','<br /><br />',$desc); - // truncate desc - if(strlen($desc) > 250) { - $first_space = strpos(substr($desc,250,-1), ' '); - $desc = substr($desc,0,250+$first_space).'...'; - $desc .= '<br /><p align="right">('._PC_CLICK_FOR_MORE.')</p>'; - } - - if(!$forblock) { - $popuptext = "onmouseover=\"return overlib('" . - addslashes(pnVarPrepForDisplay(pnVarPrepHTMLDisplay($date_text.' '.$time_text_popup.$desc)))."',CAPTION,'" . - addslashes(pnVarPrepForDisplay(pnVarPrepHTMLDisplay($event['title'])))."');\" onmouseout=\"return nd();\"" ; - } else { - $popuptext = addslashes(pnVarPrepForDisplay(pnVarPrepHTMLDisplay($date_text.$time_text_popup.$event['title']))); - } - } else { - $popuptext = ''; - } - - list($dbconn) = pnDBGetConn(); - $pntable = pnDBGetTables(); - $topics_table = $pntable['topics']; - $topics_column = &$pntable['topics_column']; - $topicsql = "SELECT $topics_column[topictext],$topics_column[topicimage] - FROM $topics_table - WHERE $topics_column[topicid] = $event[topic] - LIMIT 1"; - $topic_result = $dbconn->Execute($topicsql); - list($topictext,$topicimage) = $topic_result->fields; - - if(!$forblock) { - if(!$notable) { - $output->Text('<table border="0" width="100%" cellpadding="0" cellspacing="5"><tr>'); - $output->Text('<td valign="top" align="left" width="1">'); - $output->Text($colored_dot); - $output->Text('</td>'); - $output->Text('<td valign="top" align="left" >'); - } - $output->Text('<a href="'.$link.'" '.$popuptext.'>'.$date_text.' '.$time_text.pnVarPrepForDisplay($event['title']).'</a>'); - if($displaytopics) { - $output->Linebreak(); - $output->Text('<font class="pn-sub">['.$topictext.']</font>'); - } - if(!$notable) { - $output->Text('</td></tr></table>'); - } - } else { - $output->Text($popuptext); - } - - return $output->GetOutput(); - } - /** * postcalendar_userapi_eventDetail --- 664,667 ---- *************** *** 1818,2009 **** $result->Close(); return $categories; - } - - //================================================================= - // PostCalendar Custom Smarty Functions - //================================================================= - function postcalendar_smarty_pcURL($args) - { - if(!isset($args['action'])) { - $args['action'] = 'month'; - } - $template_view = pnVarCleanFromInput('tplview'); - - $jumpday = pnVarCleanFromInput('jumpday'); - $jumpmonth = pnVarCleanFromInput('jumpmonth'); - $jumpyear = pnVarCleanFromInput('jumpyear'); - $Date = pnVarCleanFromInput('Date'); - - if(!isset($Date) || empty($Date)) { - // check for the jump vars - $time = time(); - $time += (pnUserGetVar('timezone_offset') - pnConfigGetVar('timezone_offset')) * 3600; - if(!empty($jumpday) || !empty($jumpmonth) || !empty($jumpyear)) { - $Date = "$jumpmonth/$jumpday/$jumpyear"; - } else { - $time = time(); - $time += (pnUserGetVar('timezone_offset') - pnConfigGetVar('timezone_offset')) * 3600; - $Date = ml_ftime('%m/%d/%Y',$time); - } - } - switch($args['action']) { - case 'submit' : - echo pnModURL('postcalendar','user','submit',array('tplview'=>$template_view,'Date'=>$Date)); - break; - case 'search' : - echo pnModURL('postcalendar','user','search'); - break; - case 'day' : - echo pnModURL('postcalendar','user','view',array('tplview'=>$template_view,'viewtype'=>'day','Date'=>$Date)); - break; - case 'week' : - echo pnModURL('postcalendar','user','view',array('tplview'=>$template_view,'viewtype'=>'week','Date'=>$Date)); - break; - case 'month' : - echo pnModURL('postcalendar','user','view',array('tplview'=>$template_view,'viewtype'=>'month','Date'=>$Date)); - break; - case 'year' : - echo pnModURL('postcalendar','user','view',array('tplview'=>$template_view,'viewtype'=>'year','Date'=>$Date)); - break; - case 'detail' : - if(!isset($args['eid'])) { - - } else { - echo pnModURL('postcalendar','user','view',array('tplview'=>$template_view,'viewtype'=>'details','eid'=>$args['eid'])); - } - break; - } - } - function postcalendar_smarty_pcDateFormat($args) - { - extract($args); - if(!isset($format)) { - $format = pnModGetVar('postcalendar','pcEventDateFormat'); - } - if(isset($date)) { - list($y,$m,$d) = explode('-',$date); - echo strftime($format,mktime(0,0,0,$m,$d,$y)); - } else { - echo strftime($format,time()); - } - } - - function postcalendar_smarty_pcTimeFormat($args) - { - } - - function postcalendar_smarty_pcEventURL($args) - { - extract($args); - $modinfo = pnModGetInfo(pnModGetIDFromName('postcalendar')); - //================================================================= - // Find out what Template we're using (n/a) - //================================================================= - $template_name = pnModGetVar('postcalendar','pcTemplate'); - if(!isset($template_name)) { - $template_name ='default'; - } - //================================================================= - // Find out what Template View to use - //================================================================= - $template_view = pnVarCleanFromInput('tplview'); - if(!isset($template_view)) { - $template_view ='default'; - } - list($y,$m,$d) = explode('-',$date); - $date = "$m/$d/$y"; - $PostCalendarURL = 'index.php?module='.pnVarPrepForOS($modinfo['name']); - if($view == 'details') { - echo $PostCalendarURL.'&func=view&tplview='.$template_view.'&viewtype='.$view.'&eid='.$eid; - } elseif($view == 'submit') { - echo $PostCalendarURL.'&func=submit&tplview='.$template_view.'&Date='.$date; - } else { - echo $PostCalendarURL.'&func=view&tplview='.$template_view.'&viewtype='.$view.'&Date='.$date; - } - } - - function postcalendar_smarty_pcDateSelect($args) - { - $useinternationaldate = pnModGetVar('postcalendar','useinternationaldates'); - list($Date,$d,$m,$y) = pnVarCleanFromInput('Date','jumpday','jumpmonth','jumpyear'); - if(isset($Date)) { - list($m,$d,$y) = explode('/',$Date); - } - if(!isset($args['day']) || strtolower($args['day']) == 'on') { - $args['day'] = true; - } else { - $args['day'] = false; - } - if(!isset($args['month']) || strtolower($args['month']) == 'on') { - $args['month'] = true; - } else { - $args['month'] = false; - } - if(!isset($args['year']) || strtolower($args['year']) == 'on') { - $args['year'] = true; - } else { - $args['year'] = false; - } - if(!isset($args['view']) || strtolower($args['view']) == 'on') { - $args['view'] = true; - } else { - $args['view'] = false; - } - if(!isset($args['form']) || strtolower($args['form']) == 'on') { - $args['form'] = true; - } else { - $args['form'] = false; - } - - $tplview = pnVarCleanFromInput('tplview'); - $viewtype = pnVarCleanFromInput('viewtype'); - - $dayselect=$monthselect=$yearselect=$viewselect=$fstart=$fend=''; - $output = new pnHTML(); - $output->SetOutputMode(_PNH_RETURNOUTPUT); - if($args['day'] === true) { - $sel_data = pnModAPIFunc('postcalendar','user','buildDaySelect',array('pc_day'=>$d)); - $dayselect = $output->FormSelectMultiple('jumpday', $sel_data); - } - - if($args['month'] === true) { - $sel_data = pnModAPIFunc('postcalendar','user','buildMonthSelect',array('pc_month'=>$m)); - $monthselect = $output->FormSelectMultiple('jumpmonth', $sel_data); - } - - if($args['year'] === true) { - $sel_data = pnModAPIFunc('postcalendar','user','buildYearSelect',array('pc_year'=>$y)); - $yearselect = $output->FormSelectMultiple('jumpyear', $sel_data); - } - if($args['view'] === true) { - $sel_data = array(); - $sel_data[0]['id'] = 'day'; - $sel_data[0]['selected'] = $viewtype=='day'; - $sel_data[0]['name'] = _CAL_DAYVIEW; - $sel_data[1]['id'] = 'week'; - $sel_data[1]['selected'] = $viewtype=='week'; - $sel_data[1]['name'] = _CAL_WEEKVIEW; - $sel_data[2]['id'] = 'month'; - $sel_data[2]['selected'] = $viewtype=='month'; - $sel_data[2]['name'] = _CAL_MONTHVIEW; - $sel_data[3]['id'] = 'year'; - $sel_data[3]['selected'] = $viewtype=='year'; - $sel_data[3]['name'] = _CAL_YEARVIEW; - $viewselect = $output->FormSelectMultiple('viewtype', $sel_data); - } - $jumpsubmit = $output->FormSubmit(_PC_JUMP_MENU_SUBMIT); - if($args['form'] === true) { - $fstart = $output->FormStart(pnModURL('postcalendar','user','view')); - $fend = $output->FormEnd(); - } - $tplview_hidden = $output->FormHidden('tplview',$tplview); - $output->SetOutputMode(_PNH_KEEPOUTPUT); - echo $fstart; - if($useinternationaldates) { - echo $monthselect,$dayselect,$yearselect,$viewselect,$jumpsubmit,$tplview_hidden; - } else { - echo $dayselect,$monthselect,$yearselect,$viewselect,$jumpsubmit,$tplview_hidden; - } - echo $fend; } ?> --- 1682,1685 ----
View Statistics - Next Notice - Previous Notice
Visit Developer Site - Browse CVS Repository |
Syndicate via backend.rss (max. once per hour please) | Powered by CVSNotice 0.1.3 |