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 = '';
	$WPopac_ilssso = '';
	$raw = utf8_encode(file_get_contents($WPopac_ilsbase .'record='. $id));
	$temp = explode('</table>', $raw);
	$availability = NULL;
	foreach($temp as $tem){
		$te = explode('bibItems">', $tem);
			$availability = strip_tags(('<table>' . $te[1] . '</table>'), '<table><tr><td><th>');
	foreach($temp as $tem){
		$te = explode('bibHoldings">', $tem);
			$holdings = strip_tags(('<table border = 0>' . str_replace("\n", '', $te[1]) . '</table>'), '<table><tr><td><th><hr>');
		return($availability . '<p><a href="'. $WPopac_ilsbase .'record='. $id .'" rel="nofollow">View record in LOLA catalog</a> ยท <a href="'. $WPopac_ilssso . urlencode($WPopac_ilsbase.'search/.b'.$id .'/.b'.$id .'/1%2C432%2C432%2CB/request') .'" rel="nofollow">Request item</a></p>');
	}else if($holdings){
		return($holdings . '<p><a href="'. $WPopac_ilsbase .'record='. $id .' rel="nofollow"">View record in LOLA catalog</a></p>');
		return('<p><a href="'. $WPopac_ilsbase .'record='. $id .'" rel="nofollow">View record in LOLA catalog</a>');

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:

Plugin Name: My Site Extras
Description: Local customizations for My Site
Author: Me.
Version: 1.0
Author URI:
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.

2 Responses to “scrib_availability”

  • 1
    Jonathan Says:

    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.

  • 2
    alejandro garza Says:

    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…

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.

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>