Skip to content
This repository has been archived by the owner on Sep 9, 2024. It is now read-only.
/ Showplan Public archive

A WordPress plugin for radio scheduling with lots of use cases.

Notifications You must be signed in to change notification settings

InsanityRadio/Showplan

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Showplan 1.0

Showplan is a WordPress plugin for managing your radio station's schedule.

It has been built for Insanity Radio's website, but the code is open source and contributions are welcome. We don't have the opportunity to test every configuration, so use the Issues feature to report bugs.

Installation

Showplan is no longer developed by the Insanity Radio Tech team.

The latest version can be installed by downloading the tarball of the project, and either uploading it to WordPress or extracting it in the plugins directory. It may make more sense to use a release, which can be found on the GitHub page for this project.

Showplan needs to run on PHP 5.6 (might work on 5.5, but untested). Older PHP versions are no longer supported, so it's probably worth updating your web server if you are running anything less.

Once you've activated the plugin, click "Terms" in the Showplan menu, and create a new one. Showplan is designed for stations (like Insanity) who's schedule completely changes every few months. If this is not what you want, enter start and end dates (format YYYY-MM-DD works best) like 1970-01-01 to 2100-01-01.

You can now edit the Schedule Template to set up your regular schedule. You can make weekly changes through Overrides.

Changes to the calendars won't show up on the website until you click Publish - this allows you to stage multiple changes at once without making them public and breaking your live schedule. Changes to show information (titles, descriptions) will update immediately, however.

Add some shortcode to your schedule page. See API below for a full list.

Features

  • Basic scheduling based on calendar "terms"
  • Multiple station support out of the box
  • Automatic sustainer filling
  • API call to get upcoming shows and guide
  • Changing timezone support
  • Schedule widget for website frontend: [showplan-schedule]
  • "On Air" widget (or equiv) for website frontend: [showplan-now-title] etc.

API

Showplan registers API endpoints directly in WordPress, so you can easily access live schedule data programatically without having to access the database.

https://insanityradio.com/wp-json/showplan/<station_id>/get_upcoming/

https://insanityradio.com/wp-json/showplan/<station_id>/get_show/?show_id=1

https://insanityradio.com/wp-json/showplan/<station_id>/get_schedule/?days=4

https://insanityradio.com/wp-json/showplan/<station_id>/get_upcoming/

(note: includes 3 days of previous history, days value inclusive of this - so use 4 + days into future)

Legacy API

This API has been deprecated and is not available in versions of Showplan downloaded from the WordPress Plugin directory.

A few simple API methods are available. We have no issue with these being public, but you may remove the api.php file if you wish to prevent this.

http://localhost/wp-content/plugins/showplan/api.php?method=get_upcoming&station_id=1

http://localhost/wp-content/plugins/showplan/api.php?method=get_show&show_id=1&station_id=1

http://localhost/wp-content/plugins/showplan/api.php?method=get_schedule&station_id=1&days=4

(note: includes 3 days of previous history, days value inclusive of this - so use 4 + days into future)

The database is designed to allow non-complicated reading from anything capable of connecting to a MySQL server. See the $prefix_compiled_times table for more (start_time and end_time are always UTC, start_time_local is based on the WordPress site's timezone)

In WordPress you can access various data using short codes. Your theme needs to support shortcodes in widgets in order to use them in widgets.

[showplan-now-title station=1] Current show title

[showplan-now-image station=1] Current show image (as a HTML image element)

[showplan-now-description station=1] Current show description

[showplan-now-hosts station=1] Current show hosts

[showplan-now-start station=1] Current show start time (HH:II)

[showplan-now-end station=1] Current show end time (HH:II)

[showplan-next-... station=1] Same as above, but for the next show

[showplan-schedule station=1 images=0 sustainer=1 days=7] Render a full calendar widget on the frontend