In Memoriam: Tai'lahr

OpenUru.org, along with the rest of the Mystonline community, is mourning the loss of Tai'lahr on October 16th, 2019.

Rest in Peace, friend.

Difference between revisions of "Cavern Status Widget"

From OpenUru
Jump to navigation Jump to search
Line 7: Line 7:
 
==Usage==
 
==Usage==
 
The simplest way to use the Cavern Status Widget is by inserting an iframe in your webpage at the point you'd like the widget to appear:
 
The simplest way to use the Cavern Status Widget is by inserting an iframe in your webpage at the point you'd like the widget to appear:
 +
 +
<tt>
 
:<iframe src=http://www.openuru.org/tools/cavstat.php width="550px" height="120px" frameborder="0">
 
:<iframe src=http://www.openuru.org/tools/cavstat.php width="550px" height="120px" frameborder="0">
 
: <p>Your browser does not support iframes.</p>
 
: <p>Your browser does not support iframes.</p>
 
:</iframe>
 
:</iframe>
 +
</tt>
 +
 +
The width and height settings in the iframe determine the size of the space allowed in your page for the status message. If the message box can't be fitted inside that space, then scroll bars may appear. Setting <nowiki>frameborder = "0"</nowiki> hides the rather ugly boundary that would otherwise be shown.
  
The width and height settings in the iframe determine the size of the space allowed in your page for the status message. If the message box can't be fitted inside that space, then scroll bars may appear. Setting <nowiki>frameborder = "0"</nowiki> hides the rather ugly boundary that would otherwise be shown.
 
 
 
==Controlling the appearance==
 
==Controlling the appearance==
 
You can control the appearance of the status message so that it blends better with your webpage: Add a '?' after the call to cavstat.php then list the parameter=value pairs, separating each with '&' and making sure to avoid leaving any spaces. The possible parameters are:
 
You can control the appearance of the status message so that it blends better with your webpage: Add a '?' after the call to cavstat.php then list the parameter=value pairs, separating each with '&' and making sure to avoid leaving any spaces. The possible parameters are:

Revision as of 05:47, 15 February 2011

This is a simple widget that you can use in webpages to display the current status of the MOULagain servers.


This page contains draft content
The content of this page is a "work-in-progress" and is subject to change. Do not place undue reliance on the completeness or accuracy of the material presented here!


General

Usage

The simplest way to use the Cavern Status Widget is by inserting an iframe in your webpage at the point you'd like the widget to appear:

<iframe src=http://www.openuru.org/tools/cavstat.php width="550px" height="120px" frameborder="0">

Your browser does not support iframes.

</iframe>

The width and height settings in the iframe determine the size of the space allowed in your page for the status message. If the message box can't be fitted inside that space, then scroll bars may appear. Setting frameborder = "0" hides the rather ugly boundary that would otherwise be shown.

Controlling the appearance

You can control the appearance of the status message so that it blends better with your webpage: Add a '?' after the call to cavstat.php then list the parameter=value pairs, separating each with '&' and making sure to avoid leaving any spaces. The possible parameters are:

  • color= The color of the text, either a hex value or a standard color name. If using a hex value, omit the usual leading '#' symbol. Defaults to black if parameter omitted.
  • bgcolor= The background color of the box containing the status message, either a hex value or a standard color name. If using a hex value, omit the usual leading '#' symbol. Defaults to grey (DDDDDD) if parameter omitted.
  • txtsize= The size of the body text of the message, e.g. 12pt, 14px, 1.1em. Defaults to 1.0em if parameter is omitted.
  • hdsize= The size of the heading text of the message, e.g. 12pt, 14px, 1.1em. The headings are bold, so you may want to reduce the size compared to the main text to restore some "balance". Defaults to 0.8em if parameter is omitted.
  • width= The width of the box containing the status message, in px or %. Note that the iframe may also have a width specified and you may need to adjust both get a satisfactory result. Defaults to 400px if parameter is omitted.
  • height= The height of the box containing the status message, in px or %. Note that the iframe may also have a height specified and you may need to adjust both get a satisfactory result. Defaults to 120px if parameter is omitted.
  • border= The color of the border around the box containing the status message, either a hex value or a standard color name. If using a hex value, omit the usual leading '#' symbol. The border is a 1px solid line and is only displayed if a value is specified, otherwise the box will be borderless (default).
  • type= Controls the display and styling type:
    • maxi : The default display - shows the cavern status indication and a link to Cyan's "Play" page on the first line, and the Cyan "Developer's message" on the second line.
    • midi : Single line display, with only the cavern status and the "Play" link.
    • mini : Single line display, with only the cavern status included.
    • raw : Most inline styling is removed and all other parameters are ignored. Used when applying local styling in more advanced uses (see below).

Example:

<iframe src="http://www.openuru.org/tools/cavstat.php?bgcolor=ffdddd&hdsize=0.9em&border=blue" width="550px" height="120px" frameborder="0">

Your browser does not support iframes.

</iframe>

Advanced topics

PHP

If your page is written in PHP, you could use the cURL library to fetch the widget output and build it into your page. This would allow you to use the IDs and classes along with your own page CSS to apply styling. For this, you need to ensure that all unwanted inline styling is removed from the widget by using the ?type=raw control.