First of all, thanks for the great module which helps me a lot.
When I first intalled the module, I found out that 2 blocks "Random Review" and "We recommend" do not appear after I enable them.
I looked into the code "amazon.module" (latest stable version) and found the following problem.
1. in function amazon_form, missing '#default_value' => $node->rating for $form['rating'],
2. in function amazon_block, all of the SQL statements show ntype = 'amazon', indeed it should be 'amazon_node' otherwise we need define the nodetype as amazon
3. the SQL statements should be "LIMIT 1 OFFSET $random" instead of "LIMIT $random OFFSET 1"
Thanks!
Xin
Comments
Comment #1
xqi commentedplease forget number 2. my mistake
Comment #2
Prometheus6 commentedNo apology necessary. I just committed fixes. Give it a couple of hours to repackage.
Comment #3
Tracy Dean commentedJust downloaded the latest version and the SQL error is still there.
Comment #4
Prometheus6 commented*sigh*
I'm slowly getting back some discipline...
The attached file fixes it, in case you check in before today's repackaging.
Comment #5
Tracy Dean commentedHi Prometheus6
There's still an error in the SQL on line 261.
There is also another problem in that line 289 refers to missingm.gif which does not exist - causing an error.
It would also be nice to print the book author's name in the block, say at between lines 293 & 294. Haven't been able to figure out how to do it though.
Tracy
Comment #6
Tracy Dean commentedSorry, item two was a bit misleading.
What I meant was that is there is no image, you get an empty image source url.
Tracy
Comment #7
Prometheus6 commentedI added a theme_amazon_block() function that will let you get at all the fields the amazon_item returns. And the SQL thing is fixed.
I didn't provide a actual missingx.gif files (I envisioned missings.gif, missingm.gif and missingl.gif) after seeing how badly I did with the rating stars. I figured folks could whip up a little 100 x 150 rectangle that fit their site's theme.
At some point over the next month or two I need to clean this up and document it better.
Comment #8
Tracy Dean commentedSorry to keep this going but I didn't expain myself very well.
In the theme_amazon_block() function, if there is no image for the selected book, the module returns a string of the nature
, rather than returning either nothing or missingm.gif.
Hope that makes more sense.
Comment #9
Tracy Dean commentedThe last message got stripped of the output - it should have read
<img src="" alt="the title of the book"...>Obviously this is invalid xhtml.
Comment #10
Prometheus6 commentedI fixed this a couple od days ago...sorry I was so dense.
Comment #11
Prometheus6 commented