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>" />

<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 />
<preserve publisher />
<preserve isbn />
<preserve perlbooksid />
<preserve perlbookslink />
<set-var %attributes />
<set-var ext:publisher=<get:ext:publisher <get-var publisher /> /> />
<set-var perlbookslink="<a href="<get-var perlbooksid />"><b>Book Page at</b></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 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 perlbookslink />
<restore perbooksid />
<restore isbn />
<restore publisher />
<restore authors />
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.