Widgets powered by WebCrossing (Sony/BMG's standard 3rd-party message board solution) are generated via a Javascript-based XML-RPC solution that pulls content from WebCrossing's XML feeds via a Proxy.
Dependencies
The following files are required on the client-side in order for the widgets to work:
- prototype.js — This is a freely available JavaScript Framework Library
- xmlrpc.js — An XML-RPC parser and generator
- widgets.js — Defines all available widgets
- widgets.xml — Defines all instances and configuration of available widgets
To add these to an existing page, the following must be added to the
element:<link type="text/xml" class="AjaxWidgets" href="xml/widgets.xml" />
<script type="text/javascript" src="javascript/prototype.js"></script>
<script type="text/javascript" src="javascript/xmlrpc.js">></script>
<script type="text/javascript" src="javascript/widgets.js">></script>
Adding Widgets to a Page
First, add an empty container to the page with a unique ID. For example:
<div id="widget-boardposts"></div>
The next step is to inject a widget into this container. Using the widgets.xml file, a
- Recent Board Posts: BoardPosts
- Recent Blog Posts: BlogPosts
- Links: Links
- Members Online: MembersOnline
- Poll Results: PollResults
Parameters may be added with the <param> tag and associated attributes. Detailed information on available parameters for each widget and what they do is defined below.
Path Names
All widgets require a path name to be specified, with the exception of the Members Online widget. The path defines the source of content within WebCrossing's folder structure that is to be used. This is easily obtained by navigating to the relevant place you'd like to use (i.e. a folder of messages, a blog, etc.) and look at the URL. For example, a URL to a folder called 'Forums' might look like:
http://forums2.epicrecords.com/Forums/?14@223.higdatzQa8Q.0@
The URL for another folder within 'Forums' might look like:
http://forums2.epicrecords.com/Forums/Quietdrive%20Tour%202006/?14@223.higdatzQa8Q.2@
The relevant part of these URLs starts from the point after the domain (including the forward slash) up until the query string (the part beginning with a question mark that looks like gibberish, as well as the forward slash that precedes the question mark). The %20's seen in the path indicate a space in the folder name, these should be preserved. The widget path parameter that would be used for the second URL would look like:
<param name="pathname" value/Forums/Quietdrive%20Tour%202006" />
Recent Board and Blog Posts
- pathname (Required)
- count — This limits the number of posts that are shown. The value must be a number. By default it's 10.
- title — This allows the title of the folder to be customized
Poll Results and Links
- pathname (Required)
- title — This allows the title of the poll/link folder to be customized
Members Online
- title — This allows the title of this widget to be customized. By default it's "Members Online Now"
Widget XML Example
<?xml version="1.0"?>
<widget_config>
<proxy href="proxy.php" />
<widget id="widget-boardposts" type="BoardPosts">
<param name="pathname" value="/Forums" />
<param name="count" value="3" />
<param name="title" value="Recent Posts" />
</widget>
<widget id="widget-membersonline" type="MembersOnline" />
</widget_config>