#

Amazon Book Picture

I did it again: Another WordPress Plugin.
This one is very small and simple:
Amazon Book Picture allows you to include a simple tag with a books asin or isbn in your posts which is replaced by an image of that book from amazon.

  • History
  • Compatibility
  • Installation
  • Usage
  • Examples
  • Download
  • Donate
  • Seen at
  • History

    Version: 1.0 – initial
    “Version: 1.1 – xhtml”: This is an alternate version suggested and modified by Thomas Weiße that uses &lt; and &gt; (<>) instead of the [] brackets.

    Compatibility

    Tested with WordPress 2.1.3 up to 2.9.1.

    Installation

    Just upload to your wp-content/plugins folder or any subfolder and activate in plugins menue.

    Usage

    The tag to be used looks like this:
    [abp:SIZE:ASIN:w:IMG-WIDTH:h:IMG-HEIGHT:i:IMG-ID:c:IMG-CLASS]

    With:

  • SIZE is one of S for small, M for medium and L for large
  • ASIN is the ASIN or ISBN (10) for the book
  • IMG-WIDTH is the width attribute of the generated IMG-tag
  • IMG-HEIGHT is the height attribute of the generated IMG-tag
  • IMG-ID is the id attribute of the generated IMG-tag
  • IMG-CLASS is the class attribute of the generated IMG-tag
  • The definition of SIZE, IMG-WIDTH, IMG-HEIGHT, IMG-ID and IMG-CLASS are optional. SIZE defaults to M (medium). Be aware: which size the picture really has depends on what amazon defines. For some books amazon returns the same size picture for medium and large (the medium one). If you want to have a fixed-size image, use the IMG-attributes.

    The whole tag is case-INsensitive

    Examples

    [abp:3492246885]
    Only ISBN defined (size defaults to medium)

    <img src=”http://images.amazon.com/images/P/3492246885.03.MZZZZZZZ.jpg” />

    [abp:S:3492246885]
    Only SIZE (small) and ISBN defined

    <img src=”http://images.amazon.com/images/P/3492246885.03.THUMBZZZ.jpg” />

    [abp:l:3492246885]
    Only SIZE (large) and ISBN defined

    <img src=”http://images.amazon.com/images/P/3492246885.03.LZZZZZZZ.jpg” />

    [abp:l:3492246885:w:123:h:123:i:1:c:book]
    With all possible attributes (width=123, heigth=123, an id and a class)

    <img src=”http://images.amazon.com/images/P/3492246885.03.LZZZZZZZ.jpg” width=”123″ height=”123″ id=”1″ class=”book” />

    Download

    here (contains both versions)

    Donate

    If you like this plugin and it helps so much, that you would like to donate (no matter how much), please do it here.

    Seen at

    (Missing your page? Notify me!)

  • http://weblogtoolscollection.com
  • Stefano’s blog
  • hissig.com
  • Tips Community
  • Thomas Weiße’s German book reviews
  • 18 Responses to “Amazon Book Picture” »»

    1. Comment by Toni | 17:11 20.04.07|X

      way to go, secco! good stuff!

    2. Comment by Toni | 17:12 20.04.07|X

      Strangely, the icons seem to dissappear if you click on the category view: http://narcanti.keyboardsamurais.de/category/literatur/

    3. Comment by Cordanim | 23:28 20.04.07|X

      Wow, very nice – I’ll be putting this on mine too! Thanks!

    4. Comment by Secco | 1:03 21.04.07|X

      I’ll have a look on that category bug as soon as possible, tag.

    5. Comment by Toni | 20:06 22.04.07|X

      Just took a look at your code. I particularly like this line:
      preg_replace( “/(?:\[ABP:(?:\s*)(?:(S|M|L)(?:(?:\s*):)){0,1}(?:\s*)([^:\]]+)(?:\s*)(?::W(?:\s*):(?:\s*)(\d+)(?:\s*)){0,1}(?::H(?:\s*):(?:\s*)(\d+)){0,1}(?::I(?:\s*):(?:\s*)([^:]+)){0,1}(?::C(?:\s*):(?:\s*)([^:]+)){0,1}\])/ismeU”,
      “abp_tag_handler(‘\\2′, ‘\\1′, ‘\\3′, ‘\\4′, ‘\\5′, ‘\\6′)”,
      $text);

      This is purer REGEX poetry man. It made me weep ;)

    6. Comment by Secco | 8:57 23.04.07|X

      ;-) And can you tell me, where the asin is located in that regex?
      btw: such tag-plugins are really easy to create. I’m thinking of creating a tag-o-holic plugin, where you can enter your own tags, regexes and templates.

      the “category-bug” is more a feature of wordpress. In the category-views it generates some kind of summary in which all html-tags get removed and the plugin-chain for content and posts is not used. Examples are: my java category, especially the article summary for “Französich für Java”, where the code is not beeing formatted by the pre tag and is not processed by my new code-highlighting plugin. Another example is my category Persönliche Erlebnisse”. In the main post there is a manually included image, but in the category-summary it’s not displayed.

      So sorry, it’s not a bug, it’s a feature (of wordpress). I’ll have a look at the wp code, if there is a possibility to include some filters for the category-summaries.

    7. Comment by Monika | 21:21 23.04.07|X

      Hi

      ;)
      it is whether a bug nor a feature, it is:hast den codex nicht gelesen feature;)

      get_the_excerpt killt alle html tags

      the_excerpt killt die nur, wenn man den Text und das HTML nicht in den optionalen Auszug direkt hineinschreibt

      nutzt wer the_content in der Kategorienübersicht hat er das Problem gar nicht

      lg

    8. Comment by Secco | 8:34 24.04.07|X

      Danke für den Tip Monika.
      So in etwa hatte ich mir das vorgestellt, nur dass ich summary statt get_the_excerpt genannt habe.
      Mit dem Codex stimmt: der ist meiner Ansicht nach so mager und undurchsichtig, dass ich im Normalfall andere Plugins studiere und nicht den Codex.

    9. Comment by DrWatson32 | 21:41 15.08.07|X

      Hi,
      cool stuff – just what I was looking for.
      But, as always, I found that there are two trivial extensions which would make it even cooler…
      -) adding a class tag to the image to allow CSS formatting (float etc.)
      -) replacing the square [] brackets by the more convenient
      Why? Because when you deactivate the plugin (ok, I’ll never do that :-)), you’ll have odd strings like [abp:3453531981] all over your website ….
      (I can do it for myself, of course, But maybe you might want to include the mods in the “official” package)

      Btw, do you know what’s the legal side of including the images? When you’re an Amazon partner, you’re allowed to store 100-odd title scans on your server – but here you don’t store anything. Anyway, I have a strong feeling that the title images are copyrighted…

    10. Comment by Secco | 14:59 04.09.07|X

      Hi DrWatson32,
      that was a nice idea, didn’t think about that. If you like, just mail it to me and I’ll include it in the zip file.

    11. Comment by DrWatson32 | 23:13 04.09.07|X

      Hi,
      see here.
      Change the file extension to *.php. I took the liberty to put my name into the description :-)

    12. Comment by Estetik | 17:20 30.01.08|X

      Great plugin..

    13. Comment by Burun estetiÄŸi | 17:21 30.01.08|X

      Thanks for plugin..

    14. Comment by kabin | 22:10 01.09.08|X

      its very good project. nice plugins

    15. Comment by clynton | 5:28 09.07.09|X

      I did just like you said and nothing happened. Here’s what I entered into the tag: [abp:1585422789]. Is that right, for default size?

      Thanks so much,

      Clynton

      PS: BTW, the full tag shows up at the end of my post in the tag section. Shouldn’t it be hidden? This surely has nothing to do with your plugin, but if you have any idea, that would be great.

    16. Comment by Secco | 11:29 16.07.09|X

      Hi, if the tag shows up in the post, they the most likely error may be, that you didn’t activate the plugin.
      Can you check this?

    17. Comment by Petro | 2:04 15.02.10|X

      Don’t know if you still support this, but when activating on WordPress 2.9.1 you get a ‘invalid header’ error. I deleted license field and rearranged the order of some header elements and it works now.

    18. Comment by Joy | 9:03 19.06.12|X

      Well, I keep getting notification that this plugin needs updating.

      Is there EVER going to be an update for this? Of any kind? If so I’d LOVE to see support for ISBN 13. However, if not, then the “update” feature needs to be shut off. I’m very close to uninstalling it completely because of the constant update notification when no updates are possible.

      Great plugin other than that.

    Leave a Reply »»

    Note: All comments are manually approved to avoid spam. So if your comment doesn't appear immediately, that's ok. Have patience, it can take some days until I have the time to approve my comments.