Using Short Code
The shortcode ‘ndic_tides_shortcode’ can accept 6 attributes, but only 1 is required:
- name (required): The name of the database table column
- haleiwa
- kona
- lahaini
- nawiliwili
- island : The label shown in the chart. Default: ‘name’ attribute
- show_input: Determines if the date input will be visible. Default: 1
- 1
- 0
- show_icon: (daily only) Determines if the tide icon graphic will be visible. Default: 0
- 1
- 0
- highlight: (daily only) Will highlight the current tide. Default: 0
- 1
- 0
- date: The date you want the chart to start (formatted as 2023-03-30). Default: Today’s date
- interval: Indicates if the tide selection is by day or month. Default: ‘daily’
- daily
- while highlight current tide by Hawaiian Time (America/Adak)
- monthly
- daily
- chart: (monthly only) displays a togglable chart of the selected months tides
Note: there was an ‘event’ attribute but it turns out that is redundant. There is only one event (tide). All the other events (sunrise, moonrise, etc) are displayed with it for that date.
The database is structured as such:
- island (name of the island ) – The following query will show you all data involving ‘haleiwa’
SELECT * FROM `tides` WHERE island = 'haleiwa'
- date (date of event) – The following query will list all data involving ‘haleiwa’ for October 1, 2022
SELECT * FROM `tides` WHERE island = 'haleiwa' AND date = '2022-10-01'
- day (simply the day of the date)
- time (the time listed with the event)
- timezone (pretty much unnecessary)
- event (Sunrise, Low Tide, Moonset, etc) – The following query will list the ‘Sunrise’ data involving ‘haleiwa’ for October 1, 2022
SELECT * FROM `tides` WHERE island = 'haleiwa' AND date = '2022-10-01' AND event = 'Sunrise'
- height (if the event is a tide, the height of the tide)
Importing
Note: Upon activation of the plugin, the ‘tides’ table will be created.
Merge all spreadsheets by creating a new spreadsheet and pasting the ‘Master’ sheet after adding a column at the beginning identifying the island name to be used in the shortcode as such (see image):
haleiwa |
kona |
lahaina |
nawiliwili |
When the merging is complete, export and save the file as ‘import-tides.csv’
This naming is important as it will be the name that is looked for when you upload the file. When uploaded view ‘Media’ the tide depth and tide events (High/Low) will be swapped so that the file can properly be imported.
Once import-tides.csv is finished uploading, the tides.csv will contain the re-formatted file and will automatically be imported into the tide table. During the process, the upload of the import-tides.csv might appear to take longer than usual. This is because the upload time is extended by importing all of the rows and is affected by how many records are in the CSV.
Once done, the tides.csv will appear in media. It’s possible that if you previously had a tides.csv in media, that it will appear as if two exist now. Do not worry. The older one will disappear on refresh.