Plugin Directory

Changeset 222263


Ignore:
Timestamp:
03/28/2010 06:30:18 AM (16 years ago)
Author:
beshkin
Message:

tagging version 0.9

Location:
zmanim-widget
Files:
9 edited
23 copied

Legend:

Unmodified
Added
Removed
  • zmanim-widget/tags/0.9/config.php

    r186558 r222263  
    2727    <p><label>UTC Offset<input name="zmanim_widget_offset" class="zmanim"
    2828type="text" value="<?php echo $data['offset']; ?>" /></label></p>
     29    <p><label>DST<input name="zmanim_widget_dst" class="zmanim"
     30type="checkbox" value="true" <?php if($data['dst']=='true') echo 'checked="checked"'; ?> /></label></p>
    2931    <?php
    3032   foreach ($_POST as $opt=>$val){
    3133    $data[preg_replace('/zmanim_widget_/','',$opt)] = attribute_escape($val);
    3234  }
     35    if ($_POST['zmanim_widget_dst']=='') $data['dst'] = "false";
    3336    update_option('zmanim_widget', $data);
    3437?>
  • zmanim-widget/tags/0.9/functions.php

    r203456 r222263  
    2828        return preg_replace("/[\n\r]/","",$word_trans);
    2929}
     30
     31function dstWindow ($ts)
     32{
     33$in_dst="false";
     34$week_day=date("w",$ts);
     35$sunday_ts=$ts-(60 * 60 * 24*($week_day));
     36$month=date("m",$ts);
     37$sunday_month=date("m",$sunday_ts);
     38$sunday=date("j", $sunday_ts);
     39$hour=date("H",$sunday_ts);
     40$day=date("j",$ts);
     41if( ($sunday_month>=3) && ($sunday_month<=10) ) // IS CURRENT DATE INSIDE OF APRIL->OCT WINDOW?
     42{
     43        $in_dst="true";
     44        if($sunday_month=="4") //IS IT APRIL?
     45        {
     46                if ($sunday<=7) //IS IT THE FIRST SUN OF THE MONTH?
     47                {
     48                        $in_dst="true";
     49                }else{
     50                        $in_dst="false";
     51                }
     52
     53        }
     54    elseif($sunday_month=="3") //IS IT MARCH?
     55    {
     56        if ($sunday>=25 ) //IS IT THE LAST SUN OF THE MONTH?
     57                {
     58                       $in_dst="true";
     59                }else{
     60            $in_dst="false";
     61        }
     62    }
     63        elseif($sunday_month=="10") //IS IT OCT?
     64        {
     65                if ($sunday>=25 ) //IS IT THE LAST SUN OF THE MONTH?
     66                {
     67                       $in_dst="false";
     68                }else{
     69            $in_dst="true";
     70        }
     71        }
     72}
     73return $in_dst;
     74
     75}
    3076?>
  • zmanim-widget/tags/0.9/hdate/hdate.php

    r211459 r222263  
    11<?
    2 $weekday = date("w", $ts);
     2$weekday = 7;//date("N", $ts);
    33$leftshabat = (5 - $weekday);
    44$endshabat = (6 - $weekday);
     5if ($weekday == 7)
     6{
     7    $leftshabat = 5;
     8    $endshabat = 6;
     9}
    510
    611$ts_start = ($ts + (60 * 60 * 24 * $leftshabat)+(60 * 60 *$shoffset));
     
    813
    914$tslocal = date("Z", $ts_start);
    10 /*if ($tslocal == "7200"){
    11     $timediff = "0";
    12 }else{
    13     $timediff = "1";
    14 }*/
     15$timediff_end=0;
     16if (dstWindow($ts)=="true" && $data['dst']=='true'){
     17        $timediff_end++;
     18}
    1519
    1620$resultStr = date_sunset($ts_start, SUNFUNCS_RET_STRING, $shlat, $shlong, 90+50/60, $shoffset);
    1721list($resultHour, $resultMin) = split(':', $resultStr);
    18 //$resultHour += $timediff;
     22$resultHour += $timediff;
    1923$resultMin -= 18;
    2024
     
    2529
    2630$tslocal = date("Z", $ts_end);
    27         $timediff_end = "1";
    28 /*if ($tslocal == "7200"){
    29 }else{
    30         $timediff_end = "2";
    31 }*/
     31$timediff_end=1;
     32if (dstWindow($ts_end)=="true" && $data['dst']=='true'){
     33        $timediff_end++;
     34}
    3235
    3336$resultStr_end = date_sunset($ts_end, SUNFUNCS_RET_STRING, $shlat, $shlong, 90+50/60, $shoffset);
     
    6467if ($weekday == 6 && "$currentHour$currentMin" < "$resultHour_end$resultMin_end") $nday=translate_z('Shabbat',$data['accent']);
    6568elseif ($weekday == 5 && "$currentHour$currentMin" > "$resultHour$resultMin") $nday=translate_z('Shabbat',$data['accent']);
    66 elseif ($weekday >= 6  && $leftHour < 0 ) $nday=__("It remains 6 days","zmanim");
     69if ($weekday > 6 ) $nday=__("It will come in","zmanim").' 6 '.__("days","zmanim");
    6770
    6871print '<ul><li><b>'.translate_z('Shabbat',$data['accent'])."</b></li>";
  • zmanim-widget/tags/0.9/hdate/hol.php

    r211460 r222263  
    44//if ($lang == yd) include("holidays.inc");
    55
    6 $ts = mktime();
    76$isDiaspora = true;
    87$postponeShushanPurimOnSaturday = true;
     
    2423    $lastGDay = cal_days_in_month(CAL_GREGORIAN, $gmonth, $gyear);
    2524    for ($gday; $gday <= $lastGDay; $gday++) {
    26 $jdCurrent = gregoriantojd($gmonth, $gday+1, $gyear);
     25$jdCurrent = gregoriantojd($gmonth, $gday, $gyear);
    2726      $jewishDate = jdtojewish($jdCurrent);
    2827      list($jewishMonth, $jewishDay, $jewishYear) = split('/', $jewishDate);
  • zmanim-widget/tags/0.9/hdate/today.php

    r211459 r222263  
    33
    44//timestamp according to UTC offset
     5if (dstWindow($ts)=="true" ){
     6    if ($data['dst'] == true)
     7    $shoffset++;
     8}
    59$ts_t = ($ts +(60 * 60 *$shoffset));
    610
     
    1014$sunsetStr_t = date_sunset($ts_t, SUNFUNCS_RET_STRING, $shlat, $shlong, 90+50/60, $shoffset);
    1115list($sunsetHour_t, $sunsetMin_t) = split(':', $sunsetStr_t);
    12 
    1316
    1417$time_s = "$sunsetHour_t:$sunsetMin_t";
  • zmanim-widget/tags/0.9/message.php

    r215266 r222263  
    1616        if($data['offset']) $shoffset=$data['offset'];
    1717        else $shoffset=2;
     18    if($data['dst']) $dst=$data['dst'];
     19        else $dst='';
    1820endif;
    1921
  • zmanim-widget/tags/0.9/readme.txt

    r215266 r222263  
    44Requires at least: 2.7
    55Tested up from : 2.9
    6 Stable tag: 0.8.1
     6Stable tag: 0.9
    77
    88Displays Jewish calendar information in a widget.
     
    2424
    2525== Changelog ==
     26= 0.9 =
     27- DayLightSaving setting and functionality is added
     28- freeing from Hametz
    2629= 0.8.1 =
    2730- Added updated file
  • zmanim-widget/tags/0.9/weeklytorah.php

    r215247 r222263  
    1919print "</b></li>";
    2020echo "<li><ul><li>";
    21 print __('Chapter','zmanim').": ".$weekly_portion_name.'</li><li>';
    22 print __('Haftara','zmanim').": ".$weekly_havtara_name;
     21if ($weekly_portion_name != '') {
     22    print __('Chapter','zmanim').": ".$weekly_portion_name.'</li><li>';
     23    print __('Haftara','zmanim').": ".$weekly_havtara_name;
     24}else{
     25    _e('This week there is a differet order of reading Torah','zmanim');
     26}
    2327print "</li></ul></li></ul>";
    2428
  • zmanim-widget/tags/0.9/zmanim-widget.php

    r215266 r222263  
    44 Plugin URI: http://kosherdev.com/category/zmanim-widget/
    55 Description: Allows to turn off the Wordpress site, while Shabat of High Holidays are going on in your area.
    6  Version: 0.8.1
     6 Version: 0.9
    77 Author: Misha Beshkin
    88 Author URI: http://kosherdev.com/
  • zmanim-widget/trunk/config.php

    r186558 r222263  
    2727    <p><label>UTC Offset<input name="zmanim_widget_offset" class="zmanim"
    2828type="text" value="<?php echo $data['offset']; ?>" /></label></p>
     29    <p><label>DST<input name="zmanim_widget_dst" class="zmanim"
     30type="checkbox" value="true" <?php if($data['dst']=='true') echo 'checked="checked"'; ?> /></label></p>
    2931    <?php
    3032   foreach ($_POST as $opt=>$val){
    3133    $data[preg_replace('/zmanim_widget_/','',$opt)] = attribute_escape($val);
    3234  }
     35    if ($_POST['zmanim_widget_dst']=='') $data['dst'] = "false";
    3336    update_option('zmanim_widget', $data);
    3437?>
  • zmanim-widget/trunk/functions.php

    r203456 r222263  
    2828        return preg_replace("/[\n\r]/","",$word_trans);
    2929}
     30
     31function dstWindow ($ts)
     32{
     33$in_dst="false";
     34$week_day=date("w",$ts);
     35$sunday_ts=$ts-(60 * 60 * 24*($week_day));
     36$month=date("m",$ts);
     37$sunday_month=date("m",$sunday_ts);
     38$sunday=date("j", $sunday_ts);
     39$hour=date("H",$sunday_ts);
     40$day=date("j",$ts);
     41if( ($sunday_month>=3) && ($sunday_month<=10) ) // IS CURRENT DATE INSIDE OF APRIL->OCT WINDOW?
     42{
     43        $in_dst="true";
     44        if($sunday_month=="4") //IS IT APRIL?
     45        {
     46                if ($sunday<=7) //IS IT THE FIRST SUN OF THE MONTH?
     47                {
     48                        $in_dst="true";
     49                }else{
     50                        $in_dst="false";
     51                }
     52
     53        }
     54    elseif($sunday_month=="3") //IS IT MARCH?
     55    {
     56        if ($sunday>=25 ) //IS IT THE LAST SUN OF THE MONTH?
     57                {
     58                       $in_dst="true";
     59                }else{
     60            $in_dst="false";
     61        }
     62    }
     63        elseif($sunday_month=="10") //IS IT OCT?
     64        {
     65                if ($sunday>=25 ) //IS IT THE LAST SUN OF THE MONTH?
     66                {
     67                       $in_dst="false";
     68                }else{
     69            $in_dst="true";
     70        }
     71        }
     72}
     73return $in_dst;
     74
     75}
    3076?>
  • zmanim-widget/trunk/hdate/hdate.php

    r211459 r222263  
    11<?
    2 $weekday = date("w", $ts);
     2$weekday = 7;//date("N", $ts);
    33$leftshabat = (5 - $weekday);
    44$endshabat = (6 - $weekday);
     5if ($weekday == 7)
     6{
     7    $leftshabat = 5;
     8    $endshabat = 6;
     9}
    510
    611$ts_start = ($ts + (60 * 60 * 24 * $leftshabat)+(60 * 60 *$shoffset));
     
    813
    914$tslocal = date("Z", $ts_start);
    10 /*if ($tslocal == "7200"){
    11     $timediff = "0";
    12 }else{
    13     $timediff = "1";
    14 }*/
     15$timediff_end=0;
     16if (dstWindow($ts)=="true" && $data['dst']=='true'){
     17        $timediff_end++;
     18}
    1519
    1620$resultStr = date_sunset($ts_start, SUNFUNCS_RET_STRING, $shlat, $shlong, 90+50/60, $shoffset);
    1721list($resultHour, $resultMin) = split(':', $resultStr);
    18 //$resultHour += $timediff;
     22$resultHour += $timediff;
    1923$resultMin -= 18;
    2024
     
    2529
    2630$tslocal = date("Z", $ts_end);
    27         $timediff_end = "1";
    28 /*if ($tslocal == "7200"){
    29 }else{
    30         $timediff_end = "2";
    31 }*/
     31$timediff_end=1;
     32if (dstWindow($ts_end)=="true" && $data['dst']=='true'){
     33        $timediff_end++;
     34}
    3235
    3336$resultStr_end = date_sunset($ts_end, SUNFUNCS_RET_STRING, $shlat, $shlong, 90+50/60, $shoffset);
     
    6467if ($weekday == 6 && "$currentHour$currentMin" < "$resultHour_end$resultMin_end") $nday=translate_z('Shabbat',$data['accent']);
    6568elseif ($weekday == 5 && "$currentHour$currentMin" > "$resultHour$resultMin") $nday=translate_z('Shabbat',$data['accent']);
    66 elseif ($weekday >= 6  && $leftHour < 0 ) $nday=__("It remains 6 days","zmanim");
     69if ($weekday > 6 ) $nday=__("It will come in","zmanim").' 6 '.__("days","zmanim");
    6770
    6871print '<ul><li><b>'.translate_z('Shabbat',$data['accent'])."</b></li>";
  • zmanim-widget/trunk/hdate/hol.php

    r211460 r222263  
    44//if ($lang == yd) include("holidays.inc");
    55
    6 $ts = mktime();
    76$isDiaspora = true;
    87$postponeShushanPurimOnSaturday = true;
     
    2423    $lastGDay = cal_days_in_month(CAL_GREGORIAN, $gmonth, $gyear);
    2524    for ($gday; $gday <= $lastGDay; $gday++) {
    26 $jdCurrent = gregoriantojd($gmonth, $gday+1, $gyear);
     25$jdCurrent = gregoriantojd($gmonth, $gday, $gyear);
    2726      $jewishDate = jdtojewish($jdCurrent);
    2827      list($jewishMonth, $jewishDay, $jewishYear) = split('/', $jewishDate);
  • zmanim-widget/trunk/hdate/today.php

    r211459 r222263  
    33
    44//timestamp according to UTC offset
     5if (dstWindow($ts)=="true" ){
     6    if ($data['dst'] == true)
     7    $shoffset++;
     8}
    59$ts_t = ($ts +(60 * 60 *$shoffset));
    610
     
    1014$sunsetStr_t = date_sunset($ts_t, SUNFUNCS_RET_STRING, $shlat, $shlong, 90+50/60, $shoffset);
    1115list($sunsetHour_t, $sunsetMin_t) = split(':', $sunsetStr_t);
    12 
    1316
    1417$time_s = "$sunsetHour_t:$sunsetMin_t";
  • zmanim-widget/trunk/message.php

    r215266 r222263  
    1616        if($data['offset']) $shoffset=$data['offset'];
    1717        else $shoffset=2;
     18    if($data['dst']) $dst=$data['dst'];
     19        else $dst='';
    1820endif;
    1921
  • zmanim-widget/trunk/readme.txt

    r215266 r222263  
    44Requires at least: 2.7
    55Tested up from : 2.9
    6 Stable tag: 0.8.1
     6Stable tag: 0.9
    77
    88Displays Jewish calendar information in a widget.
     
    2424
    2525== Changelog ==
     26= 0.9 =
     27- DayLightSaving setting and functionality is added
     28- freeing from Hametz
    2629= 0.8.1 =
    2730- Added updated file
  • zmanim-widget/trunk/weeklytorah.php

    r215247 r222263  
    1919print "</b></li>";
    2020echo "<li><ul><li>";
    21 print __('Chapter','zmanim').": ".$weekly_portion_name.'</li><li>';
    22 print __('Haftara','zmanim').": ".$weekly_havtara_name;
     21if ($weekly_portion_name != '') {
     22    print __('Chapter','zmanim').": ".$weekly_portion_name.'</li><li>';
     23    print __('Haftara','zmanim').": ".$weekly_havtara_name;
     24}else{
     25    _e('This week there is a differet order of reading Torah','zmanim');
     26}
    2327print "</li></ul></li></ul>";
    2428
  • zmanim-widget/trunk/zmanim-widget.php

    r215266 r222263  
    44 Plugin URI: http://kosherdev.com/category/zmanim-widget/
    55 Description: Allows to turn off the Wordpress site, while Shabat of High Holidays are going on in your area.
    6  Version: 0.8.1
     6 Version: 0.9
    77 Author: Misha Beshkin
    88 Author URI: http://kosherdev.com/
Note: See TracChangeset for help on using the changeset viewer.