Forums

NEW! Amazon Media Manager 1.5 (*Finally!*) (218 posts)

  1. splunk
    Member
    Posted 3 years ago #

    When I go to upgrade my database, all my entries show up like this...

    WordPress database error: [You have an error in your SQL syntax near '; ' at line 18]
    INSERT INTO wp_amm ( amm_author, amm_director, amm_title, amm_asin, amm_productGroup, amm_publisher, amm_artist, amm_label, amm_manufacturer, amm_model, amm_brand, amm_userComments, amm_rating, amm_country, amm_dateadded, amm_smallImageURL) VALUES ('', '', 'Bowling For Soup - A Hangover You Don\'t Deserve', 'B0007WF1UU', 'Music', '', '', '', '', '', '', '', '5', 'us', '2005-07-24 02:26:46 00:00:00', 'http://g-images.amazon.com/images/G/01/x-site/icons/no-img-sm.gif');

    then when I try to call anything from the DB, nothing outputs because I assume nothing was upgraded?

  2. VGraupera
    Member
    Posted 3 years ago #

    Hi,

    I installed this plugin, and while it looks awesome the performance I am seeing is super slow. I notice that all the examples seem to be for 3 or 5 items. I tried it with a list of 20 items and it can take more than 2 or 3 minutes to generate the list! Ouch.

    Is this correct? Is this because of some delay with Amazon? Is there any work around?

    Any help appreciated. I was thinking to just take the output of the page and cache it somewhere. Is there a plugin or something to do that?

    Here is an exmaple of my slow page with about 20 books: http://www.vidalgraupera.com/blog/books/

    Thanks,

    Vidal.

  3. Beel
    Member
    Posted 3 years ago #

    It would take awhile if it is not cacheing, which I assume this plugin does - or does it not?

  4. denyerec
    Member
    Posted 3 years ago #

    VGrauper : All the information you use is held locally, with the exception of the images from Amazon. We did this partly for the sake of simplicity and partly because if storing copies of the images locally was required you'd run into people over-running their hosting space allocation and all that jazz.

    I've been scratching my head for a little while over the best compromise to the problem, I was thinking perhaps a user-defined space limit on a folder to which the N most recently requested images would be copied. The system would check there 1st, and check Amazon second.

    This feature is however going to have to wait until all our other deadlines and jobs are clear, or until someone gives us some money :)

    Splunk : Your assumption is correct, but the error is inexplicable as tests both on our local server and my own blog showed the upgrade script functioning correctly. Please contact me via my website with more details about your setup and I'll see what I can do.

  5. denyerec
    Member
    Posted 3 years ago #

    Oh also VGrauper : could you please test if my assumption is correct by removing all the image tags from your template and seeing if you setill get the same delay? Don't want to be chasing wild geese...

  6. VGraupera
    Member
    Posted 3 years ago #

    Hi,

    First, thanks for the super quick reply.

    I edited the template to omit the images and now it works super fast. The slowness therefore appears related to gettting the images from Amazon. If these were cached, I assume the problem would go away.

    Why not just add the images to the DB when you add all the other info into the DB the first place? The image is not likely to change. This would be simpler than caching the last N images.

    At least for me, space is not an issue.

    Vidal.

  7. Beel
    Member
    Posted 3 years ago #

    Besides the issues already mentioned regarding sheer storage size, it is complicated by the fact you can request images by size. In the sidebar I use the small image, in the main page either medium and large (I think there are also sizes inbetween). That's a lot of duplication and to store them in my database or cache them - no thanks. Better to limit the number of images per page.

  8. denyerec
    Member
    Posted 3 years ago #

    Echoing Beel on this one, what is not a concern for you yeilds 3287 support emails for us :)
    If we acted without concern, it'd be written in pure PHP5, or perhaps Ruby, you see where I'm going with that...

    Anyhow, what appears to be the best solution at present would be to allow the user to specify an optional cache of user-defined size to keep the N latest images requested. OK it's not fantastic, especially if you're displaying random books, but for index pages or large displays it'll certainly cut down load times. Bear in mind that wherever the images are stored, the end user still has to download them.

    Looking on amazon, the average small thumbnail is approximately 4kb. Assuming you have 20 books listed on your page, you've just given a modem user a 20-25 second load time without really trying, regardless of the the location of the images.

    There will be a version 2.0 (Or maybe a 1.6 to co-incide with Wordpress) and the presence of a cache will most likely be there.

    Don't forget you can request items from your AMM by ID, so it wouldn't be hard to draw up a scheme whereby your index has a list of links to individual items. If i get time, I'll demonstrate how to do this on the AMM website.

  9. adb
    Member
    Posted 3 years ago #

    I had been using AMM successfully for a while now, but when I activated a new theme I got the following error:

    XML Parsing Error: not well-formed Location: http://mysite.com/ Line Number 245, Column 9: <!--

    I'm using the following code:
    <?php amm_getMedia('amm_debug_output',1,AMM_DVD); ?>
    <?php amm_getMedia('amm_debug_output',1,AMM_MUSIC); ?>
    <?php amm_getMedia('amm_debug_output',1,AMM_BOOKS); ?>

    How can I correct this error? Please help.

  10. denyerec
    Member
    Posted 3 years ago #

    Hi there,

    Please use Pastecode or noPaste, and copy the whole of your HTML source for the broken page into it, then post the link here or contact me via email.

    The problem is likely some conflict between your AMM template output and the HTML in your new page template, but without being able to see ther sourcecode I cannot give you a clearer answer.

  11. clintanderson
    Member
    Posted 3 years ago #

    People, forget about AMM what about a theme for the site. I like the site design crisp and easy to navigate! great job!

  12. denyerec
    Member
    Posted 3 years ago #

    Say what now? Which site?

  13. kjhealy
    Member
    Posted 3 years ago #

    Hi, I've just started using AMM and I think it's terrific. I'm having one problem: I can't get AMM to display images of different sizes. Even when, for instance, I use the amm_debug_output() function that comes with the plugin, the all the images are the same size (a small size) and all the image URLS returned are the same, like this:

    LargeImg: http://images.amazon.com/images/P/0521785235.01._SCTHUMBZZZ_.jpg

    MedImg: http://images.amazon.com/images/P/0521785235.01._SCTHUMBZZZ_.jpg

    SmallImg: http://images.amazon.com/images/P/0521785235.01._SCTHUMBZZZ_.jpg

    image(25): http://images.amazon.com/images/P/0521785235.01._SCTHUMBZZZ_.jpg

    Obviously something isn't working, but I can't figure out what it is. I'm using WP 1.5.2, and the plugin seems to work great otherwise. (The only other issue is on the AMM Management Console, where the "Search For" drop-down box has no choices available --- it doesn't show any options. Don't know if this problem is related.)

    Thanks for any help.

  14. denyerec
    Member
    Posted 3 years ago #

    Not sure if you're the person I helped recently by email or not, but it's definately the same problem.

    In the code the image URLS are automatically generated and then checked to see if they are valid. If the check fails, the URL stored in the AMM database is used (This comes from the Amazon search results).

    Some servers do not support the remote checking and, until we get chance to fix it, this fact will remain "un-reported" to the user.

    Now, if you open up amm_output.php and head down to line 591 (If you are using the latest code, which is on the website) and change line 591 to read:


    // if ( $imageinfo === FALSE ) $image = $this->currentItem['amm_smallImageURL'];

    The check will be disabled and your multi-size images should work. bear in mind though, that should the item you search for have broken images, you won't get a safe fallback anymore. It's an unfortunate compromise :/

    (Usually though, the only amazon items that screw up are their user-submitted marketplace items so it's not much of a problem)

    As for the Search-For dropdown box in the console, please check you don't have JavaScript disabled and let me know which browser you're using, we had a report that the JS wasn't behaving in Safari but we thought we'd resolved it...

  15. kjhealy
    Member
    Posted 3 years ago #

    Hi - thanks for your very quick and helpful reply. Your solution addressed my problem directly (I wasn't the person who emailed you though) and now AMM is working as advertised. It's really a terrifically useful plugin.

    As for the dropdown box: Yes, I'm using Safari, 2.0.1 (the most recent release, I believe) on Mac OS 10.4.2 and that menu doesn't work. The "Choose a Country" menu works, but not the "Search For..." menu. It works fine on Firefox.

    Thanks again.

  16. alisha40
    Member
    Posted 3 years ago #

    I am having the same problem as someone else had, but no one has offered a solution that I see. When I enter the example function "amm_my_first_go", I get an error:

    Parse error: parse error, unexpected $ in /home/alishahu/public_html/blog/wp-content/plugins/amm/amm_extras.php on line 92

    I have changed bits and pieces, deleted lines, and the only thing that doesn't bring up this error on the last line of the file is when I leave the file as it originally was (without the function at all). There is not a "$" in the last line.

    Please help!

  17. denyerec
    Member
    Posted 3 years ago #

    I believe there *may* be a small error in the tutorial which I am checking out now.

    You have to have a slight grasp of how a PHP file fits together to be able to modify them. Usually most of these errors occur when you have rogue whitespace outside your <?php ?> tags and so on.

    It's *VERY* important in the amm_extras.php file that there is absolutely NO whitespace (THat is, empty lines, spaces or suchlike) between sections of PHP.

    Go through your file, make sure this is the case and try again.

    If you're still having trouble, contact me through my website and send me a zipfile with your amm_extras.php file in. I'll then help you sort it out.

  18. archshrk
    Member
    Posted 3 years ago #

    I like this plug in very much but is there a way to create rows instead of columns (or both)? Here's a couple of pages in action that would work better if they could be two (or more) columns instead of one.
    http://archshrk.com/archshrks-dvd-library/
    http://archshrk.com/what-to-read/

  19. etoile
    Member
    Posted 3 years ago #

    Fantastic plugin - I love how flexible it is! Now if only I could bend the templates to my will...I've got them doing mostly what I want to, it's just a matter of tweaking.

    By the way, I noticed the imageLink(x) makes it a square image. This results in unsightly whitespace around the image if it's not on a white background. Could there be a way to make x specify the width or the height, but not both?

    I've also got the row question - I have mine working in rows but I'm not sure how to make it wrap at a specified number of cells per row. I could see a sort of foreach-type statement doing something like that, maybe - "for every four items, make a new row" - does that make sense?

  20. soup
    Member
    Posted 3 years ago #

    Hi, this was a similar post earlier regarding this. I can't write PHP at all. But I have got AMM to work. This is what I've got so far. I've tried the following calls in posts (as quicktags).

    <!--amm_getMediaID('amm_my_first_go',2)-->
    AND
    <!--amm_getMedia('amm_my_first_go',3, AMM_ALL, AMM_DATE_DESC, AMM_RATING_ALL)-->

    Now this is what I get - the results return, correctly, as follows:

    Dervla Murphy, One Foot in Laos
    AND
    Steph Park-Pirie (Editor), Once Upon a Rhyme, London
    Dervla Murphy, One Foot in Laos
    Jason Elliot, An Unexpected Light: Travels in Afghanistan

    = = = = = = = =

    Question
    1) The results only list the books but not the links to Amazon. I would like to link the Title to Amazon.

    2) Also I would like to have a small picture to go with with the author and title.

    I've looked at function reference but am not sure how to to apply them for posts and pages.

    Can you point me in the right direction? Thanks.

  21. archshrk
    Member
    Posted 3 years ago #

    Should have answered this sooner. Unfortunately my site is down but the sample 'amm_my_first_go' does not include an image. Try this

    <?php
    function amm_my_first_go($amm){
    ?>
    <?php for ($x = 0; $x < $amm->totalItems(); $x++ ) :?>
    <?php echo $amm->imageLink();?>
    <img src="<?=$amm->autoImage('medium);?> />

    <strong>Title: </strong> <?php echo $amm->title();?>
    <strong>Author: </strong> <?php echo $amm->author();?>

    <?php $amm->nextItem(); endfor; ?>

    <?php
    return $content;
    }
    ?>

    One of those two lines will work.

  22. denyerec
    Member
    Posted 3 years ago #

    Sorry for not responding sooner, I've been sick in bed for a good number of days now and have only just managed to get back to my computer.

    Archshrk : Putting the results into columns would be a challenge for the CSS you use on the output page, rather than something you'd control strictly with the template. However, you COULD control it to some extent in your output template function as follows:

    In the output loops provided and explained in the AMM, only one item is output in each iteration of the loop. There's nothing stopping you using the NextItem() function to move on and output 2 items in each iteration, allowing you to build rows of 2. You would have to do some checking to make sure you didn't output the last item twice in the case of an odd number of results though. (Due to NextItem() staying at the end if it's already at the end.)

    I will check to make sure the recordset functions return true or false values to make this testing easier and will upload new source to the website later.

    Another approach would be simply to echo each book into its own DIV, then style it into two columns using CSS (Float all the book divs left and give them a width, then put them in a container DIV that's twice as wide... Bingo, 2 columns.)

  23. denyerec
    Member
    Posted 3 years ago #

    etoile:

    There are several ways Amazon lets you format images and I picked the one that would be the most "rounded".

    However if you want to modify the behaviour (I agree in retrospect that the white borders are a bit ugly!!) then you want to look at lines 506->520 in amm_output.php

    You should see there how the amazon image URL's are built.
    Look along the lines for :


    ._AA' . $size . '_.jpg';

    And change the AA to SY if you want a fixed height and SX if you want a fixed width.

    Check out this page for more information:

    http://aaugh.com/imageabuse.html

  24. soup
    Member
    Posted 3 years ago #

    Thanks archshrk!

    It does indeed list the books with images. Although the page is coming down slow (from Amazon, I think).

    Also <em>(this for the benefit of other newbies and non-programmers like myself ;-)</em> there's a couple typos in the second line of your given code; it produces a Parse Error in .../plugins/amm/amm_extras.php

    The typos are a couple missing quotes -
    1) single quote after the word medium
    2) double quote after the php closing tag ?>
    The correct syntax is as follows

    <strong><img src="<?=$amm->autoImage('medium');?>" /></strong>

    Also, the above line only displays the book, title and image - it doesn't link to Amazon. The line below, however, will link to Amazon through the image.

    <strong><?php echo $amm->imageLink();?></strong>

    What's more, I now understand better how and where those functions are referenced! Thanks so much!

  25. denyerec
    Member
    Posted 3 years ago #

    archshrk, I tried to check your page and got a "Server not Found"...
    Please let me know when it's back online.

  26. archshrk
    Member
    Posted 3 years ago #

    Sorry, my site's server is down (again).
    Powweb has been having issues since yesterday.
    updates: http://forum.powweb.com/showthread.php?t=57107

  27. archshrk
    Member
    Posted 3 years ago #

    Well, it looks like www.archshrk.com is back online so please feel free to visit. For your convenience, here are the two pages that feature the plugin...
    http://archshrk.com/archshrks-dvd-library/
    http://archshrk.com/what-to-read/

  28. listless
    Member
    Posted 3 years ago #

    For obscure reasons, AMM is sometimes (always?) returning and displaying the "interior" image. For example, I recently tried to add a book with this ISBN number to my database: 0060191449. It properly located the book, but it gave me the following image: http://images.amazon.com/images/P/0060191449.01.IN01._SCLZZZZZZZ_.jpg

    Obviously, it should have given me this:

    http://images.amazon.com/images/P/0060191449.01._SCLZZZZZZZ_.jpg

    The only change I have made to your code is one which you suggested above: in amm_output.php, I commented out the following line:

    // if ( $imageinfo === FALSE ) $image = $this->currentItem['amm_smallImageURL'];

    Any idea why I'm getting this behavior?

  29. listless
    Member
    Posted 3 years ago #

    Oh, and in case it matters, I am using imageLink to ask for the large version of the image in my template.

  30. denyerec
    Member
    Posted 3 years ago #

    My explaination of this is as follows:

    We store the thumbnail returned in the amaon result set in the database as a fallback.

    For some reason, the image returned in the amazon XML request is the internal image, not the cover image. This may be due to a change with amazon's web service, we're looking into it right away.

Topic Closed

This topic has been closed to new replies.

About this Topic