I would like to add the LC call number from my library's OPAC to the output display. Perhaps adding the call number along side the ISBN in the curly brackets separated by a comma? What changes to the code would I need to make? I'm no PHP expert.

Comments

rubinsztajn’s picture

Category: support » feature

I suppose it depends on what you're trying to accomplish. Simply printing the LC number for a given book shouldn't be too difficult as that number is included in the Open Library record. For a very quick and dirty approach, you could add something like this to bookpost.module around line 128 (omitting the php tags, of course):

//lc numbers
$lcs = $bookdataresult->{'lc_classifications'};

and replace line 214 with this:

$html_text = "Title: <b>" . $html_title . "</b><br /> " . "Author(s): <b> ". $html_authors . "</b><br />" . "Publisher: " .$html_publishers . '<br />' . "Pages: " . $pages . '<br />' . "Date: " .$date . '<br />' . "LC Number: " . $lcs[0] .'<p />' .$fulltext . $worldcat . $librarything . $googlebooks; 

HTH

jimdemon’s picture

I haven't noticed a LC Call number in any of the records I have been working with, but I think it would be impractical since sometimes there are variations in call numbers from library OPAC to library OPAC. I would like to include the exact LC Call number as it appears in our OPAC. Therefore, I thought the ideal solution would be to enter the number along side the ISBN or OLN in the book post tag.

rubinsztajn’s picture

I'll have to think about this... I'm not sure I see many use cases for this feature. I could add an option that allows users to print whatever label and text they want with the book description, which would serve your use case as well as other use cases. Many OPACs have APIs that provide better options to display information from an OPAC in Drupal. In fact, there are a number of Drupal modules that integrate OPAC and ILS functionality into Drupal, e.g. XC, Millennium, and SOPAC. The Book Post module is specifically for publishing content from the Open Library into Drupal posts.

jimdemon’s picture

I've looked at these as well along with the Bibliography module as a possibility. Yours seems the simplest to start from for my purposes which are to 1) print title, author, pub., and LC Call number and possibly 2) link the title and/or LC Call no. back to the OPAC.