Пример #1
0
function dtConvertToStandartForm($datetime, $showtime = 0)
{
    // 2004-12-30 13:25:41
    $array = explode(" ", $datetime);
    $date = $array[0];
    $time = $array[1];
    $dateArray = explode("-", $date);
    $day = $dateArray[2];
    $month = $dateArray[1];
    $year = $dateArray[0];
    if (!strcmp(_getSettingOptionValue("CONF_DATE_FORMAT"), "MM/DD/YYYY")) {
        $date = $month . "/" . $day . "/" . $year;
    } else {
        $date = $day . "." . $month . "." . $year;
    }
    if ($showtime == 1) {
        return $date . " " . $time;
    } else {
        return $date;
    }
}
Пример #2
0
function setting_SINGLE_FILE($_Path, $_SettingID)
{
    $Error = 0;
    $ConstantName = settingGetConstNameByID($_SettingID);
    if (isset($_POST['save']) && isset($_FILES['setting_' . $ConstantName])) {
        if ($_FILES['setting_' . $ConstantName]['name']) {
            if (@copy($_FILES['setting_' . $ConstantName]['tmp_name'], $_Path . '/' . $_FILES['setting_' . $ConstantName]['name'])) {
                _setSettingOptionValue($ConstantName, $_FILES['setting_' . $ConstantName]['name']);
            } else {
                $Error = 1;
            }
        }
    }
    $ConstantValue = _getSettingOptionValue($ConstantName);
    return ($Error ? '<div>' . ERROR_FAILED_TO_UPLOAD_FILE . '</div>' : '') . '<input type="file" name="setting_' . $ConstantName . '" /><br />' . ($ConstantValue ? $ConstantValue : '&nbsp;');
}