WordPress.org

Plugin Directory

Changeset 1634290


Ignore:
Timestamp:
04/10/17 12:14:17 (3 months ago)
Author:
bobbingwide
Message:

v1.6.4 contains a minor improvement to help with CSS styling of the output. Tested with WordPres 4.7.3. Tested with PHP 7.1. Now depends on oik v3.1 or higher.

Location:
uk-tides/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • uk-tides/trunk/admin/oik-activation.php

    r1503990 r1634290  
    11<?php // (C) Copyright Bobbing Wide 2012-2016 
     2if ( !defined( "OIK_ACTIVATION_INCLUDED" ) ) { 
     3define( "OIK_ACTIVATION_INCLUDED", "3.1.0" ); 
     4 
    25 
    36if ( function_exists( "oik_plugin_lazy_activation" ) ) { 
     
    260263 
    261264} // end else  
     265 
     266} // end if !defined()  
  • uk-tides/trunk/readme.txt

    r1503990 r1634290  
    11=== uk-tides === 
    22Contributors: bobbingwide, vsgloik 
    3 Donate link: http://www.oik-plugins.com/oik/oik-donate/ 
    4 Tags: shortcode, tides, UK, heights and times, [bw_tides], saltwater 
     3Donate link: https://www.oik-plugins.com/oik/oik-donate/ 
     4Tags: shortcode, tides, UK, heights, times 
    55Requires at least: 3.9 
    6 Tested up to: 4.6.1 
    7 Stable tag: 1.6.3 
     6Tested up to: 4.7.3 
     7Stable tag: 1.6.4 
    88License: GPLv2 or later 
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html 
     
    1313== Description == 
    1414uk-tides displays tide times and heights for a particular location in the UK.  
    15 The information that is displayed is obtained from the RSS feed for tidetimes.org.uk (e.g. http://www.tidetimes.org.uk/chichester-harbour-entrance-tide-times.rss ) 
    16 or tidetimes.co.uk ( e.g http://www.tidetimes.co.uk/rss/chichester-harbour-entrance-tide-times ).  
     15The information that is displayed is obtained from the RSS feed for tidetimes.org.uk (e.g. https://www.tidetimes.org.uk/chichester-harbour-entrance-tide-times.rss ) 
     16or tidetimes.co.uk ( e.g https://www.tidetimes.co.uk/rss/chichester-harbour-entrance-tide-times ).  
    1717The data is cached until midnight. This plugin implements a lazy smart shortcode using the API provided by the oik plugin.  
    1818 
     
    2222   
    2323[bw_tides 
    24 tideurl="http://www.tidetimes.org.uk/chichester-harbour-entrance-tide-times.rss|other - RSS feed URL for location" 
     24tideurl="https://www.tidetimes.org.uk/chichester-harbour-entrance-tide-times.rss|other - RSS feed URL for location" 
    2525store="1|store key - unique key for caching result"] 
    2626 
     
    2929 [bw_tides] with no parameters will display the tide times and heights for Chichester Harbour Entrance. The information will be cached in store=1 until midnight. 
    3030  
    31  [bw_tides store=bw_tides_pompey tideurl="http://www.tidetimes.org.uk/portsmouth"] will display the tide times and heights obtained from 
    32  http://www.tidetimes.org.uk/portsmouth-tide-times.rss and cache the result in a store named 'bw_tides_pompey' 
     31 [bw_tides store=bw_tides_pompey tideurl="https://www.tidetimes.org.uk/portsmouth"] will display the tide times and heights obtained from 
     32 https://www.tidetimes.org.uk/portsmouth-tide-times.rss and cache the result in a store named 'bw_tides_pompey' 
    3333  
    3434 Note: Using the store parameter allows you to display tide time and height information for more than one location. 
     
    3737 If you prefer you can use tidetimes.co.uk as the source for tidal information. 
    3838  
    39  [bw_tides tideurl="http://www.tidetimes.co.uk/rss/chichester-harbour-entrance-tide-times"] 
     39 [bw_tides tideurl="https://www.tidetimes.co.uk/rss/chichester-harbour-entrance-tide-times"] 
    4040  
    4141 
    42 == Installation == 
     42== Frequently Asked Questions == 
     43 
     44= Installation = 
    43451. Upload the contents of the uk-tides plugin to the `/wp-content/plugins/uk-tides' directory 
    44461. Activate the uk-tides plugin through the 'Plugins' menu in WordPress 
    45 1. Whenever you want to produce some 'uk-tides'ed text use the [uk-tides] shortcode. 
     471. Whenever you want to produce UK Tide times and heights for the current date use the [bw_tides] shortcode. 
    4648 
    4749Note: uk-tides is dependent upon the oik plugin. You can activate it but it will not work unless oik is also activated. 
    48 Download oik from  
    49 [oik download](http://wordpress.org/extend/plugins/oik/) 
     50Download oik from [oik download](https://wordpress.org/plugins/oik/) 
    5051 
    51 == Frequently Asked Questions == 
    5252= How do I find the value for tideurl? = 
    5353 
     
    5757* copy the URL from the feed 
    5858 
    59 e.g. for Brighton Marina the value for tideurl is http://www.tidetimes.org.uk/brighton-marina-tide-times.rss 
     59e.g. for Brighton Marina the value for tideurl is https://www.tidetimes.org.uk/brighton-marina-tide-times.rss 
    6060 
    6161OR 
     
    6565* click on the RSS feed icon,  
    6666* copy the URL from the feed 
     67e.g. for Brighton Marina the balue for tideurl is https://www.tidetimes.co.uk/rss/brighton-marina-tide-times 
    6768 
    6869 
     
    7172 
    7273= What if I don't live in the UK? = 
    73 uk-tides currently only works for the UK and Ireland since the information is obtained from http://www.tidetimes.org.uk 
     74 
     75uk-tides currently only works for the UK and Ireland since the information is obtained from https://www.tidetimes.org.uk or https://www.tidetimes.co.uk 
    7476If you can point us to a resource for other locations then it should be possible to develop a very similar solution. 
    7577 
    76 For saltwater tide times and heights for the US see [US-tides WordPress plugin](http://www.oik-plugins.com/oik-plugins/us-tides) 
     78For saltwater tide times and heights for the US see [US-tides WordPress plugin](https://www.oik-plugins.com/oik-plugins/us-tides) 
    7779 
    7880= Isn't there some JavaScript that does something similar? = 
    79 YES. See http://www.tidetimes.org.uk/widgets 
    80 But you may find the output harder to (re)style. 
     81Yes. See https://www.tidetimes.org.uk/widgets or https://www.tidetimes.co.uk/widgets 
     82 
     83You may find the output harder to (re)style. 
     84 
     85= Further reading = 
     86If you want to read more about the oik plugins then please visit the 
     87[oik plugin](https://www.oik-plugins.com/oik) **"OIK - OIK Information Kit"** 
    8188 
    8289 
    8390== Screenshots == 
    84 1. sample output for Portsmouth, Hants - from tidetimes.org.uk 
    85 2. sample output for Portsmouth, Hants - from tidetimes.co.uk 
     911. Sample output for Portsmouth, Hants - from tidetimes.org.uk 
     922. Sample output for Portsmouth, Hants - from tidetimes.co.uk 
    8693 
    8794== Upgrade Notice == 
     95= 1.6.4 =  
     96Tested with WordPress 4.7.3. Tested with PHP 7.1 
     97 
    8898= 1.6.3 = 
    8999Tested with WordPress 4.6.1. Should not crash if oik is not active processing 'oik_add_shortcodes' 
     
    114124 
    115125== Changelog == 
     126= 1.6.4 =  
     127* Changed: Further improve ability to style the output of the bw_tides shortcode,[github bobbingwide uk-tides issue 5] 
     128* Changed: Now depends on oik v3.1 or higher 
     129* Tested: With WordPress 4.7.3 and WordPress Multisite 
     130* Tested: With PHP 7.1 
     131 
    116132= 1.6.3 =  
    117133* Fixed: Avoid Fatal errors when oik not activated processing 'oik_add_shortcodes' action [github bobbingwide uk-tides issue 2] 
     
    157173 
    158174 
    159 == Further reading == 
    160 If you want to read more about the oik plugins then please visit the 
    161 [oik plugin](http://www.oik-plugins.com/oik)  
    162 **"OIK - OIK Information Kit"** 
    163175 
    164176 
     
    166178 
    167179 
    168  
  • uk-tides/trunk/shortcodes/uk-tides.php

    r1349803 r1634290  
    22/* 
    33 
    4     Copyright 2011 - 2016 Bobbing Wide (email : herb@bobbingwide.com ) 
     4    Copyright 2011 - 2017 Bobbing Wide (email : herb@bobbingwide.com ) 
    55 
    66    This program is free software; you can redistribute it and/or modify 
     
    2222 
    2323/**  
    24  * Get tide information from the $tide_url  
    25  *  
    26  * Code copied and cobbled from http://snippet.me/wordpress/wordpress-plugin-info-api/ 
    27  * having referred to http://ckon.wordpress.com/2010/07/20/undocumented-wordpress-org-plugin-api/ 
    28  * get XML information using simple xml load file 
     24 * Gets tide information from the $tide_url  
     25 *  
    2926 * 
    3027 * Note There is no error checking here. It can fail for many reasons but it will produce messages when it happens.  
     
    262259 * `                 
    263260   <a href="http://www.tidetimes.org.uk" title="Tide Times">Tide Times</a>& Heights for 
    264    <br/> 
    265261   <a href="http://www.tidetimes.org.uk/chichester-harbour-entrance-tide-times" title="Chichester Harbour (Entrance) tide times">Chichester Harbour (Entrance)</a> on 29th October 2011 
    266262   <br/> 
     
    270266   <br/>19:03 - Low Tide (0.70m) 
    271267   <br/> 
     268      
     269     ` 
     270      
     271      
     272     ` 
     273     <a href="http://www.tidetimes.co.uk" title="Tide Times">Tide Times</a> &amp; Heights for  
     274     <a href="http://www.tidetimes.co.uk/portsmouth-tide-times" title="Portsmouth tide times">Portsmouth</a> on Thursday, 06 April 2017 
     275     <br/>Low Tide: 01:32 (1.80m) 
     276     <br/>High Tide: 08:29 (4.00m) 
     277     <br/>Low Tide: 14:03 (1.50m) 
     278     <br/>High Tide: 21:13 (4.10m) 
     279     <br/> 
    272280     ` 
    273281 * 
     
    287295 * Reformat the content into a series of spans 
    288296 *  
    289  * Processing depends on the source ( tidetimes.org.uk or tidetimes.co.uk ) 
    290  * We check the first character 
     297 * - Processing depends on the source ( tidetimes.org.uk or tidetimes.co.uk ) 
     298 * - We check the first character. 
    291299 * 
    292300 * first char | Example                  | Means 
    293  * ---------- | ------------------------ | ------ 
     301 * ---------- | ------------------------ | ------------------------------- 
    294302 * numeric    | 01:06 - Low Tide (1.80m) | time and height data from .org.uk  
    295303 * L          | Low Tide: 01:06 (1.80m)  | Low tide from .co.uk 
    296304 * H          | High Tide: 08:25 (4.20m) | High tide from .co.uk 
     305 * <          | <a ...>lt1</a> plt1      | See bw_tides_format_links() 
    297306 * other      |                          | Anything else we don't split  
    298307 *  
     
    310319      e( " " ); 
    311320    } 
    312   } else { 
     321    } elseif ( $ch == "<" ) { 
     322        bw_tides_format_links( $stuff ); 
     323    } else { 
    313324    e( $stuff );  
    314325  } 
    315  
     326} 
     327   
     328/** 
     329 * Reformats the links line 
     330 * 
     331 * Puts some spans in the parts of the text which aren't inside anchor tags. 
     332 * e.g. 
     333 * `  
     334 * <a ...>lt1</a> plt1 <a ...>lt2</a> plt2 
     335 * ` 
     336 * becomes 
     337 * `  
     338 * <a ...>lt1</a><span> plt1 </span><a ...>lt2</a><span> plt2</span> 
     339 * ` 
     340 *  
     341 * This allows each span to be styled. 
     342 *  
     343 * @param string $stuff 
     344 */ 
     345function bw_tides_format_links( $stuff ) { 
     346    $stuff = str_replace( "> ", "><span> ", $stuff ); 
     347    $stuff = str_replace( " <", " </span><", $stuff ); 
     348    $stuff .= "</span>"; 
     349    e( $stuff ); 
     350} 
    316351 
    317352/** 
  • uk-tides/trunk/uk-tides.php

    r1503990 r1634290  
    22/* 
    33Plugin Name: UK tides - heights and times 
    4 Plugin URI: http://www.oik-plugins.com/oik-plugins/uk-tides-times-and-heights/ 
     4Plugin URI: https://www.oik-plugins.com/oik-plugins/uk-tides-times-and-heights/ 
    55Description: shortcode for UK tide times and heights [bw_tides] 
    6 Version: 1.6.3 
     6Version: 1.6.4 
    77Author: bobbingwide 
    8 Author URI: http://www.oik-plugins.com/author/bobbingwide 
     8Author URI: https://www.oik-plugins.com/author/bobbingwide 
    99License: GPL2 
    1010 
    11     Copyright 2011-2016 Bobbing Wide (email : herb@bobbingwide.com ) 
     11    Copyright 2011-2017 Bobbing Wide (email : herb@bobbingwide.com ) 
    1212 
    1313    This program is free software; you can redistribute it and/or modify 
     
    4646 * 2014/11/25 - Now dependent upon oik v2.3 
    4747 * 2015/12/15 - Now dependent upon oik v2.5 
     48 * 2017/04/10 - Now dependent upon oik v3.1 
    4849 */  
    4950function uk_tides_activation() { 
     
    5657    } 
    5758  }   
    58   $depends = "oik:2.5"; 
     59  $depends = "oik:3.1"; 
    5960  oik_plugin_lazy_activation( __FILE__, $depends, "oik_plugin_plugin_inactive" ); 
    6061} 
Note: See TracChangeset for help on using the changeset viewer.