Skip to content

Latest commit

 

History

History
175 lines (113 loc) · 5.72 KB

thewidgets.rst

File metadata and controls

175 lines (113 loc) · 5.72 KB

Widgets

In wordpress so called widgets are small applications which come along with the plugin and can be placed/configured via the wordpress admin interface via "Design > Widgets". We've added several to provide the latest or most important information on the website.

Webcam Widget

webcams.php extens the wordpress WP_Widget class. The widget is loading the webcams from the *wetterturnier_webcams <mysql-table-webcams> database table if there are any for the current cityObject <api-cityObject> using the corresponding webcamObject <api-webcamObject> objects.

Each webcam is attached to one specific city via it's cityID and is defined via three attributes: url to the webcam image (has to be a static url), a source url, and a short description. The latter two will be used to set the source link below the live image.

Uses:

  • wetterturnier_cityObject <api-cityObject>: current city.
  • wetterturnier_webcamObject <api-webcamObject>: defined webcams if there are any.

WP_wetterturnier_widget_webcams

Leaderboard Widget

leading.php extens the wordpress WP_Widget class. The widget is loading the players with the highest points given a certain time and active city. Uses the data from the *wetterturnier_betstat <mysql-table-betstat> database table.

Currently uses the method :phpuserclass::show_leading. Should be decoupled and rather use the new (not yet scripted) rankingclass and procude the output directly within :phpWP_wetterturnier_widget_leading::show_leading.

Makes use of the avatar image and bbpress profile link when displaying the data.

Uses:

  • wetterturnier_cityObject <api-cityObject>: current city.

WP_wetterturnier_widget_leading

Lightning Activity

blitzortung.php also extends the wordpress WP_Widget class. The widget does two things: see if new data are available (data-stream not dead) and if data are available check wether there was is lightning activity in the surrounding of the city. If so, a small image will be displayed.

Provide some brief information about the data set and where these routines are running and/or can be found on the wetterturnier server (cross-ref style).

Uses:

  • wetterturnier_cityObject <api-cityObject>: current city.

WP_wetterturnier_widget_blitzortung

Latest Observations

latestobs.php also extends the wordpress WP_Widget class. The widget does two things: see if new data are available (data-stream not dead) and if data are available check wether there was is lightning activity in the surrounding of the city. If so, a small image will be displayed.

Provide some brief information about the data set and where these routines are running and/or can be found on the wetterturnier server (cross-ref style).

Uses:

  • wetterturnier_cityObject <api-cityObject>: current city.
  • wetterturnier_stationObject <api-stationObject>: stations for city.
  • wetterturnier_latestobsObject <api-latestobsObject>: fetching latest observations from obs database <mysql-database-obs>.

WP_wetterturnier_widget_latestobs

Tournament Calendar

tournaments.php also extends the wordpress WP_Widget class. Displays the tournament calendar with the upcoming tourmanet dates. In addition, the bet-counts (submitted partial/full forecasts for the upcoming tournament) are shown.

Check whether it would make sense to move the data request into the new and not yet coded rankingclass.

WP_wetterturnier_widget_tournaments

Private Messages

bbpmessages.php also extends the wordpress WP_Widget class. Requires an active installation of the bbpmessages plugin. If the plugin is not installed or at least ont active this widget will print out a message telling you that you might not have installed the dpeendency. Else the plugin is checking if there are new unread privat messages in the in-box and displays either a number or a message that there are no new messages.

Note the widget is only visible when the user is logged in (as only logged in users are able to retrieve and/or send messages).

Check whether it would make sense to move the data request into the new and not yet coded rankingclass.

WP_wetterturnier_widget_bbpmessages