Plugin Directory

Changeset 2131936


Ignore:
Timestamp:
08/01/2019 07:40:45 AM (7 years ago)
Author:
calj
Message:

Multiple-City

Location:
calj/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • calj/trunk/CalJPlugin.php

    r2130839 r2131936  
    7676            $city = $decodedAttr['city'];
    7777            $lang = $decodedAttr['lang'];
     78
     79            // If we're demanding city-related data,
     80            // use the corresponding sub-part of the dictionary
     81            if ($city) {
     82                if (array_key_exists('cities', $json) &&
     83                    array_key_exists($city, $json['cities'])) {
     84                    $json = $json['cities'][$city];
     85                } else {
     86                    // Better explicitly indicate that no data was found,
     87                    // rather than silently give wrong zmanim.
     88                    return '-';
     89                }
     90            }
    7891
    7992            // dot notation to access the json properties
  • calj/trunk/calj.php

    r2131491 r2131936  
    66 * Plugin URI: https://calj.net
    77 * Description: Add the Shabbat times on your site.
    8  * Version: 1.2.1
     8 * Version: 1.3
    99 * Author: Gabriel Zerbib <gabriel@calj.net>
    1010 * Author URI: https://calj.net
  • calj/trunk/readme.txt

    r2131491 r2131936  
    9999  Prints the Daf Yomi of the current day.
    100100
     101= With multiple cities =
     102
     103If you purchased a multiple-city package, you may use the following syntax to
     104display the times for a selected city by its code:
     105
     106`[caljshabbat city="Montreal" val="shabbat.begins"]`
     107
    101108
    102109= How are the times calculated =
     
    106113
    107114== Changelog ==
     115
     116= 1.3 =
     117Support for multiple cities.
    108118
    109119= 1.2.1 =
Note: See TracChangeset for help on using the changeset viewer.