perl-begin / lib / books.wml

<define-tag get_ext_publisher whitespace="delete">
<ifeq "%0" "oreilly" "<a href="">O'Reilly and Associates</a>" />
<ifeq "%0" "manning" "<a href="">Manning Publications Co.</a>" />
<ifeq "%0" "new-riders" "<a href="">New Riders</a>" />
<ifeq "%0" "wrox" "<a href="">Wrox Press Inc.</a>" />
<ifeq "%0" "apress" "<a href="">Apress</a>" />
<ifeq "%0" "morgan_kaufmann" "<a href="">Morgan Kaufmann Publishers</a>" />
<ifeq "%0" "onyx" "<a href="">Onyx Neon Press</a>" />

<define-tag book_store_amazon>
<preserve isbn title />
<set-var %attributes />
<a href="<get-var isbn />/ref=nosim/shlomifishhom-20/"><get-var title /></a>
<restore isbn title />

<define-tag book_store>
<preserve isbn />
<preserve store />
<preserve title />
<set-var %attributes />
<ifeq "<get-var store />" "ukamazon"
    "<set-var ucstore="Amazon UK" />"
    "<set-var ucstore="<:{print ucfirst("<get-var store />")}:>" />"
<ifeq "<get-var store />" "amazon"
      "<book_store_amazon %attributes />"
            <a href=";bookstore=<get-var store />;bookisbn=<get-var isbn />"><get-var title /></a>
<restore title />
<restore store />
<restore isbn />

<define-tag book_info>

<preserve authors publisher isbn perlbooksid perlbookslink online_url />

<set-var %attributes />

<set-var ext_publisher=<get_ext_publisher <get-var publisher /> /> />
<set-var perlbookslink="<a href="<get-var perlbooksid />">Book Page at</a><br />" />
<div class="bookinfo">
<h3>Book Information</h3>

<b>Authors:</b> <get-var authors /><br />
<b>Publisher:</b> <get-var ext_publisher /><br />

<if "<get-var online_url />" "<a href="<get-var online_url />"><b>Download/View Online</b></a><br />" "" />
<if "<get-var perlbooksid />" "<get-var perlbookslink />" "" />

<b>Buy From:</b>
<book_store isbn="<get-var isbn />" store="amazon" title="Amazon" /> -
<book_store isbn="<get-var isbn />" store="powells" title="Powells" /> -
<book_store isbn="<get-var isbn />" store="amazonuk" title="Amazon UK" />
<br />

<restore authors publisher isbn perlbooksid perlbookslink online />

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.