Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2004-07-03 07:18:03
- Rufnex
- Archived Plugin Author
- From: Germany, Munich (Bavaria)
- Registered: 2004-06-23
- Posts: 51
[archived] jgh_amazon
<pre>
////////////////////////////////////////////////////////////////////
TXP jgh_amazon Amazon-AWS Plug-In
///////////////////////////////////////////////////////////////////
Date: 06.07.2004
Version: 1.0
Author: Johannes Gamperl – visit my blog at http://www.jg-privat.de
Discuss: http://forum.textpattern.com/viewtopic.php?id=2572
<txp:jgh_amazon asin="valid-book-asin" [attributes] />
The asin-Attribut is a must be! Other possible attributes are:
azid
this is your amazon associates-id. this is normaly also a must be, but if
you don’t set this for the default layout it prints out my id ;o)
lang (de|en|uk)
this is to call the amazon-catalog by country the default is ‘de’ for germany.
uk is united kingdom and en america.
A full e.g.
<txp:jgh_amazon asin=“valid-book-asin” azid=“your-id” lang=“uk” />
1) Default Layout
The standard-layout of the output is called by the following TXP-Tag:
<txp:jg_amazon asin=“valid-book-asin” />
Be sure to use a valid book-asin!
2) Custom Layout
For thoose users who want to have here own layout (puh g) of the returned
bookinformation, can call the Plug-In like that:
<txp:jg_amazon asin=“valid-book-asin” [attributes]>
<p>This Book ist called title it has the ASIN asin.
<br />The price is price.</p>
</txp:jg_amazon asin=“valid-book-asin”>
As you see, you can build a custom layout between the opening and closing
TXP-Tag. Remember to call a valid book-asin. Your Layout has no restrictions.
All possible variables are called like var_name.
Layout Variables
title
fauthor
sauthor
manufact
release
media
ship
price
asin
imgs
imgm
imgl
Note: Detailed explanation of this variables comes later … so just play around ;o)
ToDo
* First of all, better english writing (just a quick hack ;o)
* Unlimited book request at once (e.g. for table print out)
* Think about more features, hope about your input/feedback …
///////////////////////////////////////////////////////////////////
</pre>
Download Version 0.2 now: <a href=“http://www.jg-privat.de/dloads/jgh_amazon_v0.2.zip”>jgh_amazon_v0.2</a>
Oki, reade to use :o) So if you have some ideas, talk back to this thread ;o)
It’s small an simple.
cya
Rufnex (j|g)
Last edited by Rufnex (2004-07-18 13:42:58)
Offline
Re: [archived] jgh_amazon
Looks cool.
I look forward to playing around with it, a bit.
Is there a way to add books to a column view, and could we possibly remove some of the information from the listing? The default is awesome, but maybe just a title and an author + book picture view? I’m thinking MT-Amazon (which is a pain in the arse to use) for TP, which looks very possible with this plugin.
Good work,
Gut Arbeit (?),
~valdok
Edit: fixed typo.
Last edited by valdok (2004-07-03 11:51:44)
Offline
#3 2004-07-03 13:40:15
- Rufnex
- Archived Plugin Author
- From: Germany, Munich (Bavaria)
- Registered: 2004-06-23
- Posts: 51
Re: [archived] jgh_amazon
Hi valdok,
thx for your response .. as i said this ist the first idea after work late night ;o)
>> Is there a way to add books to a column view
this will be done by attribute later (maybe display=“col|raw”).
>> and could we possibly remove some of the information
i will try to give you a few customizing options.
>> I
Offline
#4 2004-07-05 22:32:59
- Rufnex
- Archived Plugin Author
- From: Germany, Munich (Bavaria)
- Registered: 2004-06-23
- Posts: 51
Re: [archived] jgh_amazon
Ok .. i’ve found it ;o)
i think the first version of jgh_amazon will be released until the next 2 days .. and you can set up your layout free without any restrictions (i hope).
it will work like that:
<code><txp:jgh_amazon asin=“asin_no” /></code>
This will print out the standad layout.
<code><txp:jgh_amazon asin=“asin_no”></code>
This book is called [title] and has the asin [asin] …
<code></txp:jgh_amazon></code>
You see the second version will give you a free layout engine ;o)
watch out for release …
Rufnex
Last edited by Rufnex (2004-07-05 22:40:41)
Offline
Re: [archived] jgh_amazon
If you make it so I can use <txp:rei_show_custom />
within the asin=""
attribute you win a switcher from <txp:jcv_amazon />
…
Plus it would be real nice!
Offline
#6 2004-07-06 06:56:48
- Rufnex
- Archived Plugin Author
- From: Germany, Munich (Bavaria)
- Registered: 2004-06-23
- Posts: 51
Re: [archived] jgh_amazon
@misterk:
what do you exactly mean with “use .. within asin … “. can you give me a short e.g.?
oki … final tests running successfully.
Offline
Re: [archived] jgh_amazon
it would look like this: <txp:jg_amazon asin="<txp:rei_show_custom />" />
You can also do this with a plugin called “run level,” which screws with the order that txp tags are substituted with their respective values, but it’s a bit ugly.
Last edited by misterk (2004-07-06 14:33:40)
Offline
#8 2004-07-07 10:00:27
- Rufnex
- Archived Plugin Author
- From: Germany, Munich (Bavaria)
- Registered: 2004-06-23
- Posts: 51
Re: [archived] jgh_amazon
Version 1.0 is ready to use .. to read and download, look at page top.
Offline
#9 2004-07-10 22:49:19
- Spiller
- New Member
- From: Macedonia
- Registered: 2004-02-24
- Posts: 5
Re: [archived] jgh_amazon
Rufnex hi,
in the install file at the end it says:
<i>This will automaticly install the required table for my plug-in jgh_amazon.
Call with <txp:jgh_amazon /> inside your content
Be sure to delete this plug-in after installation and remove the TAG from your content</i>
I think it needs to be called with txp:jgh_install instead (since this does the db instalation and the jgh_amazon the actuall presentation)
<strike>Also, after doing this, it works only if I supply the lang attribute and I get this on top:
Warning: implode(): Bad arguments. in /home/httpd/htdocs/tp/textpattern/publish.php(764) : eval()’d code on line 13</strike>
All of a sudden, it stopped doing it :)
any ideas?
Last edited by Spiller (2004-07-10 22:59:55)
Offline
#10 2004-07-10 22:57:30
- Rufnex
- Archived Plugin Author
- From: Germany, Munich (Bavaria)
- Registered: 2004-06-23
- Posts: 51
Re: [archived] jgh_amazon
Hi Spiller,
ups .. yes i would say to delete the jgh_install Plug-In after installation the database table. this is only a helper function. the jgh_amazon plug-in should not be deleted ;o)
thx
Rufnex
Offline
#11 2004-07-10 23:06:08
- Spiller
- New Member
- From: Macedonia
- Registered: 2004-02-24
- Posts: 5
Re: [archived] jgh_amazon
How is the todo list going btw?
Offline
#12 2004-07-10 23:10:14
- Rufnex
- Archived Plugin Author
- From: Germany, Munich (Bavaria)
- Registered: 2004-06-23
- Posts: 51
Re: [archived] jgh_amazon
ToDo:
- Support for multiple Books
- Support for other Categories from amazon
- Support for multiple inserts of the same book in different languages
For more it had to do some brainfuck and think about your input ;o)
Offline