Skip to content

Online Status inSL

Contributors: gwynethllewelyn
Donate link: http://gwynethllewelyn.net/
Tags: second life, online, status, profile, sl
Requires at least: 3.0
Tested up to: 3.2 RC1
Stable tag: trunk

Allows you to show your Second Life online status on any WordPress blog (multiple widgets and shortcodes are possible)

Description

This simple plugin with associated widget allows you to show your online status in Second Life.

It also includes a LSL script to place inside an in-world script, which is available from the Settings menu.

Warning: Versions 1.3.X and above are utterly incompatible with previous versions; you will need to add the new script to all your in-world scripted objects or your blog will not display the status at all!

Installation

  1. After installing the plugin, go to the Settings menu and look at the option for "Online Status inSL". You should be shown a pre-formatted LSL script.
  2. Launch SL.
  3. Create an object in your land.
  4. Open the object, and go to the Contents tab.
  5. Create a new script inside (just click on the button).
  6. Delete everything in that script.
  7. Now go back to the WordPress admin page you've opened, and copy the script and paste it inside your LSL script in SL.
  8. Save the LSL script in SL; it should recompile.
  9. The LSL script will now try to contact your blog and register itself.
  10. You can go back to WordPress, go to Appearance > Widgets, and select the widget "Online Status inSL" by dragging it to one sidebar.
  11. Select the avatar name and (optionally) change the text that gets displayed.
  12. If you wish a SL profile picture, select "left", "right", or "center" for alignment. If you don't wish it, just leave the setting to "none".
  13. Refresh your blog; it should now show your online status!

To have multiple widgets for multiple avatars, just drag & drop a few more. In-world, each avatar needs to have their own scripted object. You can have two or more widgets for a single avatar (although this is pointless...).

Styling of each widget is possible via additional CSS (see FAQ).

From version 1.1.0 onwards, this plugin incorporates the Shortcode API. You can now embed tags inside posts and pages like this:

[osinsl avatar="Avatar Name"]

See the section on Shortcodes for more information.

1.2 includes the ability to delete tracked avatars from the admin page. This is mostly needed if you're doing a lot of tests, lost an in-world object and need to create a new one for the same avatar, and so forth. Note that you can have several online status indicators on different sims for the same avatar.

1.2 also allows an optional SL profile picture to be shown on the widget (or via shortcodes on any page or post). For this to work, you need to have set your SL profile to visible on the Web.

From 1.3.0 onwards, the plugin has been rewritten from scratch and the previous in-world scripts will not work any longer. Now the widget won't contact the in-world object any longer; instead, it works the other way round: every minute, the in-world object will see if the status has changed. If it has, it will send an update to the blog. If not, it won't do anything and just patiently wait. The blog will just read stored information from the WP database but not initiate any new communication. This should get pages with this widget to display much faster.

Thanks to Celebrity Trollop for the suggestion for changing this, and to the ever-patient Puitia for the many tests!

Frequently Asked Questions

Uh oh! I have tried out earlier versions before, I did an upgrade, and now 1.3.X doesn't work!

Sorry about that. The code was completely rewritten and now uses HTTP-in instead of XML-RPC, retrieves a bit more data from in-world (to be used on future versions), and stores information on the blog itself instead of external files on the upload directory (and even has some caching).

These were simply too many changes, and it was next-to-impossible to make the plugin backwards-compatible with 0.9.X. You will need to go back to your scripted object and drop the new script inside.

Updating to 1.2 will probably get a profile picture by default; change your widget and save again.

1.0-1.2.1 scripts might still work with 1.3.X widgets, but it's a safer bet to use the new LSL script.

I get a "status unknown" error

This happens when the dataserver in Second Life is slow in responding; there is a limit to the number of successive queries that it replies to. Usually, after the next refresh (every minute or so), it should retrieve the correct status (online/offline) and start working again. Since the in-world object caches entries, this might mean waiting for about one minute for the error to disappear.

I upgraded and now the widget does not update the status

Go in-world and touch the in-world object. It should re-register and everything should work fine again.

The LSL script cannot contact the webserver!

This might happen if you have a very unusual WordPress installation. You'll have to change the line saying "http://your-domain-name/wp-content/plugins/online-status-insl/save-channel.php" to whatever is appropriate for your blog.

I get errors on the LSL script

Make sure you really, really have copied it correctly... in some cases, quotes might be changed into typographical quotes; ampersands into \&amp\; or something like that. If all failed, contact me in-world, I'll give you a copy of the script (you'll have to change the appropriate URL for your blog though)

Nothing works!

Email me at gwyneth.llewelyn@gwynethllewelyn.net, I'll try to do my best to help, but take into account that some of your configurations might be very tough to debug and I might not be able to help you.

I get a lot of errors, but it sort of works...

I need more people like you to help debug me this! I have a rather standard configuration at Dreamhost and this works well with my blogs there. But I can imagine that stranger configurations will be harder to debug! Please try to figure out what version of WordPress you're using, what version of PHP is installed on your host, and if you have writing permissions to the "uploads" directory under wp-content

I want to style my messages, but the widget doesn't allow HTML tags

This is mostly for security reasons and to prevent users to make serious mistakes. You can use CSS to style your Online Status inSL widget instead; see the section on CSS.

When I deactivate the plugin and activate it again, the widget stops working/my avatar names disappear

If you deactivate the plugin and activate it again, all internal data with the online status is lost. You will need to go back in-world and touch the objects (or reset them) to send the information back to your blog. Note that the widgets will still be at the same places and keep the overall configuration except for the avatar name they're bound to.

Sometimes more than one status indicator gets deleted, but I just clicked on one

This happened to me once when switching versions: old data from the same status indicator was still left in WordPress, and I had two entries for the same avatar and for the same in-world object. When deleting one, the other was deleted as well. This should not really be a problem: one of the in-world objects was highly likely inactive (it might have an error on the PermURL setting). Just go back in-world and touch your objects to re-activate them on WordPress.

With more than one widget active, I get a "Warning: unserialize() expects parameter 1 to be string"

Working on it :) But it should be fixed now.

I'm a relatively recent user and my profile picture didn't work

My apologies. New users have a "fake" last name, "Resident", which is however never used on profile pictures. 1.3.5 should fix this.

Can I get translations in different languages?

Starting with 1.3.5, you can. A default English .po file is supplied, so you can tweak it to your own language. I've added Portuguese as an example. More translations are welcome!

Screenshots

Online Status inSL Screenshot 1
Screenshot of widget in action in the Appearance > Widgets area

Online Status inSL Screenshot 2
Create an object in SL. Name it "SL Online Status Indicator".

Online Status inSL Screenshot 3
Click on the "Contents" tab.

Online Status inSL Screenshot 4
Now click on the "New Script" button.

Online Status inSL Screenshot 5
Go back to the blog, and select and copy the *whole script.*

Online Status inSL Screenshot 6
Paste the copied content inside the new script, overwriting it. Save! Done!

Changelog

1.3.7

  • Minor retweaking of the logic for deleting online status indicators from the admin page

1.3.6

  • Fixed tiny bug with incompatible function names with other plugins of mine

1.3.5

  • Added support for multiple languages. Portuguese was added. Translators welcome!
  • Fixed issue for avatars with "Resident" as their last name (links to profile images were broken)
  • Fixed minor programming issues and alt/title tags for the images for full HTML compliance

1.3.0

  • Completely changed the communications protocol. Now no HTTP-in calls are used. This makes the widget much faster to show on pages, and should lead to less "status unknown errors". Thanks to Celebrity Trollop for proposing a much simpler way to the code design!
  • Additionally, shortcodes were not really working unless there was also a widget on the blog. The change should now fix this.

1.2.1

  • Fixed lack of return code on HTTP requests to in-world objects, probably caused by timeouts. Thanks for Puilia for checking it and to Celebrity Trollop for providing a simple fix (I've also added 60 seconds of timeout instead of the default of 5)

1.2.0

  • Adds SL profile picture to the widget, to the backoffice, and to shortcodes
  • Added the ability to delete entries from the database
  • Changed LSL script to be inside a textarea for better layout
  • Fixed shortcode bugs and added new options
  • Fixed incorrect saving of serialized settings and added maybe_unserialize to deal with warnings when serialization was not required (happened when multiple widgets were used)
  • Added target="_blank" on links to avatar profile and object location
  • Removed dependency on cURL

1.1.2

  • More URL bug fixes, solved with rawurlencode

1.1.1

  • Fixes a bug on links when in-world object names have single quotes in the names

1.1.0

  • Implements the Shortcode API for embedding the status on a page or post (with its own CSS classes)
  • Added further snapshots to help out the installation process in Second Life

1.0

Major upgrade! Note that the old version of the LSL script will not work any longer! You need to replace all in-world scripted objects manually

  • Uses HTTPRequest and HTTP-in instead of XML-RPC
  • Supports multiple avatars and multiple widgets
  • Options are now saved using the WP mechanism instead of using external files
  • Uses a caching mechanism to reduce the number of requests to the simulators
  • Added CSS div and span for the widget to allow restyling

0.9.1

  • Added some contributed code by SignpostMarv replacing obsolete attribute escaping code
  • Added smaller screenshot
  • Added a FAQ Q&A for "status unknown"

0.9

  • First release.

Upgrade Notice

Minor retweaking of the logic for deleting online status indicators from the admin page

CSS

To allow styling of the plugin, the following styles are emitted by the widget:

The whole content of the widget is included inside a <div class='osinsl'>

The text before the status is a span with class osinsl-before-status. The status itself is osinsl-status and the text afterwards is osinsl-after-status.

Status unknown (i.e. SL dataserver issues) is styled as osinsl-problems and the text for an unconfigured widget is styled osinsl-unconfigured.

The profile picture (if visible) will have the class osinsl-profile-picture. Users can set the horizontal alignment but nothing else. Size is limited to 80x80 (all this might be changed).

To style embedded shortcode, change the CSS class for osinsl-shortcode.

Shortcodes

1.2 and onwards support shortcodes, to embed online status and SL profile pictures inside posts and pages.

The overall syntax is:

[osinsl avatar="<avatar name>" picture="[none|center|right|left]" status="[on|off]" profilelink="[on|off]"]

avatar is mandatory and should have a valid Second Life avatar name which has an associated online status indicator in SL. This will expand to show the online status (e.g. usually online, offline, or an error message if no widget was configured or if the avatar is not being tracked).

picture is optional and defaults to none (i.e. profile picture is not shown); if the user has set the SL web profile to be visible, this will retrieve their profile picture, and resize it to 80x80. Options are left, right, and center which will provide minimal formatting (additional styling requires CSS; image size is fixed for now).

If the picture is set, status can be set to off (just show the picture but not the actual status).

If the picture is set, profilelink can be set to on (default is off) to link the picture to SL's web profile page.

Status Updates

 Second Life® View GwynethLlewelyn's profile on slideshare

My images

Smiling at homeWorking towards a national OpenSim gridTesting Beta 3.2.7View of Neufreistadt
Digg! Listed on BlogShares Site Meter

 

Gwyneth Llewelyn
Gwyneth Llewelyn is offline in Second Life.
Creative Commons License http://gwynethllewelyn.net is licensed by Gwyneth Llewelyn under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License.