Plugin Directory

Changeset 3249999


Ignore:
Timestamp:
03/04/2025 02:21:29 AM (10 months ago)
Author:
realwebcare
Message:

Committing Muslim Prayer Time BD v3.0.2

Location:
muslim-prayer-time-bd/trunk
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • muslim-prayer-time-bd/trunk/actions/mptbd-functions.php

    r3243224 r3249999  
    88 * The class supports both Bengali and English outputs for better localization.
    99 *
    10  * @package Muslim Prayer Time BD - v3.0.1 - 18 February, 2025
     10 * @package Muslim Prayer Time BD - v3.0.2 - 4 March, 2025
    1111 * @link https://www.realwebcare.com/
    1212 */
     
    3131
    3232            // 12-hour or 24-hour format
    33             $this->time_format = isset( $timecon_options['time_format'] ) ? absint( $timecon_options['time_format'] ) : 12;
     33            $this->time_format = isset( $timecon_options['time_format'] ) ? intval( $timecon_options['time_format'] ) : 12;
    3434
    3535            // AM/PM in the prayer times
     
    278278            }
    279279
    280             return '';
     280            return '0 minutes'; // Default for districts 57-64
    281281        }
    282282
     
    301301         * The time is optionally converted to Bangla if the prayer language setting is enabled.
    302302         *
    303          * @param string $prayer_name The name of the prayer (e.g., 'fajr', 'duhr').
     303         * @param string $prayer_time The name of the prayer (e.g., 'fajr', 'duhr').
    304304         * @param string $mod_time Optional modification to be added to the base time.
    305305         * @param string $type The type of adjustment ('sehri' or 'prayer').
     
    307307         * @return string The formatted prayer time, or an error message if the time is invalid.
    308308         */
    309         public function mptbd_prayer_district_time( $prayer_name, $mod_time = '', $type = '' ) {
     309        public function mptbd_prayer_district_time( $prayer_time, $mod_time = '' ) {
    310310            // Set the Bangladesh timezone
    311311            $bangladesh_timezone = new DateTimeZone('Asia/Dhaka');
    312312       
    313313            // Create a DateTime object for the prayer time in Bangladesh timezone
    314             $base_time = DateTime::createFromFormat('H:i', $prayer_name, $bangladesh_timezone);
     314            $base_time = DateTime::createFromFormat('H:i', $prayer_time, $bangladesh_timezone);
    315315       
    316316            if ( ! $base_time ) {
     
    320320            // Apply modification if provided
    321321            if ( ! empty( $mod_time ) ) {
    322                 $mod_interval = DateInterval::createFromDateString($mod_time);
     322                $mod_interval = DateInterval::createFromDateString( $mod_time );
     323
    323324                if ( ! $mod_interval ) {
    324325                    return "Invalid Modified Time";
    325326                }
    326                 $base_time->add($mod_interval);
    327             }
    328        
    329             // Determine adjustment based on type
    330             $adjust_key = $type === 'sehri' ? 'adj_sehri_time' : 'adj_prayer_time';
    331             $section = $type === 'sehri' ? 'mptbd_ramadan' : 'mptbd_timecon';
    332             $options = get_option( $section );
    333             $adjust = isset( $options[$adjust_key] ) ? absint( $options[$adjust_key] ) . ' minutes' : '0 minutes';
    334        
    335             // Apply adjustment
    336             $adjust_interval = DateInterval::createFromDateString($adjust);
    337             if ( ! $adjust_interval ) {
    338                 return "Invalid Adjusted Time";
    339             }
    340             $base_time->add($adjust_interval);
     327
     328                $base_time->add( $mod_interval );
     329            }
    341330       
    342331            // Format the time using WordPress's timezone functions
  • muslim-prayer-time-bd/trunk/actions/mptbd-shortcode.php

    r3243224 r3249999  
    88 * and dynamic adjustments to prayer times based on user-selected settings.
    99 *
    10  * @package Muslim Prayer Time BD - v3.0.1 - 18 February, 2025
     10 * @package Muslim Prayer Time BD - v3.0.2 - 4 March, 2025
    1111 * @link https://www.realwebcare.com/
    1212 */
  • muslim-prayer-time-bd/trunk/actions/mptbd-widget.php

    r3243224 r3249999  
    88 * updating widget settings.
    99 *
    10  * @package Muslim Prayer Time BD - v3.0.1 - 18 February, 2025
     10 * @package Muslim Prayer Time BD - v3.0.2 - 4 March, 2025
    1111 * @link https://www.realwebcare.com/
    1212 */
  • muslim-prayer-time-bd/trunk/assets/css/mptbd-admin.css

    r3243224 r3249999  
    11/*!
    2 * @package Muslim Prayer Time BD - v3.0.1 - 18 February, 2025
     2* @package Muslim Prayer Time BD - v3.0.2 - 4 March, 2025
    33* @link https://www.realwebcare.com/
    44*/
  • muslim-prayer-time-bd/trunk/assets/css/mptbd-style.css

    r3243224 r3249999  
    11/*!
    2  * @package Muslim Prayer Time BD - v3.0.1 - 18 February, 2025
     2 * @package Muslim Prayer Time BD - v3.0.2 - 4 March, 2025
    33 * @link https://www.realwebcare.com/
    44 */
  • muslim-prayer-time-bd/trunk/assets/js/mptbd-admin.js

    r3243224 r3249999  
    11/*!
    2  * @package Muslim Prayer Time BD - v3.0.1 - 18 February, 2025
     2 * @package Muslim Prayer Time BD - v3.0.2 - 4 March, 2025
    33 * @link https://www.realwebcare.com/
    44 */
  • muslim-prayer-time-bd/trunk/assets/js/mptbd-script.js

    r3243224 r3249999  
    44 * This script provides interactive behavior for the frontend of the Muslim Prayer Time BD plugin.
    55 *
    6  * @package Muslim Prayer Time BD - v3.0.1 - 18 February, 2025
     6 * @package Muslim Prayer Time BD - v3.0.2 - 4 March, 2025
    77 * @link https://www.realwebcare.com/
    88 */
  • muslim-prayer-time-bd/trunk/inc/init-mptbd.php

    r3243224 r3249999  
    1010 * within the WordPress ecosystem and provides an optimal user experience.
    1111 *
    12  * @package Muslim Prayer Time BD - v3.0.1 - 18 February, 2025
     12 * @package Muslim Prayer Time BD - v3.0.2 - 4 March, 2025
    1313 * @link https://www.realwebcare.com/
    1414 */
  • muslim-prayer-time-bd/trunk/inc/mptbd-enqueue.php

    r3243224 r3249999  
    1111 * improving performance and maintaining a clean and optimized page.
    1212 *
    13  * @package Muslim Prayer Time BD - v3.0.1 - 18 February, 2025
     13 * @package Muslim Prayer Time BD - v3.0.2 - 4 March, 2025
    1414 * @link https://www.realwebcare.com/
    1515 */
     
    5252         */
    5353        public function mptbd_enqueue_scripts() {
    54             wp_enqueue_script( 'mptbd-script', MPTBD_PLUGIN_URL . 'assets/js/mptbd-script.js', array('jquery', 'wp-util'), '2.5', true );
    55 
    56             wp_enqueue_style( 'mptbd-style', MPTBD_PLUGIN_URL . 'assets/css/mptbd-style.css', '', '2.5' );
     54            wp_enqueue_script( 'mptbd-script', MPTBD_PLUGIN_URL . 'assets/js/mptbd-script.js', array('jquery', 'wp-util'), '3.0.2', true );
     55
     56            wp_enqueue_style( 'mptbd-style', MPTBD_PLUGIN_URL . 'assets/css/mptbd-style.css', '', '3.0.2' );
    5757
    5858            wp_localize_script( 'mptbd-script', 'mptbdAjax', array(
  • muslim-prayer-time-bd/trunk/inc/mptbd-help.php

    r3243224 r3249999  
    99 * on how to use shortcodes, widget integration, and customizations with attributes for prayer time display.
    1010 *
    11  * @package Muslim Prayer Time BD - v3.0.1 - 18 February, 2025
     11 * @package Muslim Prayer Time BD - v3.0.2 - 4 March, 2025
    1212 * @link https://www.realwebcare.com/
    1313 */
  • muslim-prayer-time-bd/trunk/inc/mptbd-perpetual_calendar.php

    r3243224 r3249999  
    99 * regardless of the geographic location.
    1010 *
    11  * @package Muslim Prayer Time BD - v3.0.1 - 18 February, 2025
     11 * @package Muslim Prayer Time BD - v3.0.2 - 4 March, 2025
    1212 * @link https://www.realwebcare.com/
    1313 */
  • muslim-prayer-time-bd/trunk/inc/mptbd-sidebar.php

    r3243224 r3249999  
    1010 * and allows for custom CSS class inclusion for styling.
    1111 *
    12  * @package Muslim Prayer Time BD - v3.0.1 - 18 February, 2025
     12 * @package Muslim Prayer Time BD - v3.0.2 - 4 March, 2025
    1313 * @link https://www.realwebcare.com/
    1414 */
     
    125125                            <ul class="mptbdusage-list">
    126126                                <li>Muslim Prayer Time BD</li>
    127                                 <li>Version: 3.0.1</li>
     127                                <li>Version: 3.0.2</li>
    128128                                <li>Scripts: PHP + CSS + JS</li>
    129129                                <li>Requires: Wordpress 5.4+</li>
    130130                                <li>First release: 23 January, 2014</li>
    131                                 <li>Last Update: 19 February, 2025</li>
     131                                <li>Last Update: 4 March, 2025</li>
    132132                                <li>By: <a href="%1$s" target="_blank">Realwebcare</a></li>
    133133                                <li>Facebook Page: <a href="%2$s" target="_blank">Realwebcare</a></li>
  • muslim-prayer-time-bd/trunk/muslim-prayer-time-bd.php

    r3243224 r3249999  
    44 * Plugin URI:        http://wordpress.org/plugins/muslim-prayer-time-bd/
    55 * Description:       Muslim Prayer Time BD plugin displays prayer (salah) times for Muslims in Bangladesh with a beautifully designed widget.
    6  * Version:           3.0.1
     6 * Version:           3.0.2
    77 * Requires at least: 5.2
    88 * Requires PHP:      7.4
  • muslim-prayer-time-bd/trunk/process/render-prayer-time.php

    r3243224 r3249999  
    1111 * taking into account any time modifications.
    1212 *
    13  * @package Muslim Prayer Time BD - v3.0.1 - 18 February, 2025
     13 * @package Muslim Prayer Time BD - v3.0.2 - 4 March, 2025
    1414 * @link https://www.realwebcare.com/
    1515 */
     
    6262
    6363            $default_city = absint( mptbd_get_option( 'default_city', 'mptbd_general', 58 ) );
    64  
    65             $prayer_adjust = absint( mptbd_get_option( 'adj_prayer_time', 'mptbd_timecon', 0 ) ) . ' minutes';
     64
     65            $prayer_adjust = intval( mptbd_get_option( 'adj_prayer_time', 'mptbd_timecon', 0 ) ) . ' minutes';
    6666
    6767            $default_prayers = $prayer_ln == 'en_US' ? 'Fajr, Duhr, Asr, Maghrib, Isha, Sunrise' : 'ফজর, যোহর, আছর, মাগরিব, এশা, সূর্যোদয়';
     
    103103            <div class="prayer_name">
    104104                <ul><?php
    105                     foreach($prayer_names as $prayer) {
    106                         echo '<li class="time_table">'.esc_html($prayer).'</li>';
     105                    foreach ( $prayer_names as $prayer ) {
     106                        echo '<li class="time_table">'.esc_html( $prayer ).'</li>';
    107107                    } ?>
    108108                </ul>
     
    110110            <div class="prayer_time">
    111111                <ul><?php
    112                     for($mptbd = 1; $mptbd < 7; $mptbd++) {
    113                         if($city_id != '') {
    114                             if( $city_id > 0 && $city_id < 6 ) {
    115                                 foreach($period_times as $key => $period) {
    116                                     if($mptbd == $key + 1) { ?><li class="time_table"><?php if($period != '') { echo esc_html($period).' ' ; } echo esc_html( $this->get_functions->mptbd_prayer_district_time($time_schedule[$pr_names[$key]], '-1 minutes') ); ?></li><?php }
     112                    if ( ! empty( $city_id ) && $city_id < 57 ) {
     113                        $prayers_adjust = $this->get_functions->mptbd_time_adjustment( $city_id );
     114                        $prayers_adjust = $prayers_adjust . " " . $prayer_adjust;
     115                    } else {
     116                        $prayers_adjust = !empty( $adjust_time ) && $adjust_time !== '0 minutes' ? $adjust_time : $prayer_adjust;
     117                    }
     118
     119                    for ( $mptbd = 1; $mptbd < 7; $mptbd++ ) {
     120                        foreach ( $period_times as $key => $period ) {
     121                            if ( $mptbd == $key + 1 ) {
     122                                echo '<li class="time_table">';
     123                                if ( !empty( $period ) ) {
     124                                    echo esc_html( $period ) . ' ';
    117125                                }
    118                             } elseif( $city_id == 6 ) {
    119                                 foreach($period_times as $key => $period) {
    120                                     if($mptbd == $key + 1) { ?><li class="time_table"><?php if($period != '') { echo esc_html($period).' ' ; } echo esc_html( $this->get_functions->mptbd_prayer_district_time($time_schedule[$pr_names[$key]], '-2 minutes') ); ?></li><?php }
    121                                 }
    122                             } elseif( $city_id > 6 && $city_id < 10 ) {
    123                                 foreach($period_times as $key => $period) {
    124                                     if($mptbd == $key + 1) { ?><li class="time_table"><?php if($period != '') { echo esc_html($period).' ' ; } echo esc_html( $this->get_functions->mptbd_prayer_district_time($time_schedule[$pr_names[$key]], '-3 minutes') ); ?></li><?php }
    125                                 }
    126                             } elseif( $city_id > 9 && $city_id < 13 ) {
    127                                 foreach($period_times as $key => $period) {
    128                                     if($mptbd == $key + 1) { ?><li class="time_table"><?php if($period != '') { echo esc_html($period).' ' ; } echo esc_html( $this->get_functions->mptbd_prayer_district_time($time_schedule[$pr_names[$key]], '-4 minutes') ); ?></li><?php }
    129                                 }
    130                             } elseif( $city_id > 12 && $city_id < 15 ) {
    131                                 foreach($period_times as $key => $period) {
    132                                     if($mptbd == $key + 1) { ?><li class="time_table"><?php if($period != '') { echo esc_html($period).' ' ; } echo esc_html( $this->get_functions->mptbd_prayer_district_time($time_schedule[$pr_names[$key]], '-5 minutes') ); ?></li><?php }
    133                                 }
    134                             } elseif( $city_id > 14 && $city_id < 18 ) {
    135                                 foreach($period_times as $key => $period) {
    136                                     if($mptbd == $key + 1) { ?><li class="time_table"><?php if($period != '') { echo esc_html($period).' ' ; } echo esc_html( $this->get_functions->mptbd_prayer_district_time($time_schedule[$pr_names[$key]], '-6 minutes') ); ?></li><?php }
    137                                 }
    138                             } elseif( $city_id > 17 && $city_id < 20 ) {
    139                                 foreach($period_times as $key => $period) {
    140                                     if($mptbd == $key + 1) { ?><li class="time_table"><?php if($period != '') { echo esc_html($period).' ' ; } echo esc_html( $this->get_functions->mptbd_prayer_district_time($time_schedule[$pr_names[$key]], '-7 minutes') ); ?></li><?php }
    141                                 }
    142                             } elseif( $city_id > 19 && $city_id < 23 ) {
    143                                 foreach($period_times as $key => $period) {
    144                                     if($mptbd == $key + 1) { ?><li class="time_table"><?php if($period != '') { echo esc_html($period).' ' ; } echo esc_html( $this->get_functions->mptbd_prayer_district_time($time_schedule[$pr_names[$key]], '+1 minutes') ); ?></li><?php }
    145                                 }
    146                             } elseif( $city_id > 22 && $city_id < 30 ) {
    147                                 foreach($period_times as $key => $period) {
    148                                     if($mptbd == $key + 1) { ?><li class="time_table"><?php if($period != '') { echo esc_html($period).' ' ; } echo esc_html( $this->get_functions->mptbd_prayer_district_time($time_schedule[$pr_names[$key]], '+2 minutes') ); ?></li><?php }
    149                                 }
    150                             } elseif( $city_id > 29 && $city_id < 34 ) {
    151                                 foreach($period_times as $key => $period) {
    152                                     if($mptbd == $key + 1) { ?><li class="time_table"><?php if($period != '') { echo esc_html($period).' ' ; } echo esc_html( $this->get_functions->mptbd_prayer_district_time($time_schedule[$pr_names[$key]], '+3 minutes') ); ?></li><?php }
    153                                 }
    154                             } elseif( $city_id > 33 && $city_id < 40 ) {
    155                                 foreach($period_times as $key => $period) {
    156                                     if($mptbd == $key + 1) { ?><li class="time_table"><?php if($period != '') { echo esc_html($period).' ' ; } echo esc_html( $this->get_functions->mptbd_prayer_district_time($time_schedule[$pr_names[$key]], '+4 minutes') ); ?></li><?php }
    157                                 }
    158                             } elseif( $city_id > 39 && $city_id < 46 ) {
    159                                 foreach($period_times as $key => $period) {
    160                                     if($mptbd == $key + 1) { ?><li class="time_table"><?php if($period != '') { echo esc_html($period).' ' ; } echo esc_html( $this->get_functions->mptbd_prayer_district_time($time_schedule[$pr_names[$key]], '+5 minutes') ); ?></li><?php }
    161                                 }
    162                             } elseif( $city_id > 45 && $city_id < 51 ) {
    163                                 foreach($period_times as $key => $period) {
    164                                     if($mptbd == $key + 1) { ?><li class="time_table"><?php if($period != '') { echo esc_html($period).' ' ; } echo esc_html( $this->get_functions->mptbd_prayer_district_time($time_schedule[$pr_names[$key]], '+6 minutes') ); ?></li><?php }
    165                                 }
    166                             } elseif( $city_id > 50 && $city_id < 55 ) {
    167                                 foreach($period_times as $key => $period) {
    168                                     if($mptbd == $key + 1) { ?><li class="time_table"><?php if($period != '') { echo esc_html($period).' ' ; } echo esc_html( $this->get_functions->mptbd_prayer_district_time($time_schedule[$pr_names[$key]], '+7 minutes') ); ?></li><?php }
    169                                 }
    170                             } elseif( $city_id > 54 && $city_id < 57 ) {
    171                                 foreach($period_times as $key => $period) {
    172                                     if($mptbd == $key + 1) { ?><li class="time_table"><?php if($period != '') { echo esc_html($period).' ' ; } echo esc_html( $this->get_functions->mptbd_prayer_district_time($time_schedule[$pr_names[$key]], '+8 minutes') ); ?></li><?php }
    173                                 }
    174                             } else {
    175                                 foreach($period_times as $key => $period) {
    176                                     if($mptbd == $key + 1) { ?><li class="time_table"><?php if($period != '') { echo esc_html($period).' ' ; } echo esc_html( $this->get_functions->mptbd_prayer_district_time($time_schedule[$pr_names[$key]], $prayer_adjust) ); ?></li><?php }
    177                                 }
    178                             }
    179                         } else {
    180                             if($adjust_time != '') {
    181                                 foreach($period_times as $key => $period) {
    182                                     if($mptbd == $key + 1) { ?><li class="time_table"><?php if($period != '') { echo esc_html($period).' ' ; } echo esc_html( $this->get_functions->mptbd_prayer_district_time($time_schedule[$pr_names[$key]], $adjust_time) ); ?></li><?php }
    183                                 }
    184                             }
    185                             else {
    186                                 foreach($period_times as $key => $period) {
    187                                     if($mptbd == $key + 1) { ?><li class="time_table"><?php if($period != '') { echo esc_html($period).' ' ; } echo esc_html( $this->get_functions->mptbd_prayer_district_time($time_schedule[$pr_names[$key]], $prayer_adjust) ); ?></li><?php }
    188                                 }
     126                                echo esc_html( $this->get_functions->mptbd_prayer_district_time( $time_schedule[$pr_names[$key]], $prayers_adjust ) );
     127                                echo '</li>';
    189128                            }
    190129                        }
  • muslim-prayer-time-bd/trunk/process/render-sehri-card.php

    r3243224 r3249999  
    1010 * such as time adjustments for Sehri and Iftar.
    1111 *
    12  * @package Muslim Prayer Time BD - v3.0.1 - 18 February, 2025
     12 * @package Muslim Prayer Time BD - v3.0.2 - 4 March, 2025
    1313 * @link https://www.realwebcare.com/
    1414 */
     
    5959            $default_city = absint( mptbd_get_option( 'default_city', 'mptbd_general', 58 ) );
    6060 
    61             $prayer_adjust = absint( mptbd_get_option( 'adj_prayer_time', 'mptbd_timecon', 0 ) ) . ' minutes';
     61            $prayer_adjust = intval( mptbd_get_option( 'adj_prayer_time', 'mptbd_timecon', 0 ) ) . ' minutes';
    6262
    63             $sehri_adjust = absint( mptbd_get_option( 'adj_sehri_time', 'mptbd_ramadan', 0 ) ) . ' minutes';
     63            $sehri_adjust = intval( mptbd_get_option( 'adj_sehri_time', 'mptbd_ramadan', 0 ) ) . ' minutes';
    6464
    6565            $default_sehri_title = $prayer_ln == 'en_US' ? 'Last Time of Sehri:' : 'সেহরির শেষ সময় - ভোর:';
     
    8080
    8181            <div class="sehri_time"><?php
    82                 if( $city_id != '' ) {
    83                     if( $city_id > 0 && $city_id < 6 ) {
    84                         echo esc_html($sehri_title) . ' ' .  esc_html( $this->get_functions->mptbd_prayer_district_time($time_schedule['sehri'], '-1 minutes', 'sehri') );
    85                     } elseif( $city_id == 6 ) {
    86                         echo esc_html($sehri_title) . ' ' .  esc_html( $this->get_functions->mptbd_prayer_district_time($time_schedule['sehri'], '-2 minutes', 'sehri') );
    87                     } elseif( $city_id > 6 && $city_id < 10 ) {
    88                         echo esc_html($sehri_title) . ' ' .  esc_html( $this->get_functions->mptbd_prayer_district_time($time_schedule['sehri'], '-3 minutes', 'sehri') );
    89                     } elseif( $city_id > 9 && $city_id < 13 ) {
    90                         echo esc_html($sehri_title) . ' ' .  esc_html( $this->get_functions->mptbd_prayer_district_time($time_schedule['sehri'], '-4 minutes', 'sehri') );
    91                     } elseif( $city_id > 12 && $city_id < 15 ) {
    92                         echo esc_html($sehri_title) . ' ' .  esc_html( $this->get_functions->mptbd_prayer_district_time($time_schedule['sehri'], '-5 minutes', 'sehri') );
    93                     } elseif( $city_id > 14 && $city_id < 18 ) {
    94                         echo esc_html($sehri_title) . ' ' .  esc_html( $this->get_functions->mptbd_prayer_district_time($time_schedule['sehri'], '-6 minutes', 'sehri') );
    95                     } elseif( $city_id > 17 && $city_id < 20 ) {
    96                         echo esc_html($sehri_title) . ' ' .  esc_html( $this->get_functions->mptbd_prayer_district_time($time_schedule['sehri'], '-7 minutes', 'sehri') );
    97                     } elseif( $city_id > 19 && $city_id < 23 ) {
    98                         echo esc_html($sehri_title) . ' ' .  esc_html( $this->get_functions->mptbd_prayer_district_time($time_schedule['sehri'], '+1 minutes', 'sehri') );
    99                     } elseif( $city_id > 22 && $city_id < 30 ) {
    100                         echo esc_html($sehri_title) . ' ' .  esc_html( $this->get_functions->mptbd_prayer_district_time($time_schedule['sehri'], '+2 minutes', 'sehri') );
    101                     } elseif( $city_id > 29 && $city_id < 34 ) {
    102                         echo esc_html($sehri_title) . ' ' .  esc_html( $this->get_functions->mptbd_prayer_district_time($time_schedule['sehri'], '+3 minutes', 'sehri') );
    103                     } elseif( $city_id > 33 && $city_id < 40 ) {
    104                         echo esc_html($sehri_title) . ' ' .  esc_html( $this->get_functions->mptbd_prayer_district_time($time_schedule['sehri'], '+4 minutes', 'sehri') );
    105                     } elseif( $city_id > 39 && $city_id < 46 ) {
    106                         echo esc_html($sehri_title) . ' ' .  esc_html( $this->get_functions->mptbd_prayer_district_time($time_schedule['sehri'], '+5 minutes', 'sehri') );
    107                     } elseif( $city_id > 45 && $city_id < 51 ) {
    108                         echo esc_html($sehri_title) . ' ' .  esc_html( $this->get_functions->mptbd_prayer_district_time($time_schedule['sehri'], '+6 minutes', 'sehri') );
    109                     } elseif( $city_id > 50 && $city_id < 55 ) {
    110                         echo esc_html($sehri_title) . ' ' .  esc_html( $this->get_functions->mptbd_prayer_district_time($time_schedule['sehri'], '+7 minutes', 'sehri') );
    111                     } elseif( $city_id > 54 && $city_id < 57 ) {
    112                         echo esc_html($sehri_title) . ' ' .  esc_html( $this->get_functions->mptbd_prayer_district_time($time_schedule['sehri'], '+8 minutes', 'sehri') );
    113                     } else {
    114                         echo esc_html($sehri_title) . ' ' .  esc_html( $this->get_functions->mptbd_prayer_district_time($time_schedule['sehri'], $sehri_adjust) );
    115                     }
     82                if ( ! empty( $city_id ) && $city_id < 57 ) {
     83                    $prayers_adjust = $this->get_functions->mptbd_time_adjustment( $city_id );
     84                    $prayers_adjust = $prayers_adjust . ' ' . $prayer_adjust;
    11685                } else {
    117                     if( $adjust_time != '' ) {
    118                         echo esc_html($sehri_title) . ' ' .  esc_html( $this->get_functions->mptbd_prayer_district_time($time_schedule['sehri'], $adjust_time, 'sehri') );
    119                     } else {
    120                         echo esc_html($sehri_title) . ' ' .  esc_html( $this->get_functions->mptbd_prayer_district_time($time_schedule['sehri'], $sehri_adjust) );
    121                     }
    122                 } ?>
     86                    $prayers_adjust = !empty( $adjust_time ) && $adjust_time !== '0 minutes' ? $adjust_time : $sehri_adjust;
     87                }
     88
     89                echo esc_html( $sehri_title ) . ' ' .  esc_html( $this->get_functions->mptbd_prayer_district_time( $time_schedule['sehri'], $prayers_adjust ) ); ?>
    12390            </div>
    12491            <div class="iftar_time"><?php
    125                 if($city_id != '') {
    126                     if( $city_id > 0 && $city_id < 6 ) {
    127                         echo esc_html($iftar_title) . ' ' .  esc_html( $this->get_functions->mptbd_prayer_district_time($time_schedule['maghrib'], '-1 minutes') );
    128                     } elseif( $city_id == 6 ) {
    129                         echo esc_html($iftar_title) . ' ' .  esc_html( $this->get_functions->mptbd_prayer_district_time($time_schedule['maghrib'], '-2 minutes') );
    130                     } elseif( $city_id > 6 && $city_id < 10 ) {
    131                         echo esc_html($iftar_title) . ' ' .  esc_html( $this->get_functions->mptbd_prayer_district_time($time_schedule['maghrib'], '-3 minutes') );
    132                     } elseif( $city_id > 9 && $city_id < 13 ) {
    133                         echo esc_html($iftar_title) . ' ' .  esc_html( $this->get_functions->mptbd_prayer_district_time($time_schedule['maghrib'], '-4 minutes') );
    134                     } elseif( $city_id > 12 && $city_id < 15 ) {
    135                         echo esc_html($iftar_title) . ' ' .  esc_html( $this->get_functions->mptbd_prayer_district_time($time_schedule['maghrib'], '-5 minutes') );
    136                     } elseif( $city_id > 14 && $city_id < 18 ) {
    137                         echo esc_html($iftar_title) . ' ' .  esc_html( $this->get_functions->mptbd_prayer_district_time($time_schedule['maghrib'], '-6 minutes') );
    138                     } elseif( $city_id > 17 && $city_id < 20 ) {
    139                         echo esc_html($iftar_title) . ' ' .  esc_html( $this->get_functions->mptbd_prayer_district_time($time_schedule['maghrib'], '-7 minutes') );
    140                     } elseif( $city_id > 19 && $city_id < 23 ) {
    141                         echo esc_html($iftar_title) . ' ' .  esc_html( $this->get_functions->mptbd_prayer_district_time($time_schedule['maghrib'], '+1 minutes') );
    142                     } elseif( $city_id > 22 && $city_id < 30 ) {
    143                         echo esc_html($iftar_title) . ' ' .  esc_html( $this->get_functions->mptbd_prayer_district_time($time_schedule['maghrib'], '+2 minutes') );
    144                     } elseif( $city_id > 29 && $city_id < 34 ) {
    145                         echo esc_html($iftar_title) . ' ' .  esc_html( $this->get_functions->mptbd_prayer_district_time($time_schedule['maghrib'], '+3 minutes') );
    146                     } elseif( $city_id > 33 && $city_id < 40 ) {
    147                         echo esc_html($iftar_title) . ' ' .  esc_html( $this->get_functions->mptbd_prayer_district_time($time_schedule['maghrib'], '+4 minutes') );
    148                     } elseif( $city_id > 39 && $city_id < 46 ) {
    149                         echo esc_html($iftar_title) . ' ' .  esc_html( $this->get_functions->mptbd_prayer_district_time($time_schedule['maghrib'], '+5 minutes') );
    150                     } elseif( $city_id > 45 && $city_id < 51 ) {
    151                         echo esc_html($iftar_title) . ' ' .  esc_html( $this->get_functions->mptbd_prayer_district_time($time_schedule['maghrib'], '+6 minutes') );
    152                     } elseif( $city_id > 50 && $city_id < 55 ) {
    153                         echo esc_html($iftar_title) . ' ' .  esc_html( $this->get_functions->mptbd_prayer_district_time($time_schedule['maghrib'], '+7 minutes') );
    154                     } elseif( $city_id > 54 && $city_id < 57 ) {
    155                         echo esc_html($iftar_title) . ' ' .  esc_html( $this->get_functions->mptbd_prayer_district_time($time_schedule['maghrib'], '+8 minutes') );
    156                     } else {
    157                         echo esc_html($iftar_title) . ' ' .  esc_html( $this->get_functions->mptbd_prayer_district_time($time_schedule['maghrib'], $prayer_adjust) );
    158                     }
     92                if ( ! empty( $city_id ) && $city_id < 57 ) {
     93                    $prayers_adjust = $this->get_functions->mptbd_time_adjustment( $city_id );
     94                    $prayers_adjust = $prayers_adjust . ' ' . $prayer_adjust;
    15995                } else {
    160                     if( $adjust_time != '' ) {
    161                         echo esc_html($iftar_title) . ' ' .  esc_html( $this->get_functions->mptbd_prayer_district_time($time_schedule['maghrib'], $adjust_time) );
    162                     } else {
    163                         echo esc_html($iftar_title) . ' ' .  esc_html( $this->get_functions->mptbd_prayer_district_time($time_schedule['maghrib'], $prayer_adjust) );
    164                     }
    165                 } ?>
     96                    $prayers_adjust = !empty( $adjust_time ) && $adjust_time !== '0 minutes' ? $adjust_time : $prayer_adjust;
     97                }
     98
     99                echo esc_html( $iftar_title ) . ' ' .  esc_html( $this->get_functions->mptbd_prayer_district_time( $time_schedule['maghrib'], $prayers_adjust ) ); ?>
    166100            </div><?php
    167101        }
  • muslim-prayer-time-bd/trunk/readme.txt

    r3243226 r3249999  
    127127== Upgrade Notice ==
    128128
     129= 3.0.2 =
     130– This update fixes incorrect calculations for prayer time and Sehri time adjustments with ± minutes. Upgrade to ensure accurate time adjustments based on user input.
     131
    129132= 3.0.1 =
    130133– Updated widget to set default city and display Islamic quotes.
     
    140143
    141144== Changelog ==
     145
     146= 3.0.2 (4 March 2025) =
     147* Fixed: Incorrect calculation of prayer time and Sehri time adjustments with ± minutes.
     148* Improved: More accurate time adjustments based on user input.
    142149
    143150= 3.0.1 (19 February 2025) =
  • muslim-prayer-time-bd/trunk/settings/mptbd-class.settings-api.php

    r3243224 r3249999  
    1212 * @example example/oop-example.php How to use the class
    1313 *
    14  * @package Muslim Prayer Time BD - v3.0.1 - 18 February, 2025
     14 * @package Muslim Prayer Time BD - v3.0.2 - 4 March, 2025
    1515 * @link https://www.realwebcare.com/
    1616 */
  • muslim-prayer-time-bd/trunk/settings/mptbd-settings.php

    r3243224 r3249999  
    77 * It also includes functionality for displaying a help page, adding menu items, and retrieving pages.
    88 *
    9  * @package Muslim Prayer Time BD - v3.0.1 - 18 February, 2025
     9 * @package Muslim Prayer Time BD - v3.0.2 - 4 March, 2025
    1010 * @link https://www.realwebcare.com/
    1111 */
Note: See TracChangeset for help on using the changeset viewer.