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;
}
Example #2
0
     print_label_row('<b>' . $vbphrase['posted_by'] . '</b>', '<a href="../' . $vbulletin->config['Misc']['admincpdir'] . '/user.php?' . $vbulletin->session->vars['sessionurl'] . "do=edit&u={$eventinfo['userid']}\">{$eventinfo['username']}</a>");
 }
 print_label_row('<b>' . $vbphrase['calendar'] . '</b>', '<a href="../calendar.php?' . $vbulletin->session->vars['sessionurl'] . "c={$eventinfo['calendarid']}\">{$eventinfo['title']}</a>");
 if (can_moderate_calendar($eventinfo['calendarid'], 'caneditevents')) {
     print_input_row('<b>' . $vbphrase['subject'] . '</b>', "eventsubject[{$eventinfo['eventid']}]", $eventinfo['subject']);
 } else {
     print_label_row('<b>' . $vbphrase['subject'] . '</b>', htmlspecialchars_uni($eventinfo['subject']));
     construct_hidden_code("eventsubject[{$eventinfo['eventid']}]", $eventinfo['subject']);
 }
 $time1 = vbdate($vbulletin->options['timeformat'], $eventinfo['dateline_from']);
 $time2 = vbdate($vbulletin->options['timeformat'], $eventinfo['dateline_to']);
 if ($eventinfo['singleday']) {
     print_label_row('<b>' . $vbphrase['date'] . '</b>', vbdate($vbulletin->options['dateformat'], $eventinfo['dateline_from']));
 } else {
     if ($eventinfo['dateline_from'] != $eventinfo['dateline_to']) {
         $recurcriteria = fetch_event_criteria($eventinfo);
         $date1 = vbdate($vbulletin->options['dateformat'], $eventinfo['dateline_from']);
         $date2 = vbdate($vbulletin->options['dateformat'], $eventinfo['dateline_to']);
         if (!$recurcriteria) {
             $recurcriteria = $vbcalendar['word6'];
             // What is word6?
         }
         print_label_row('<b>' . $vbphrase['time'] . '</b>', construct_phrase($vbphrase['x_to_y'], $time1, $time2));
         print_label_row('<b>' . $vbphrase['timezone'] . '</b>', "<select name=\"eventtimezone[{$eventinfo['eventid']}]\" tabindex=\"1\" class=\"bginput\">" . construct_select_options(fetch_timezones_array(), $eventinfo['utc']) . '</select>');
         print_label_row('<b>' . $vbphrase['date_range'] . '</b>', $recurcriteria . ' | ' . construct_phrase($vbphrase['x_to_y'], $date1, $date2));
     } else {
         $date = vbdate($vbulletin->options['dateformat'], $eventinfo['from_date']);
         print_label_row('<b>' . $vbphrase['time'] . '</b>', construct_phrase($vbphrase['x_to_y'], $time1, $time2));
         print_label_row('<b>' . $vbphrase['timezone'] . '</b>', "<select name=\"eventtimezone[{$eventinfo['eventid']}]\" tabindex=\"1\" class=\"bginput\">" . construct_select_options(fetch_timezones_array(), $eventinfo['utc']) . '</select>');
         print_label_row('<b>' . $vbphrase['date_range'] . '</b>', $date);
     }