WordPress.org

Plugin Directory

Changeset 1570280


Ignore:
Timestamp:
01/07/17 17:01:57 (11 months ago)
Author:
imran2w
Message:

update 852

Location:
bangla-date-display/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • bangla-date-display/trunk/bangla-date-display.php

    r1565605 r1570280  
    55Description: Displays Bangla, Gregorian and Hijri date in bangla language via widgets and shortcodes! Options for displaying post/page's time, date, comment count, archive calendar etc in Bangla language. 
    66Author: M.A. IMRAN 
    7 Version: 8.5.1 
     7Version: 8.5.2 
    88Author URI: http://facebook.com/imran2w 
    99*/ 
     
    2828 
    2929 
    30 include "translator.php"; 
    31 include "class.banglaDate.php"; 
     30require 'translator.php'; 
     31require 'class.banglaDate.php'; 
    3232 
    3333function bddp_bangla_time() { 
     
    4040    $hour = gmdate("G", time()+$offset); 
    4141     
    42     if ($hour >= 5 && $hour <= 5) { echo "ভোর "; } 
    43     else if ($hour >= 6 && $hour <= 11) { echo "সকাল "; } 
    44     else if ($hour >= 12 && $hour <= 14) { echo "দুপুর "; } 
    45     else if ($hour >= 15 && $hour <= 17) { echo "বিকাল "; } 
    46     else if ($hour >= 18 && $hour <= 19) { echo "সন্ধ্যা "; } 
    47     else { echo "রাত "; } 
    48      
    49     $str = en_to_bn(gmdate("g:i", time()+$offset)); 
    50     return $str; 
     42    ob_start(); // begin output buffering 
     43     
     44    if ($hour >= 5 && $hour <= 5) { $ddd = "ভোর "; } 
     45    else if ($hour >= 6 && $hour <= 11) { $ddd = "সকাল "; } 
     46    else if ($hour >= 12 && $hour <= 14) { $ddd = "দুপুর "; } 
     47    else if ($hour >= 15 && $hour <= 17) { $ddd = "বিকাল "; } 
     48    else if ($hour >= 18 && $hour <= 19) { $ddd = "সন্ধ্যা "; } 
     49    else { $ddd = "রাত "; } 
     50     
     51    printf ('%s', $ddd . ' ' . en_to_bn(gmdate("g:i", time()+$offset)) ); 
     52     
     53    $output = ob_get_contents(); // end output buffering 
     54    ob_end_clean(); // grab the buffer contents and empty the buffer 
     55    return $output; 
    5156    } 
    5257 
     
    111116    if (!is_array($bddp_options)) { 
    112117        $bddp_options = array( 
    113         'en_tz' => '6', 
     118        'bangla_tz' => '6', 
    114119        'separator' => ', ', 
    115120        'last_word' => '1', 
     
    148153    $offset = $bddp_options['hijri_adjust'] * 60 * 60; 
    149154     
    150     include "uCal.class.php"; 
     155    require_once "uCal.class.php"; 
    151156    $d = new uCal; 
    152157     
  • bangla-date-display/trunk/bddp_admin.php

    r1565605 r1570280  
    4646    <table class="form-table"> 
    4747        <tr valign="top"> 
    48         <th scope="row"><label for="bddp_options[trans_dt]">Translate:</label></th> 
     48        <th scope="row">Translate:</th> 
    4949        <td colspan="3"> 
    50         <select id="bddp_options[trans_dt]" name="bddp_options[trans_dt]"> 
    51 <option value="0"<?php if($bddp_options['trans_dt'] == "0") { echo " selected"; } ?>>None</option> 
    52 <option value="1"<?php if($bddp_options['trans_dt'] == "1") { echo " selected"; } ?>>All Time/Date (Recomended)</option> 
    53 <option value="2"<?php if($bddp_options['trans_dt'] == "2") { echo " selected"; } ?>>Post, Page and Comment's Time/Date</option> 
    54         </select> 
     50        <input id="bddp_options[trans_dt]" type="checkbox" name="bddp_options[trans_dt]" value="1" <?php if(isset($bddp_options['trans_dt'])==1) echo('checked="checked"'); ?>/><label for="bddp_options[trans_dt]">All Date/Time</label> 
    5551        </td> 
    5652        </tr> 
     
    6561 
    6662<div class="postbox"> 
    67     <h3 class="hndle" style="padding: 10px; margin: 0;"><span>Gregorian Date Settings</span></h3> 
     63    <h3 class="hndle" style="padding: 10px; margin: 0;"><span>Date/Time Settings</span></h3> 
    6864<div class="inside"><p align="justify">Choose a time zone for gregorian date...</p> 
    6965 
     
    129125        <td> 
    130126        <select id="bn_tz" name="bddp_options[bangla_tz]"> 
    131         <option value="-12"<?php if($bddp_options['bangla_tz'] == "-12") { echo " selected"; } ?>>GMT -12</option> 
    132         <option value="-11"<?php if($bddp_options['bangla_tz'] == "-11") { echo " selected"; } ?>>GMT -11</option> 
    133         <option value="-10"<?php if($bddp_options['bangla_tz'] == "-10") { echo " selected"; } ?>>GMT -10</option> 
    134         <option value="-9"<?php if($bddp_options['bangla_tz'] == "-9") { echo " selected"; } ?>>GMT -9</option> 
    135         <option value="-8"<?php if($bddp_options['bangla_tz'] == "-8") { echo " selected"; } ?>>GMT -8</option> 
    136         <option value="-7"<?php if($bddp_options['bangla_tz'] == "-7") { echo " selected"; } ?>>GMT -7</option> 
    137         <option value="-6"<?php if($bddp_options['bangla_tz'] == "-6") { echo " selected"; } ?>>GMT -6</option> 
    138         <option value="-5"<?php if($bddp_options['bangla_tz'] == "-5") { echo " selected"; } ?>>GMT -5</option> 
    139         <option value="-4.5"<?php if($bddp_options['bangla_tz'] == "-4.5") { echo " selected"; } ?>>GMT -4:30</option> 
    140         <option value="-4"<?php if($bddp_options['bangla_tz'] == "-4") { echo " selected"; } ?>>GMT -4</option> 
    141         <option value="-3.5"<?php if($bddp_options['bangla_tz'] == "-3.5") { echo " selected"; } ?>>GMT -3:30</option> 
    142         <option value="-3"<?php if($bddp_options['bangla_tz'] == "-3") { echo " selected"; } ?>>GMT -3</option> 
    143         <option value="-2"<?php if($bddp_options['bangla_tz'] == "-2") { echo " selected"; } ?>>GMT -2</option> 
    144         <option value="-1"<?php if($bddp_options['bangla_tz'] == "-1") { echo " selected"; } ?>>GMT -1</option> 
    145         <option value="0"<?php if($bddp_options['bangla_tz'] == "0") { echo " selected"; } ?>>GMT 0</option> 
    146         <option value="1"<?php if($bddp_options['bangla_tz'] == "1") { echo " selected"; } ?>>GMT +1</option> 
    147         <option value="2"<?php if($bddp_options['bangla_tz'] == "2") { echo " selected"; } ?>>GMT +2</option> 
    148         <option value="3"<?php if($bddp_options['bangla_tz'] == "3") { echo " selected"; } ?>>GMT +3</option> 
    149         <option value="3.5"<?php if($bddp_options['bangla_tz'] == "3.5") { echo " selected"; } ?>>GMT +3:30</option> 
    150         <option value="4"<?php if($bddp_options['bangla_tz'] == "4") { echo " selected"; } ?>>GMT +4</option> 
    151         <option value="4.5"<?php if($bddp_options['bangla_tz'] == "4.5") { echo " selected"; } ?>>GMT +4:30</option> 
    152         <option value="5"<?php if($bddp_options['bangla_tz'] == "5") { echo " selected"; } ?>>GMT +5</option> 
    153         <option value="5.5"<?php if($bddp_options['bangla_tz'] == "5.5") { echo " selected"; } ?>>GMT +5:30</option> 
    154         <option value="5.75"<?php if($bddp_options['bangla_tz'] == "5.75") { echo " selected"; } ?>>GMT +5:45</option> 
    155         <option value="6"<?php if($bddp_options['bangla_tz'] == "6") { echo " selected"; } ?>>GMT +6</option> 
    156         <option value="6.5"<?php if($bddp_options['bangla_tz'] == "6.5") { echo " selected"; } ?>>GMT +6:30</option> 
    157         <option value="7"<?php if($bddp_options['bangla_tz'] == "7") { echo " selected"; } ?>>GMT +7</option> 
    158         <option value="8"<?php if($bddp_options['bangla_tz'] == "8") { echo " selected"; } ?>>GMT +8</option> 
    159         <option value="9"<?php if($bddp_options['bangla_tz'] == "9") { echo " selected"; } ?>>GMT +9</option> 
    160         <option value="9.5"<?php if($bddp_options['bangla_tz'] == "9.5") { echo " selected"; } ?>>GMT +9:30</option> 
    161         <option value="10"<?php if($bddp_options['bangla_tz'] == "10") { echo " selected"; } ?>>GMT +10</option> 
    162         <option value="10.5"<?php if($bddp_options['bangla_tz'] == "10.5") { echo " selected"; } ?>>GMT +10:30</option> 
    163         <option value="11"<?php if($bddp_options['bangla_tz'] == "11") { echo " selected"; } ?>>GMT +11</option> 
    164         <option value="12"<?php if($bddp_options['bangla_tz'] == "12") { echo " selected"; } ?>>GMT +12</option> 
    165         <option value="13"<?php if($bddp_options['bangla_tz'] == "13") { echo " selected"; } ?>>GMT +13</option> 
     127        <option value="5.5"<?php if($bddp_options['bangla_tz'] == "5.5") { echo " selected"; } ?>>GMT +5:30 (India)</option> 
     128        <option value="6"<?php if($bddp_options['bangla_tz'] == "6") { echo " selected"; } ?>>GMT +6 (Bangladesh)</option> 
    166129        </select> 
    167130        </td> 
     
    200163    </tr> 
    201164            <tr valign="top"> 
    202         <th scope="row">Show::</th> 
     165        <th scope="row">Show:</th> 
    203166            <td><p><input type="checkbox" id="bddp_options[ord_suffix]" name="bddp_options[ord_suffix]" value="1" <?php if($bddp_options['ord_suffix']==1) echo('checked="checked"'); ?>/><label for="bddp_options[ord_suffix]">Ordinal suffix <span style="color:green;">(Eg. ১লা, ২রা)</span></label></p> 
    204167            <p><input type="checkbox" id="bddp_options[last_word]" name="bddp_options[last_word]" value="1" <?php if($bddp_options['last_word']==1) echo('checked="checked"'); ?>/><label for="bddp_options[last_word]">Last word <span style="color:green;">(Eg. খ্রিস্টাব্দ/বঙ্গাব্দ/হিজরী)</span></label></p></td> 
     
    357320     
    358321    global $bddp_hook; 
    359     $bddp_hook = add_options_page('Bangla Date Display Settings', 'Bangla Date Display', 'edit_pages', 'bangla-date-display', 'bddp_options_page'); 
     322    $bddp_hook = add_options_page('Bangla Date Display Settings', 'Bangla Date Display', 'activate_plugins', 'bangla-date-display', 'bddp_options_page'); 
    360323} 
    361324 
  • bangla-date-display/trunk/readme.txt

    r1565605 r1570280  
    4646 
    4747== Changelog == 
     48 
     49= 8.5.2 = 
     50* Bug fixed. Now [hijri_date] shortcode can be used more than once in a page. 
     51* More simplified settings page. 
     52* Tested compatibility with WP 4.7. 
    4853 
    4954= 8.5.1 = 
  • bangla-date-display/trunk/translator.php

    r1565605 r1570280  
    33    defined( 'ABSPATH' ) or die( 'Stop! You can not do this!' ); 
    44 
    5 if($bddp_options['trans_dt'] == "1") { 
     5if( isset($bddp_options['trans_dt']) == "1") { 
    66    add_filter('date_i18n', 'en_to_bn', 10, 2); 
    7 } 
    8  
    9 if ( $bddp_options['trans_dt'] == "2" ) { 
    10     add_filter('get_the_date', 'en_to_bn'); 
    11     add_filter('get_the_time', 'en_to_bn'); 
    12     add_filter('get_comment_date', 'en_to_bn'); 
    13     add_filter('get_comment_time', 'en_to_bn'); 
    147} 
    158 
Note: See TracChangeset for help on using the changeset viewer.