Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Possible to play sound in page for alert?

Newtron35
2005-10-05
2013-05-30
  • Newtron35
    Newtron35
    2005-10-05

    Apparently several volunteer librarians don't really "look" at the screen and just "grocery store" the books through the scanner.  When under the Circulation tab to check out or check back in a book and the barcode isn't found (due to several different reasons), in red comes up: "No bibliography was found with that barcode number."   Since they're not paying attention to the screen, they just keep scanning.  I'm not a PHP person, but is there a way to play either a .aiff, .mid (MIDI) file or a way to generate a "sound" when that  "No Barcode" page loads?  Does anyone know the php code to amend into the original code to do this?

    Thanks so much in advance,
    Nate Shaffer
    nshaffer@sja.pvt.k12.or.us

     
    • Micah Stetson
      Micah Stetson
      2005-10-05

      One easy way to do this might be to have OpenBiblio beep whenever there are any error messages.  Because of some bugs that still exist, it may actually beep more often than that, though.  Edit shared/header.php and add code like this after the include("../shared/header_top.php") line:

      if (isset($_SESSION['pageErrors']) and !empty($_SESSION['pageErrors'])) {
      ?>
      SOME HTML HERE
      <?php
      }

      Then the HTML you put in there will be added to the top of the page (after the header) when there are errors.  You'll need to work out for yourself what HTML to put there, but these pages may help:

      http://www.phon.ucl.ac.uk/home/mark/audio/play.htm
      http://www.boutell.com/newfaq/creating/scriptsound.html

      As usual, this idea is utterly untested.  Let me know how it works.

      Micah