GRAYBYTE WORDPRESS FILE MANAGER6150

Server IP : 68.65.123.43 / Your IP : 216.73.216.162
System : Linux server266.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64
PHP Version : 8.0.30
Disable Function : NONE
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF
Directory : /home/inteuuod/public_html/wp-content/plugins/userswp/includes/
Upload Files :
Current_dir [ Writeable ] Document_root [ Writeable ]

Command :


Current File : /home/inteuuod/public_html/wp-content/plugins/userswp/includes//class-date.php
<?php
/**
 * UsersWP date related functions
 *
 * All UsersWP date related functions can be found here.
 *
 * @since      1.0.0
 * @author     GeoDirectory Team <info@wpgeodirectory.com>
 */
class UsersWP_Date {

    /**
     * Converts PHP Date format to jQuery UI date format.
     *
     * @since       1.0.0
     * @package     userswp
     * @param       string      $php_format     Date Format.
     * @return      string                      Formatted Date.
     */
    public function date_format_php_to_jqueryui( $php_format ) {
        $symbols = array(
            // Day
            'd' => 'dd',
            'D' => 'D',
            'j' => 'd',
            'l' => 'DD',
            'N' => '',
            'S' => '',
            'w' => '',
            'z' => 'o',
            // Week
            'W' => '',
            // Month
            'F' => 'MM',
            'm' => 'mm',
            'M' => 'M',
            'n' => 'm',
            't' => '',
            // Year
            'L' => '',
            'o' => '',
            'Y' => 'yy',
            'y' => 'y',
            // Time
            'a' => 'tt',
            'A' => 'TT',
            'B' => '',
            'g' => 'h',
            'G' => 'H',
            'h' => 'hh',
            'H' => 'HH',
            'i' => 'mm',
            's' => '',
            'u' => ''
        );

        $jqueryui_format = "";
        $escaping = false;

        for ( $i = 0; $i < strlen( $php_format ); $i++ ) {
            $char = $php_format[$i];

            // PHP date format escaping character
            if ( $char === '\\' ) {
                $i++;

                if ( $escaping ) {
                    $jqueryui_format .= $php_format[$i];
                } else {
                    $jqueryui_format .= '\'' . $php_format[$i];
                }

                $escaping = true;
            } else {
                if ( $escaping ) {
                    $jqueryui_format .= "'";
                    $escaping = false;
                }

                if ( isset( $symbols[$char] ) ) {
                    $jqueryui_format .= $symbols[$char];
                } else {
                    $jqueryui_format .= $char;
                }
            }
        }

        return $jqueryui_format;
    }

    /**
     * Converts date from one format to another. 
     *
     * @since       1.0.0
     * @package     userswp
     * @param       string      $date_input         Date string to convert.
     * @param       string      $date_to            Date format to convert to.
     * @param       string      $date_from          Date format to convert from.
     * @return      string                          Converted date.
     */
    public function date($date_input, $date_to, $date_from = '') {
        if (empty($date_input) || empty($date_to)) {
            return NULL;
        }

        $date = '';
        if (!empty($date_from)) {
            $datetime = date_create_from_format($date_from, $date_input);

            if (!empty($datetime)) {
                $date = $datetime->format($date_to);
            }
        }

        if (empty($date)) {
            $date = strpos($date_input, '/') !== false ? str_replace('/', '-', $date_input) : $date_input;
            $date = date_i18n($date_to, strtotime($date));
        }

        $date = $this->maybe_untranslate_date($date);

        return apply_filters('uwp_date', $date, $date_input, $date_to, $date_from);
    }

    /**
     * Converts non english date months to english date months.
     *
     * @since       1.0.0
     * @package     userswp
     * @param       string      $date   Date String.
     * @return      string              Converted Date.
     */
    public function maybe_untranslate_date($date){
        $english_long_months = array(
            'January',
            'February',
            'March',
            'April',
            'May',
            'June',
            'July',
            'August',
            'September',
            'October',
            'November',
            'December',
        );

        $non_english_long_months  = array(
            __('January'),
            __('February'),
            __('March'),
            __('April'),
            __('May'),
            __('June'),
            __('July'),
            __('August'),
            __('September'),
            __('October'),
            __('November'),
            __('December'),
        );
        $date = str_replace($non_english_long_months,$english_long_months,$date);


        $english_short_months = array(
            ' Jan ',
            ' Feb ',
            ' Mar ',
            ' Apr ',
            ' May ',
            ' Jun ',
            ' Jul ',
            ' Aug ',
            ' Sep ',
            ' Oct ',
            ' Nov ',
            ' Dec ',
        );

        $non_english_short_months = array(
            ' '._x( 'Jan', 'January abbreviation' ).' ',
            ' '._x( 'Feb', 'February abbreviation' ).' ',
            ' '._x( 'Mar', 'March abbreviation' ).' ',
            ' '._x( 'Apr', 'April abbreviation' ).' ',
            ' '._x( 'May', 'May abbreviation' ).' ',
            ' '._x( 'Jun', 'June abbreviation' ).' ',
            ' '._x( 'Jul', 'July abbreviation' ).' ',
            ' '._x( 'Aug', 'August abbreviation' ).' ',
            ' '._x( 'Sep', 'September abbreviation' ).' ',
            ' '._x( 'Oct', 'October abbreviation' ).' ',
            ' '._x( 'Nov', 'November abbreviation' ).' ',
            ' '._x( 'Dec', 'December abbreviation' ).' ',
        );

        $date = str_replace($non_english_short_months,$english_short_months,$date);


        return $date;
    }

    /**
     * Gets random date.
     *
     * @since       1.0.0
     * @package     userswp
     *
     * @param       int $days_from      Random days from.
     * @param       int $days_to        Random days to.
     *
     * @return      string              Formatted date string.
     */
    public function get_random_date( $days_from = 30, $days_to = 0 ) {
        // 1 day in seconds is 86400
        $from = $days_from * rand( 10000, 99999 );

        // $days_from should always be less than $days_to
        if ( $days_to > $days_from ) {
            $days_to = $days_from - 1;
        }

        $to        = $days_to * rand( 10000, 99999 );
        $date_from = time() - $from;
        $date_to   = time() - $to;

        return date( 'Y-m-d H:i:s', rand( $date_from, $date_to ) );
    }

}

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
July 10 2025 04:32:23
inteuuod / inteuuod
0755
helpers
--
July 10 2025 04:32:23
inteuuod / inteuuod
0755
libraries
--
July 10 2025 04:32:23
inteuuod / inteuuod
0755
.htaccess
0.41 KB
July 10 2025 04:32:23
inteuuod / inteuuod
0644
abstract-uwp-privacy.php
3.543 KB
May 24 2018 18:32:58
inteuuod / inteuuod
0644
class-account.php
9.071 KB
January 09 2025 21:52:58
inteuuod / inteuuod
0644
class-activator.php
30.118 KB
February 04 2025 23:32:52
inteuuod / inteuuod
0644
class-addons.php
9.592 KB
March 13 2024 17:47:28
inteuuod / inteuuod
0644
class-ajax.php
2.782 KB
March 13 2024 17:47:28
inteuuod / inteuuod
0644
class-countries.php
11.445 KB
April 28 2022 17:18:48
inteuuod / inteuuod
0644
class-date.php
6.316 KB
September 19 2017 17:57:46
inteuuod / inteuuod
0644
class-emails.php
22.155 KB
April 10 2025 19:10:18
inteuuod / inteuuod
0644
class-files.php
23.46 KB
July 16 2024 18:34:28
inteuuod / inteuuod
0644
class-forms.php
170.66 KB
February 19 2025 22:09:02
inteuuod / inteuuod
0644
class-meta.php
12.987 KB
May 25 2022 16:36:12
inteuuod / inteuuod
0644
class-notices.php
7.954 KB
December 12 2024 21:47:10
inteuuod / inteuuod
0644
class-pages.php
17.646 KB
June 01 2021 17:14:04
inteuuod / inteuuod
0644
class-profile.php
60.792 KB
March 13 2024 17:47:28
inteuuod / inteuuod
0644
class-status.php
19.468 KB
July 16 2020 17:09:12
inteuuod / inteuuod
0644
class-tables.php
13.046 KB
June 25 2024 02:23:32
inteuuod / inteuuod
0644
class-templates.php
43.835 KB
March 19 2025 15:13:04
inteuuod / inteuuod
0644
class-tools.php
38.828 KB
March 13 2024 17:47:28
inteuuod / inteuuod
0644
class-user-notifications.php
5.606 KB
February 19 2025 22:09:02
inteuuod / inteuuod
0644
class-userswp.php
35.552 KB
February 04 2025 23:32:52
inteuuod / inteuuod
0644
class-uwp-background-updater.php
3.044 KB
June 27 2019 18:13:34
inteuuod / inteuuod
0644
class-uwp-compatibility.php
3.123 KB
October 10 2024 19:01:40
inteuuod / inteuuod
0644
class-uwp-defaults.php
9.666 KB
February 04 2025 23:32:52
inteuuod / inteuuod
0644
class-uwp-privacy-erasers.php
1.328 KB
May 24 2018 18:32:58
inteuuod / inteuuod
0644
class-uwp-privacy-exporters.php
3.309 KB
February 19 2020 16:22:32
inteuuod / inteuuod
0644
class-uwp-privacy.php
3.062 KB
December 20 2024 18:16:58
inteuuod / inteuuod
0644
class-uwp-seo.php
11.987 KB
March 13 2024 17:47:28
inteuuod / inteuuod
0644
class-validation.php
15.852 KB
November 01 2023 11:49:38
inteuuod / inteuuod
0644
deprecated-functions.php
0.181 KB
January 23 2020 19:10:04
inteuuod / inteuuod
0644
helpers.php
0.502 KB
January 23 2020 19:10:04
inteuuod / inteuuod
0644
index.php
0.025 KB
July 27 2017 16:44:24
inteuuod / inteuuod
0644
template-functions.php
6.082 KB
December 12 2024 21:47:10
inteuuod / inteuuod
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF