当前位置: 首页>>代码示例>>PHP>>正文


PHP JevDate::strftime方法代码示例

本文整理汇总了PHP中JevDate::strftime方法的典型用法代码示例。如果您正苦于以下问题:PHP JevDate::strftime方法的具体用法?PHP JevDate::strftime怎么用?PHP JevDate::strftime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在JevDate的用法示例。


在下文中一共展示了JevDate::strftime方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getAdjacentYear

 function getAdjacentYear($year, $month, $day, $direction = 1)
 {
     $d1 = JevDate::mktime(0, 0, 0, $month, $day, $year + $direction);
     $day = JevDate::strftime("%d", $d1);
     $year = JevDate::strftime("%Y", $d1);
     $params = JComponentHelper::getParams(JEV_COM_COMPONENT);
     $cfg = JEVConfig::getInstance();
     if (method_exists("JEVHelper", "getMinYear")) {
         $earliestyear = JEVHelper::getMinYear();
         $latestyear = JEVHelper::getMaxYear();
     } else {
         $earliestyear = $params->get("com_earliestyear", 1970);
         $latestyear = $params->get("com_latestyear", 2150);
     }
     if ($year > $latestyear || $year < $earliestyear) {
         return false;
     }
     $month = JevDate::strftime("%m", $d1);
     $task = JRequest::getString('jevtask');
     $Itemid = JEVHelper::getItemid();
     if (isset($Itemid)) {
         $item = "&Itemid={$Itemid}";
     } else {
         $item = "";
     }
     return JRoute::_("index.php?option=" . JEV_COM_COMPONENT . "&task={$task}{$item}&year={$year}&month={$month}&day={$day}");
 }
开发者ID:madcsaba,项目名称:li-de,代码行数:27,代码来源:view.html.php

示例2: getAdjacentYear

 function getAdjacentYear($year, $month, $day, $direction = 1)
 {
     $d1 = JevDate::mktime(0, 0, 0, $month, $day, $year + $direction);
     $day = JevDate::strftime("%d", $d1);
     $year = JevDate::strftime("%Y", $d1);
     $cfg =& JEVConfig::getInstance();
     $earliestyear = $cfg->get('com_earliestyear');
     $latestyear = $cfg->get('com_latestyear');
     if ($year > $latestyear || $year < $earliestyear) {
         return false;
     }
     $month = JevDate::strftime("%m", $d1);
     $task = JRequest::getString('jevtask');
     $Itemid = JEVHelper::getItemid();
     if (isset($Itemid)) {
         $item = "&Itemid={$Itemid}";
     } else {
         $item = "";
     }
     return JRoute::_("index.php?option=" . JEV_COM_COMPONENT . "&task={$task}{$item}&year={$year}&month={$month}&day={$day}");
 }
开发者ID:andreassetiawanhartanto,项目名称:PDKKI,代码行数:21,代码来源:view.html.php

示例3: getEventStringArray

 static function getEventStringArray($row)
 {
     $urlString['title'] = urlencode($row->title());
     $params = JComponentHelper::getParams(JEV_COM_COMPONENT);
     $tz = $params->get("icaltimezonelive", "");
     if ($tz) {
         $urlString['dates'] = JevDate::strftime("%Y%m%dT%H%M%S", $row->getUnixStartTime()) . "/" . JevDate::strftime("%Y%m%dT%H%M%S", $row->getUnixEndTime()) . "&ctz=" . $tz;
     } else {
         $urlString['dates'] = JevDate::strftime("%Y%m%dT%H%M%SZ", $row->getUnixStartTime()) . "/" . JevDate::strftime("%Y%m%dT%H%M%SZ", $row->getUnixEndTime());
     }
     $urlString['st'] = JevDate::strftime("%Y%m%dT%H%M%SZ", $row->getUnixStartTime());
     $urlString['et'] = JevDate::strftime("%Y%m%dT%H%M%SZ", $row->getUnixEndTime());
     $urlString['duration'] = (int) $row->getUnixEndTime() - (int) $row->getUnixStartTime();
     $urlString['location'] = urlencode(isset($row->_locationaddress) ? $row->_locationaddress : $row->location());
     $urlString['sitename'] = urlencode(JFactory::getApplication()->get('sitename'));
     $urlString['siteurl'] = urlencode(JUri::root());
     $urlString['rawdetails'] = urlencode($row->get('description'));
     $urlString['details'] = strip_tags($row->get('description'));
     if (JString::strlen($urlString['details']) > 100) {
         $urlString['details'] = JString::substr($urlString['details'], 0, 100) . ' ...';
     }
     $urlString['details'] = urlencode($urlString['details']);
     return $urlString;
 }
开发者ID:poorgeek,项目名称:JEvents,代码行数:24,代码来源:jevExportHelper.php

示例4: getTime

 function getTime($date, $h = -1, $m = -1)
 {
     $cfg =& JEVConfig::getInstance();
     static $format_type;
     if (!isset($format_type)) {
         $cfg =& JEVConfig::getInstance();
         $format_type = $cfg->get('com_dateformat');
     }
     // if date format is from langauge file then do this first
     if ($format_type == 3) {
         if ($h >= 0 && $m >= 0) {
             $time = JevDate::mktime($h, $m);
             return JEV_CommonFunctions::jev_strftime(JText::_("TIME_FORMAT"), $time);
         } else {
             return JEV_CommonFunctions::jev_strftime(JText::_("TIME_FORMAT"), $date);
         }
     }
     if ($cfg->get('com_calUseStdTime') == '0') {
         if ($h >= 0 && $m >= 0) {
             return sprintf('%02d:%02d', $h, $m);
         } else {
             return JevDate::strftime("%H:%M", $date);
         }
     } else {
         if (JUtility::isWinOS()) {
             return JevDate::strftime("%#I:%M%p", $date);
         } else {
             return strtolower(JevDate::strftime("%I:%M%p", $date));
         }
     }
 }
开发者ID:madseller,项目名称:coperio,代码行数:31,代码来源:helper.php

示例5: simulateSaveRepeat

function simulateSaveRepeat($requestObject)
{
    include_once JPATH_SITE . "/components/com_jevents/jevents.defines.php";
    if (!JEVHelper::isEventCreator()) {
        throwerror(JText::_('ALERTNOTAUTH'));
    }
    // Convert formdata to array
    $formdata = array();
    foreach (get_object_vars($requestObject->formdata) as $k => $v) {
        $k = str_replace("[]", "", $k);
        $formdata[$k] = $v;
    }
    $array = JRequest::_cleanVar($formdata, JREQUEST_ALLOWHTML);
    if (!array_key_exists("rp_id", $array) || intval($array["rp_id"]) <= 0) {
        throwerror(JText::_("Not a repeat", true));
    }
    $rp_id = intval($array["rp_id"]);
    $dataModel = new JEventsDataModel("JEventsAdminDBModel");
    $queryModel = new JEventsDBModel($dataModel);
    // I should be able to do this in one operation but that can come later
    $event = $queryModel->listEventsById(intval($rp_id), 1, "icaldb");
    if (!JEVHelper::canEditEvent($event)) {
        throwerror(JText::_('ALERTNOTAUTH'));
    }
    $db =& JFactory::getDBO();
    $rpt = new iCalRepetition($db);
    $rpt->load($rp_id);
    $query = "SELECT detail_id FROM #__jevents_vevent WHERE ev_id={$rpt->eventid}";
    $db->setQuery($query);
    $eventdetailid = $db->loadResult();
    $data["UID"] = valueIfExists($array, "uid", md5(uniqid(rand(), true)));
    $data["X-EXTRAINFO"] = valueIfExists($array, "extra_info", "");
    $data["LOCATION"] = valueIfExists($array, "location", "");
    $data["allDayEvent"] = valueIfExists($array, "allDayEvent", "off");
    $data["CONTACT"] = valueIfExists($array, "contact_info", "");
    // allow raw HTML (mask =2)
    $data["DESCRIPTION"] = valueIfExists($array, "jevcontent", "", 'request', 'html', 2);
    $data["publish_down"] = valueIfExists($array, "publish_down", "2006-12-12");
    $data["publish_up"] = valueIfExists($array, "publish_up", "2006-12-12");
    $interval = valueIfExists($array, "rinterval", 1);
    $data["SUMMARY"] = valueIfExists($array, "title", "");
    $data["MULTIDAY"] = intval(valueIfExists($array, "multiday", "1"));
    $data["NOENDTIME"] = intval(valueIfExists($array, "noendtime", 0));
    $ics_id = valueIfExists($array, "ics_id", 0);
    if ($data["allDayEvent"] == "on") {
        $start_time = "00:00";
    } else {
        $start_time = valueIfExists($array, "start_time", "08:00");
    }
    $publishstart = $data["publish_up"] . ' ' . $start_time . ':00';
    $data["DTSTART"] = JevDate::strtotime($publishstart);
    if ($data["allDayEvent"] == "on") {
        $end_time = "23:59";
        $publishend = $data["publish_down"] . ' ' . $end_time . ':59';
    } else {
        $end_time = valueIfExists($array, "end_time", "15:00");
        $publishend = $data["publish_down"] . ' ' . $end_time . ':00';
    }
    $data["DTEND"] = JevDate::strtotime($publishend);
    // iCal for whole day uses 00:00:00 on the next day JEvents uses 23:59:59 on the same day
    list($h, $m, $s) = explode(":", $end_time . ':00');
    if ($h + $m + $s == 0 && $data["allDayEvent"] == "on" && $data["DTEND"] > $data["DTSTART"]) {
        $publishend = JevDate::strftime('%Y-%m-%d 23:59:59', $data["DTEND"] - 86400);
        $data["DTEND"] = JevDate::strtotime($publishend);
    }
    $data["X-COLOR"] = valueIfExists($array, "color", "");
    // Add any custom fields into $data array
    foreach ($array as $key => $value) {
        if (strpos($key, "custom_") === 0) {
            $data[$key] = $value;
        }
    }
    // populate rpt with data
    $start = $data["DTSTART"];
    $end = $data["DTEND"];
    $rpt->startrepeat = JevDate::strftime('%Y-%m-%d %H:%M:%S', $start);
    $rpt->endrepeat = JevDate::strftime('%Y-%m-%d %H:%M:%S', $end);
    $rpt->duplicatecheck = md5($rpt->eventid . $start);
    $rpt->rp_id = $rp_id;
    $rpt->event = $event;
    return $rpt;
}
开发者ID:andreassetiawanhartanto,项目名称:PDKKI,代码行数:82,代码来源:checkconflict.php

示例6: unixTime

 /**
  * iCal spec represents date in ISO 8601 format followed by "T" then the time
  * a "Z at the end means the time is UTC and not local time zone
  *
  * TODO make sure if time is UTC we take account of system time offset properly
  *
  */
 function unixTime($ical_date, $tz = false)
 {
     jimport("joomla.utilities.date");
     static $offset = null;
     if (is_null($offset)) {
         $config =& JFactory::getConfig();
         $offset = $config->getValue('config.offset', 0);
     }
     if (!is_numeric($ical_date)) {
         $t = JevDate::strtotime($ical_date);
         if (JString::strpos($ical_date, "Z") > 0) {
             if (is_callable("date_default_timezone_set")) {
                 $timezone = date_default_timezone_get();
                 // See http://www.php.net/manual/en/timezones.php
                 $params = JComponentHelper::getParams(JEV_COM_COMPONENT);
                 // server offset tiemzone
                 if ($params->get("icaltimezone", "") != "") {
                     date_default_timezone_set($params->get("icaltimezone", ""));
                 }
                 // server offset PARAMS
                 $serveroffset1 = (JevDate::strtotime(JevDate::strftime('%Y%m%dT%H%M%S', $t)) - JevDate::strtotime(JevDate::strftime('%Y%m%dT%H%M%SZ', $t))) / 3600;
                 // server offset SERVER
                 date_default_timezone_set($timezone);
                 $serveroffset2 = (JevDate::strtotime(JevDate::strftime('%Y%m%dT%H%M%S', $t)) - JevDate::strtotime(JevDate::strftime('%Y%m%dT%H%M%SZ', $t))) / 3600;
                 $t = new JevDate($ical_date, $serveroffset1 - $serveroffset2);
                 //$t = new JevDate($ical_date );
                 date_default_timezone_set($timezone);
                 echo "icaldate = " . $ical_date . " imported date=" . $t->toMySQL() . "<br/>";
             } else {
                 // Summer Time adjustment
                 list($y, $m, $d, $h, $min, $s) = explode(":", JevDate::strftime('%Y:%m:%d:%H:%M:%S', $t));
                 $dst = (JevDate::mktime($h, $min, $s, $m, $d, $y, 0) - JevDate::mktime($h, $min, $s, $m, $d, $y, -1)) / 3600;
                 // server offset including DST
                 $serveroffset = (JevDate::strtotime(JevDate::strftime('%Y%m%dT%H%M%S', $t)) - JevDate::strtotime(JevDate::strftime('%Y%m%dT%H%M%SZ', $t))) / 3600;
                 $serveroffset += $dst;
                 $t = new JevDate($ical_date, -($serveroffset + $offset));
             }
             /*
             echo "<h3>SET TIMEZONE</h3>";
             $timezone= date_default_timezone_get();
             date_default_timezone_set('America/New_York');
             
             $tempIcal  = "20091020T163000Z";
             echo $tempIcal."<br/>";
             $temp = JevDate::strtotime($tempIcal);
             list($y,$m,$d,$h,$min,$s) = explode(":", JevDate::strftime('%Y:%m:%d:%H:%M:%S',$temp));
             echo "$y,$m,$d,$h,$min,$s<br/>";
             $dst = (JevDate::mktime($h,$min,$s,$m,$d,$y,0)-JevDate::mktime($h,$min,$s,$m,$d,$y,-1))/3600;
             $so = (JevDate::strtotime(JevDate::strftime('%Y%m%dT%H%M%S',$temp))-JevDate::strtotime(JevDate::strftime('%Y%m%dT%H%M%SZ',$temp)))/3600;
             echo " dst=".$dst." serverforoffset=".$so."<br/>";
             $so += $dst;
             $t = new JevDate($tempIcal);
             echo $t->toMySQL()."<br><br/>";
             
             
             $tempIcal  = "20091029T163000Z";
             echo $tempIcal."<br/>";
             $temp = JevDate::strtotime($tempIcal);
             list($y,$m,$d,$h,$min,$s) = explode(":", JevDate::strftime('%Y:%m:%d:%H:%M:%S',$temp));
             echo "$y,$m,$d,$h,$min,$s<br/>";
             $dst = (JevDate::mktime($h,$min,$s,$m,$d,$y,0)-JevDate::mktime($h,$min,$s,$m,$d,$y,-1))/3600;
             $so = (JevDate::strtotime(JevDate::strftime('%Y%m%dT%H%M%S',$temp))-JevDate::strtotime(JevDate::strftime('%Y%m%dT%H%M%SZ',$temp)))/3600;
             echo " dst=".$dst." serverforoffset=".$so."<br/>";
             $so += $dst;
             $t = new JevDate($tempIcal );
             echo $t->toMySQL()."<br><br/>";
             
             $tempIcal  = "20091103T163000Z";
             echo $tempIcal."<br/>";
             $temp = JevDate::strtotime($tempIcal);
             list($y,$m,$d,$h,$min,$s) = explode(":", JevDate::strftime('%Y:%m:%d:%H:%M:%S',$temp));
             echo "$y,$m,$d,$h,$min,$s<br/>";
             $dst = (JevDate::mktime($h,$min,$s,$m,$d,$y,0)-JevDate::mktime($h,$min,$s,$m,$d,$y,-1))/3600;
             $so = (JevDate::strtotime(JevDate::strftime('%Y%m%dT%H%M%S',$temp))-JevDate::strtotime(JevDate::strftime('%Y%m%dT%H%M%SZ',$temp)))/3600;
             echo " dst=".$dst." serverforoffset=".$so."<br/>";
             $so += $dst;
             $t = new JevDate($tempIcal);
             echo $t->toMySQL()."<br>";
             */
         } else {
             if ($tz != false && $tz != "") {
                 // really should use the timezone of the inputted date
                 $tz = new DateTimeZone($tz);
                 $t = new JevDate($ical_date, $tz);
                 echo "icaldate = " . $ical_date . " imported date=" . $t->toMySQL() . "<br/>";
             } else {
                 $compparams = JComponentHelper::getParams(JEV_COM_COMPONENT);
                 $jtz = $compparams->get("icaltimezonelive", "");
                 if ($jtz) {
                     $t = new JevDate($ical_date, $jtz);
                 } else {
                     $t = new JevDate($ical_date);
                 }
//.........这里部分代码省略.........
开发者ID:brojask,项目名称:colegio-abogados-joomla,代码行数:101,代码来源:iCalImport.php

示例7: save

 function save($array, &$queryModel, $rrule, $dryrun = false)
 {
     $cfg =& JEVConfig::getInstance();
     $db =& JFactory::getDBO();
     $user = JFactory::getUser();
     // Allow plugins to check data validity
     $dispatcher =& JDispatcher::getInstance();
     JPluginHelper::importPlugin("jevents");
     $res = $dispatcher->trigger('onBeforeSaveEvent', array(&$array, &$rrule, $dryrun));
     // TODO do error and hack checks here
     $ev_id = intval(JArrayHelper::getValue($array, "evid", 0));
     $newevent = $ev_id == 0;
     $data = array();
     // TODO add UID to edit form
     $data["UID"] = JArrayHelper::getValue($array, "uid", md5(uniqid(rand(), true)));
     $data["X-EXTRAINFO"] = JArrayHelper::getValue($array, "extra_info", "");
     $data["LOCATION"] = JArrayHelper::getValue($array, "location", "");
     $data["allDayEvent"] = JArrayHelper::getValue($array, "allDayEvent", "off");
     $data["CONTACT"] = JArrayHelper::getValue($array, "contact_info", "");
     $data["DESCRIPTION"] = JArrayHelper::getValue($array, "jevcontent", "");
     $data["publish_down"] = JArrayHelper::getValue($array, "publish_down", "2006-12-12");
     $data["publish_up"] = JArrayHelper::getValue($array, "publish_up", "2006-12-12");
     $data["SUMMARY"] = JArrayHelper::getValue($array, "title", "");
     $data["URL"] = JArrayHelper::getValue($array, "url", "");
     // If user is jevents can deleteall or has backend access then allow them to specify the creator
     $jevuser = JEVHelper::getAuthorisedUser();
     $creatorid = JRequest::getInt("jev_creatorid", 0);
     if ($creatorid > 0) {
         if (JVersion::isCompatible("1.6.0")) {
             //$access = JAccess::check($user->id, "core.deleteall","com_jevents");
             $access = $user->authorise('core.admin', 'com_jevents');
         } else {
             // Get an ACL object
             $acl =& JFactory::getACL();
             $grp = $acl->getAroGroup($user->get('id'));
             $access = $acl->is_group_child_of($grp->name, 'Public Backend');
         }
         if ($jevuser && $jevuser->candeleteall || $access) {
             $data["X-CREATEDBY"] = $creatorid;
         }
     }
     $ics_id = JArrayHelper::getValue($array, "ics_id", 0);
     if ($data["allDayEvent"] == "on") {
         $start_time = "00:00";
     } else {
         $start_time = JArrayHelper::getValue($array, "start_time", "08:00");
     }
     $publishstart = $data["publish_up"] . ' ' . $start_time . ':00';
     $data["DTSTART"] = JevDate::strtotime($publishstart);
     if ($data["allDayEvent"] == "on") {
         $end_time = "00:00";
     } else {
         $end_time = JArrayHelper::getValue($array, "end_time", "15:00");
     }
     $publishend = $data["publish_down"] . ' ' . $end_time . ':00';
     if (isset($array["noendtime"]) && $array["noendtime"]) {
         $publishend = $data["publish_down"] . ' 23:59:59';
     }
     $data["DTEND"] = JevDate::strtotime($publishend);
     // iCal for whole day uses 00:00:00 on the next day JEvents uses 23:59:59 on the same day
     list($h, $m, $s) = explode(":", $end_time . ':00');
     if ($h + $m + $s == 0 && $data["allDayEvent"] == "on" && $data["DTEND"] > $data["DTSTART"]) {
         //if (($h+$m+$s)==0 && $data["allDayEvent"]=="on" && $data["DTEND"]>=$data["DTSTART"]) {
         //$publishend = JevDate::strftime('%Y-%m-%d 23:59:59',($data["DTEND"]-86400));
         $publishend = JevDate::strftime('%Y-%m-%d 23:59:59', $data["DTEND"]);
         $data["DTEND"] = JevDate::strtotime($publishend);
     }
     $data["RRULE"] = $rrule;
     $data["MULTIDAY"] = JArrayHelper::getValue($array, "multiday", "1");
     $data["NOENDTIME"] = JArrayHelper::getValue($array, "noendtime", "0");
     $data["X-COLOR"] = JArrayHelper::getValue($array, "color", "");
     $data["LOCKEVENT"] = JArrayHelper::getValue($array, "lockevent", "0");
     // Add any custom fields into $data array
     foreach ($array as $key => $value) {
         if (strpos($key, "custom_") === 0) {
             $data[$key] = $value;
         }
     }
     $vevent = iCalEvent::iCalEventFromData($data);
     $vevent->catid = JArrayHelper::getValue($array, "catid", 0);
     if (is_array($vevent->catid)) {
         JArrayHelper::toInteger($vevent->catid);
     }
     // if catid is empty then use the catid of the ical calendar
     if (is_string($vevent->catid) && $vevent->catid <= 0 || is_array($vevent->catid) && count($vevent->catid) == 0) {
         $query = "SELECT catid FROM #__jevents_icsfile WHERE ics_id={$ics_id}";
         $db->setQuery($query);
         $vevent->catid = $db->loadResult();
     }
     $vevent->access = intval(JArrayHelper::getValue($array, "access", 0));
     if (!JVersion::isCompatible("1.6.0")) {
         $vevent->access = $vevent->access > $user->aid ? $user->aid : $vevent->access;
     }
     $vevent->state = intval(JArrayHelper::getValue($array, "state", 0));
     // Shouldn't really do this like this
     $vevent->_detail->priority = intval(JArrayHelper::getValue($array, "priority", 0));
     // FRONT END AUTO PUBLISHING CODE
     $frontendPublish = JEVHelper::isEventPublisher();
     if (!$frontendPublish) {
         $frontendPublish = JEVHelper::canPublishOwnEvents($ev_id);
//.........这里部分代码省略.........
开发者ID:madseller,项目名称:coperio,代码行数:101,代码来源:saveIcalEvent.php

示例8: jev_strftime

 /**
  * Support all JevDate::strftime() parameter for Window systems
  *
  * @param string $format
  * @param int $timestamp
  * @return string formated string
  */
 function jev_strftime($format = '', $timestamp = null)
 {
     if (!$timestamp) {
         $timestamp = time();
     }
     // Replace names by own translation to get rid of improper os system library
     if (strpos($format, '%a') !== false) {
         $format = str_replace('%a', JEVHelper::getShortDayName(date('w', $timestamp)), $format);
     }
     if (strpos($format, '%A') !== false) {
         $format = str_replace('%A', JEVHelper::getDayName(date('w', $timestamp)), $format);
     }
     if (strpos($format, '%b') !== false) {
         $format = str_replace('%b', JEVHelper::getShortMonthName(date('n', $timestamp)), $format);
     }
     if (strpos($format, '%B') !== false) {
         $format = str_replace('%B', JEVHelper::getMonthName(date('n', $timestamp)), $format);
     }
     if (JUtility::isWinOS()) {
         if (!class_exists('JEV_CompatWin')) {
             require_once dirname(__FILE__) . '/compatwin.php';
         }
         return JEV_CompatWin::win_strftime($format, $timestamp);
     } else {
         return JevDate::strftime($format, $timestamp);
     }
 }
开发者ID:madseller,项目名称:coperio,代码行数:34,代码来源:commonfunctions.php

示例9: JEventsBuildRoute

function JEventsBuildRoute(&$query)
{
    $cfg =& JEVConfig::getInstance();
    $segments = array();
    // sometimes the task is not set but view and layout are so tackle this!
    if (!isset($query['task']) && isset($query['view']) && isset($query['layout'])) {
        $query['task'] = $query['view'] . "." . $query['layout'];
    }
    // We don't need the view - its only used to manipulate parameters
    if (isset($query['view'])) {
        unset($query['view']);
    }
    if (isset($query['layout'])) {
        unset($query['layout']);
    }
    $task = false;
    $task = false;
    if (!isset($query['task'])) {
        if (isset($query["Itemid"])) {
            $menu =& JSite::getMenu();
            $menuitem = $menu->getItem($query["Itemid"]);
            if (!is_null($menuitem) && isset($menuitem->query["task"])) {
                $task = $menuitem->query["task"];
                return $segments;
            } else {
                if (!is_null($menuitem) && isset($menuitem->query["layout"]) && isset($menuitem->query["view"])) {
                    $task = $menuitem->query["view"] . "." . $menuitem->query["layout"];
                }
            }
        }
        if (!$task) {
            $task = 'month.calendar';
        }
    } else {
        $task = $query['task'];
        unset($query['task']);
    }
    switch ($task) {
        case "year.listevents":
        case "month.calendar":
        case "week.listevents":
        case "day.listevents":
        case "cat.listevents":
        case "jevent.detail":
        case "icalevent.detail":
        case "icalrepeat.detail":
        case "search.form":
        case "search.results":
        case "admin.listevents":
            $segments[] = $task;
            $config =& JFactory::getConfig();
            $t_datenow = JEVHelper::getNow();
            // if no date in the query then use TODAY not the calendar date
            $nowyear = JevDate::strftime('%Y', $t_datenow->toUnix(true));
            $nowmonth = JevDate::strftime('%m', $t_datenow->toUnix(true));
            $nowday = JevDate::strftime('%d', $t_datenow->toUnix(true));
            /*
            $year	= intval( JRequest::getVar( 'year',	 $nowyear ));
            $month	= intval( JRequest::getVar( 'month', $nowmonth ));
            $day	= intval( JRequest::getVar( 'day',	 $nowday ));
            */
            if (isset($query['year'])) {
                $segments[] = $query['year'];
                unset($query['year']);
            } else {
                // if no date in the query then use TODAY not the calendar date
                $segments[] = $nowyear;
            }
            if (isset($query['month'])) {
                $segments[] = $query['month'];
                unset($query['month']);
            } else {
                // if no date in the query then use TODAY not the calendar date
                $segments[] = $nowmonth;
            }
            if (isset($query['day'])) {
                $segments[] = $query['day'];
                unset($query['day']);
            } else {
                // if no date in the query then use TODAY not the calendar date
                $segments[] = $nowday;
            }
            switch ($task) {
                case "jevent.detail":
                case "icalevent.detail":
                case "icalrepeat.detail":
                    if (isset($query['jevtype'])) {
                        unset($query['jevtype']);
                    }
                    if (isset($query['evid'])) {
                        $segments[] = $query['evid'];
                        unset($query['evid']);
                    } else {
                        $segments[] = "0";
                    }
                    /*
                    // Can we drop the use of uid?
                    if(isset($query['title'])) {
                    $segments[] = JFilterOutput::stringURLSafe($query['title']);
                    unset($query['title']);
//.........这里部分代码省略.........
开发者ID:andreassetiawanhartanto,项目名称:PDKKI,代码行数:101,代码来源:router.php

示例10: _getWeekNumberISO8601

 /**
  * Get week number according ISO 8601
  *
  * @static
  * @param int $date date
  * @return int weeknumber
  */
 function _getWeekNumberISO8601($date)
 {
     $thursday = JEV_CompatWin::_getThursdayOfWeek($date);
     $thursday_Y = JevDate::strftime('%Y', $thursday);
     $first_th = JEV_CompatWin::_getThursdayOfWeek(JevDate::strtotime($thursday_Y . '-01-04'));
     return (JevDate::strftime('%j', $thursday) - JevDate::strftime('%j', $first_th)) / 7 + 1;
 }
开发者ID:andreassetiawanhartanto,项目名称:PDKKI,代码行数:14,代码来源:compatwin.php

示例11: countIcalEventsByCat

 function countIcalEventsByCat($catids, $showrepeats = false)
 {
     $db =& JFactory::getDBO();
     $user = JFactory::getUser();
     // Use catid in accessibleCategoryList to pick up offsping too!
     $aid = null;
     $catidlist = implode(",", $catids);
     // process the new plugins
     // get extra data and conditionality from plugins
     $extrafields = "";
     // must have comma prefix
     $extratables = "";
     // must have comma prefix
     $extrawhere = array();
     $extrajoin = array();
     $needsgroup = false;
     if (!$this->cfg->getValue("showyearpast", 1)) {
         list($year, $month, $day) = JEVHelper::getYMD();
         $startdate = JevDate::mktime(0, 0, 0, $month, $day, $year);
         $startdate = JevDate::strftime('%Y-%m-%d 00:00:00', $startdate);
         $extrawhere[] = "rpt.endrepeat >=  '{$startdate}'";
     }
     $filters = jevFilterProcessing::getInstance(array("published", "justmine", "category", "search"));
     $filters->setWhereJoin($extrawhere, $extrajoin);
     $needsgroup = $filters->needsGroupBy();
     $extrafields = "";
     // must have comma prefix
     $extratables = "";
     // must have comma prefix
     $dispatcher =& JDispatcher::getInstance();
     $dispatcher->trigger('onListIcalEvents', array(&$extrafields, &$extratables, &$extrawhere, &$extrajoin, &$needsgroup));
     $catwhere = "\n WHERE ev.catid IN(" . $this->accessibleCategoryList() . ")";
     $params = JComponentHelper::getParams("com_jevents");
     if ($params->get("multicategory", 0)) {
         $extrajoin[] = "\n #__jevents_catmap as catmap ON catmap.evid = rpt.eventid";
         $extrajoin[] = "\n #__categories AS catmapcat ON catmap.catid = catmapcat.id";
         $extrafields .= ", GROUP_CONCAT(DISTINCT catmap.catid SEPARATOR ',') as catids";
         $extrawhere[] = " catmapcat.access " . (version_compare(JVERSION, '1.6.0', '>=') ? ' IN (' . JEVHelper::getAid($user) . ')' : ' <=  ' . JEVHelper::getAid($user));
         $extrawhere[] = " catmap.catid IN(" . $this->accessibleCategoryList() . ")";
         $needsgroup = true;
         $catwhere = "\n WHERE 1 ";
     }
     $extrajoin = count($extrajoin) ? " \n LEFT JOIN " . implode(" \n LEFT JOIN ", $extrajoin) : '';
     $extrawhere = count($extrawhere) ? ' AND ' . implode(' AND ', $extrawhere) : '';
     // Get the count
     if ($showrepeats) {
         $query = "SELECT count(DISTINCT rpt.rp_id) as cnt" . "\n FROM #__jevents_vevent as ev " . "\n LEFT JOIN #__jevents_icsfile as icsf ON icsf.ics_id=ev.icsid" . "\n LEFT JOIN #__jevents_repetition as rpt ON rpt.eventid = ev.ev_id" . "\n LEFT JOIN #__jevents_rrule as rr ON rr.eventid = ev.ev_id" . "\n LEFT JOIN #__jevents_vevdetail as det ON det.evdet_id = rpt.eventdetail_id" . $extrajoin . $catwhere . "\n AND icsf.state=1" . $extrawhere;
     } else {
         // TODO fine a single query way of doing this !!!
         $query = "SELECT MIN(rpt.rp_id) as rp_id FROM #__jevents_repetition as rpt " . "\n LEFT JOIN #__jevents_vevent as ev ON rpt.eventid = ev.ev_id" . "\n LEFT JOIN #__jevents_rrule as rr ON rr.eventid = ev.ev_id" . "\n LEFT JOIN #__jevents_vevdetail as det ON det.evdet_id = rpt.eventdetail_id" . "\n LEFT JOIN #__jevents_icsfile as icsf  ON icsf.ics_id=ev.icsid " . $extrajoin . $catwhere . $extrawhere . "\n AND icsf.state=1" . "\n GROUP BY ev.ev_id";
         $db->setQuery($query);
         $rplist = $db->loadResultArray();
         $rplist = implode(',', array_merge(array(-1), $rplist));
         $query = "SELECT count(DISTINCT det.evdet_id) as cnt" . "\n FROM #__jevents_vevent as ev " . "\n LEFT JOIN #__jevents_icsfile as icsf ON icsf.ics_id=ev.icsid" . "\n LEFT JOIN #__jevents_repetition as rpt ON rpt.eventid = ev.ev_id" . "\n AND rpt.rp_id IN({$rplist})" . "\n LEFT JOIN #__jevents_rrule as rr ON rr.eventid = ev.ev_id" . "\n LEFT JOIN #__jevents_vevdetail as det ON det.evdet_id = rpt.eventdetail_id" . $extrajoin . $catwhere . "\n AND icsf.state=1" . $extrawhere;
     }
     $db->setQuery($query);
     //echo $db->_sql;
     //echo $db->explain();
     $total = intval($db->loadResult());
     return $total;
 }
开发者ID:madseller,项目名称:coperio,代码行数:61,代码来源:dbmodel.php

示例12:

?>
</span>
			</fieldset>
		</div>
		<div style="float:left;margin-left:20px!important;background-color:#dddddd;" id="cu_until">
			<fieldset style="background-color:#dddddd">
				<legend  style="background-color:#dddddd"><input type="radio" name="countuntil" value="until" id="cuu" onclick="toggleCountUntil('cu_until');" /><?php 
echo JText::_('REPEAT_UNTIL');
?>
</legend>
				<?php 
$params = JComponentHelper::getParams(JEV_COM_COMPONENT);
$minyear = JEVHelper::getMinYear();
$maxyear = JEVHelper::getMaxYear();
$inputdateformat = $params->get("com_editdateformat", "d.m.Y");
JEVHelper::loadCalendar("until", "until", JevDate::strftime("%Y-%m-%d", $this->row->until()), $minyear, $maxyear, 'updateRepeatWarning();', "checkUntil();updateRepeatWarning();", $inputdateformat);
?>
				<input type="hidden"  name="until2" id="until2" value="" />

			</fieldset>
		</div>
	</div>
	<div style="clear:both;">
		<div   id="byyearday">
			<fieldset><legend><input type="radio" name="whichby" id="jevbyd" value="byd"  onclick="toggleWhichBy('byyearday');" /><?php 
echo JText::_('BY_YEAR_DAY');
?>
</legend>
				<div>					
					<?php 
echo JText::_('COMMA_SEPARATED_LIST');
开发者ID:pguilford,项目名称:vcomcc,代码行数:31,代码来源:editjq_datetime.php

示例13: getAdjacentDay

 function getAdjacentDay($year, $month, $day, $direction = 1)
 {
     $d1 = JevDate::mktime(0, 0, 0, $month, $day + $direction, $year);
     $day = JevDate::strftime("%d", $d1);
     $year = JevDate::strftime("%Y", $d1);
     $cfg = JEVConfig::getInstance();
     $earliestyear = JEVHelper::getMinYear();
     $latestyear = JEVHelper::getMaxYear();
     if ($year > $latestyear || $year < $earliestyear) {
         return false;
     }
     $month = JevDate::strftime("%m", $d1);
     $task = JRequest::getString('jevtask');
     $Itemid = JEVHelper::getItemid();
     if (isset($Itemid)) {
         $item = "&Itemid={$Itemid}";
     } else {
         $item = "";
     }
     // URL suffix to preserver catids!
     $cat = $this->getCatidsOutLink();
     return JRoute::_("index.php?option=" . JEV_COM_COMPONENT . "&task={$task}{$item}&year={$year}&month={$month}&day={$day}" . $cat);
 }
开发者ID:hriggs,项目名称:cs-website,代码行数:23,代码来源:datamodel.php

示例14: switch

    for ($d = 0; $d < 7 && $dn < $datacount; $d++) {
        $currentDay = $this->data["dates"][$dn];
        switch ($currentDay["monthType"]) {
            case "prior":
            case "following":
                ?>
                    <td class="weekdayemptyclr" align="center" height="50" valign="middle">
                        <?php 
                echo $currentDay["d"];
                ?>
                    </td>
                    	<?php 
                break;
            case "current":
                //Current month
                $dayOfWeek = JevDate::strftime("%w", $currentDay["cellDate"]);
                $style = $dayOfWeek == 0 ? "sundayemptyclr" : "weekdayclr";
                if ($currentDay['today']) {
                    $style = "todayclr";
                }
                ?>
                    <td class="<?php 
                echo $style;
                ?>
" width="14%" align="center" height="50" valign="top">
                    <table border="0" cellpadding="0" cellspacing="0" width="100%">
						<tr class="caldaydigits">
						<td class="caldaydigits">&nbsp;
						<strong><a href="<?php 
                echo $currentDay["link"];
                ?>
开发者ID:madcsaba,项目名称:li-de,代码行数:31,代码来源:calendar_body.php

示例15: str_replace

				<?php 
$params = JComponentHelper::getParams(JEV_COM_COMPONENT);
$minyear = JEVHelper::getMinYear();
$maxyear = JEVHelper::getMaxYear();
$inputdateformat = $params->get("com_editdateformat", "d.m.Y");
$inputdateformat2 = str_replace(array("Y", "m", "d"), array("%Y", "%m", "%d"), $inputdateformat);
JEVHelper::loadElectricCalendar("irregular", "irregular", "", $minyear, $maxyear, '', "selectIrregularDate();updateRepeatWarning();", $inputdateformat, array("style" => "display:none;"));
?>
				</div>
				<select  id="irregularDates" name="irregularDates[]" multiple="multiple" size="5" onchange="updateRepeatWarning()">
					<?php 
sort($this->row->_irregulardates);
array_unique($this->row->_irregulardates);
foreach ($this->row->_irregulardates as $irregulardate) {
    $irregulardateval = JevDate::strftime('%Y-%m-%d', $irregulardate);
    $irregulardatetext = JevDate::strftime($inputdateformat2, $irregulardate);
    ?>
					<option value="<?php 
    echo $irregulardateval;
    ?>
" selected="selected"><?php 
    echo $irregulardatetext;
    ?>
</option>
						<?php 
}
?>
				</select>
				<strong><?php 
echo JText::_("JEV_IRREGULAR_REPEATS_CANNOT_BE_EXPORTED_AT_PRESENT");
?>
开发者ID:poorgeek,项目名称:JEvents,代码行数:31,代码来源:edit_datetime.php


注:本文中的JevDate::strftime方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。