function fetch_event_date_time($info)
{
    global $timerange, $vbulletin, $vbphrase, $months, $days, $day, $month, $year, $holiday, $eventdate;
    global $titlecolor, $date1, $date2, $time1, $time2, $recurcriteria, $allday, $show;
    require_once DIR . '/includes/functions_misc.php';
    $daterange = '';
    $recurcriteria = '';
    $show['recuroption'] = false;
    $titlecolor = 'alt1';
    $info['title'] = htmlspecialchars_uni($info['title']);
    if ($wordwrap != 0) {
        $info['title'] = fetch_word_wrapped_string($info['title']);
    }
    $info['event'] = iif(empty($info['event']), '&nbsp', parse_calendar_bbcode($info['event'], $info['allowsmilies']));
    if (!$info['recurring'] and !$info['singleday']) {
        $daystamp = gmmktime(0, 0, 0, $month, $day, $year);
        $eventfirstday = gmmktime(0, 0, 0, gmdate('n', $info['dateline_from_user']), gmdate('j', $info['dateline_from_user']), gmdate('Y', $info['dateline_from_user']));
        $eventlastday = gmmktime(0, 0, 0, gmdate('n', $info['dateline_to_user']), gmdate('j', $info['dateline_to_user']), gmdate('Y', $info['dateline_to_user']));
        if ($info['dateline_from'] == $daystamp) {
            if ($eventfirstday == $daystamp) {
                if ($eventfirstday != $eventlastday) {
                    if (vbdate('g:ia', $info['dateline_from_user'], false, false) == '12:00am') {
                        $allday = true;
                    } else {
                        $time2 = vbgmdate($vbulletin->options['timeformat'], gmmktime(0, 0, 0, $month, $day, $year));
                    }
                }
            }
        } else {
            if ($eventlastday == $daystamp) {
                $time1 = gmdate($vbulletin->options['timeformat'], gmmktime(0, 0, 0, $month, $day, $year));
                $time1 = vbgmdate($vbulletin->options['timeformat'], gmmktime(0, 0, 0, $month, $day, $year));
            } else {
                $allday = true;
                // Used in conditional
            }
        }
    }
    if ($info['holidayid']) {
        $eventdate = vbgmdate($vbulletin->options['dateformat'], gmmktime(0, 0, 0, $month, $day, $year));
    } else {
        if ($info['singleday']) {
            $eventdate = vbgmdate($vbulletin->options['dateformat'], $info['dateline_from']);
        } else {
            $date1 = vbgmdate($vbulletin->options['dateformat'], $info['dateline_from_user']);
            $date2 = vbgmdate($vbulletin->options['dateformat'], $info['dateline_to_user']);
            $time1 = vbgmdate($vbulletin->options['timeformat'], $info['dateline_from_user']);
            $time2 = vbgmdate($vbulletin->options['timeformat'], $info['dateline_to_user']);
            if ($info['recurring']) {
                $recurcriteria = fetch_event_criteria($info);
                $show['recuroption'] = true;
            } else {
                $show['daterange'] = iif($date1 != $date2, true, false);
                $eventdate = vbgmdate($vbulletin->options['dateformat'], $info['dateline_from_user']);
            }
        }
    }
    return $info;
}
示例#2
0
     $customoption = '';
     $customtitle = $value['title'];
     if (is_array($value['options'])) {
         foreach ($value['options'] as $key => $val) {
             if ($val == $eventfields["{$value['calendarcustomfieldid']}"]) {
                 $customoption = $val;
                 break;
             }
         }
     }
     // Skip this value if a user entered entry exists but no longer allowed
     if (!$value['allowentry'] and $customoption == '') {
         continue;
     }
     require_once DIR . '/includes/functions_newpost.php';
     $customoption = parse_calendar_bbcode(convert_url_to_bbcode(unhtmlspecialchars($eventfields["{$value['calendarcustomfieldid']}"])));
     $show['customoption'] = $customoption == '' ? false : true;
     if ($show['customoption']) {
         $show['customfields'] = true;
     }
     $templater = vB_Template::create('calendar_showeventsbit_customfield');
     $templater->register('customoption', $customoption);
     $templater->register('customtitle', $customtitle);
     $customfields .= $templater->render();
 }
 $show['holiday'] = false;
 // check for calendar moderator here.
 $show['caneditevent'] = true;
 if (!can_moderate_calendar($calendarinfo['calendarid'], 'caneditevents')) {
     if ($eventinfo['userid'] != $vbulletin->userinfo['userid']) {
         $show['caneditevent'] = false;
示例#3
0
文件: event.php 项目: Kheros/MMOver
 public function get_custom_fields()
 {
     require_once DIR . '/includes/functions_newpost.php';
     $fielddefs = self::get_calendar_custom_fields($this->get_field("calendarid"));
     $customfields = unserialize($this->get_field('customfields'));
     $field_data = array();
     foreach ($fielddefs as $fielddef) {
         $fielddef['options'] = unserialize($fielddef['options']);
         $optionval = $customfields["{$fielddef['calendarcustomfieldid']}"];
         // Skip this value if a user entered entry exists but no longer allowed
         if (!$fielddef['allowentry']) {
             if (!(is_array($fielddef['options']) and in_array($optionval, $fielddef['options']))) {
                 continue;
             }
         }
         $customoption = parse_calendar_bbcode(convert_url_to_bbcode(unhtmlspecialchars($optionval)));
         $field_data[] = array('title' => $fielddef['title'], 'value' => $customoption);
     }
     return $field_data;
 }