scrib_availability
4 Comments
[innerindex]This function connects Scriblio to the ILS or inventory system to show the real-time status of an item. Because of the wide variety of ILSs and local configurations, it is difficult to suggest code that will work on all sites.
Example for III
Lamson Library uses III‘s Millenium ILS, and uses the following code to retrieve the current status of items:
function scrib_availability($id){
$id = substr($id, 2);
$WPopac_ilsbase = 'http://lola.plymouth.edu/';
$WPopac_ilssso = 'http://www.plymouth.edu/library/r/?destination=';
$raw = utf8_encode(file_get_contents($WPopac_ilsbase .'record='. $id));
$temp = explode('', $raw);
$availability = NULL;
foreach($temp as $tem){
$te = explode('bibItems">', $tem);
if($te[1]){
$availability = strip_tags(('');
break;
}
}
foreach($temp as $tem){
$te = explode('bibHoldings">', $tem);
if($te[1]){
$holdings = strip_tags(('
|
|---|
Putting the function in a plugin
Writing a plugin for Scriblio is the same as writing a plugin for WordPress. The functions in those plugins are available to both the WordPress and the Scriblio components. Below is an example plugin:
< ?php
/*
Plugin Name: My Site Extras
Description: Local customizations for My Site
Author: Me.
Version: 1.0
Author URI: http://My_URL.com/
*/
function scrib_availability($id){
// put the appropriate code in here
}
?>
Put that code into a new file in your site’s (pick a name like my_site_extras.php) plugins directory, then activate the plugin, and it should all work. Here some more detail from WordPress about plugin management.
Related items
4 Responses to “scrib_availability”
Leave a Reply
Comments should show a courteous regard for the presence of other voices in the discussion. We reserve the right to edit or delete comments that do not adhere to this standard.

April 22nd, 2008 at 2:26 pm
There’s a gotcha that had me pulling out my hair for a while: display is set to ‘none’ in the scriblio css file. Comment that out to display availability. Hope that saves someone else the frustration.
April 24th, 2008 at 12:17 pm
How do you handle LOTS of items hanging from a Bib Record? Like, say, journal issues? Seems this would only gather the first few items…
August 6th, 2008 at 2:20 pm
[...] Werk einen eigenen Blogeintrag zu erstellen, so wie es in Scriblio der Fall ist (übrigens auch mit Verfügbarkeitsstatus). Ein Vorteil dabei ist, dass zur Verschlagwortung von Veranstaltungen wie für Literatur die [...]
November 19th, 2008 at 4:56 pm
[...] catalog and import its data into the Scriblio database, turning blah into beautiful. We also use scrib_availability to show website visitors if the book is on the [...]