Updated CG-PowerPack 1.5b1 is available
-
The usual location up on CHAITGEAR.
Numerous minor revisions across the board, including some hack prevention code, new [meta] CG-Inline for displaying post meta/custom tags in the body of the post, blacklist update for CG-Referrer and CG-Antispam, CG-Feedread now plays nicer in the sidebar, and CG-Referrer got a bit of an overhaul. Not a required update, but wanted to get some work/fixes out to folks, and seems stable enough to call it ‘beta’ now. ??
Read the CHANGES.txt file for more details. Let me know if folks run into any issues.
-
I’ve read every spec I can find, and scoured the net, and don’t see any references to ctype_digit missing from builds. Must be an anomaly of your host’s build.
So, rather than ‘research’ further, I have just tried to build a simple workaround (making my own version of ctype_digit if it doesn’t exist)… you want to test it? Drop an email to cgcode at chait dot net, and I can send you one replacement file to try.
If it works, I’ll roll it into the next release.
-d
1. cg-amazon is having problems with e.g. german umlauts. they are shown as UTF, but if you use only ISO-8859-15 it’s a problem.
you can rebuild it using locales “de” and search for ASIN 38317601012. how can i access extra fields like binding, publisher, author, …? adding them to the array of $extraProductFields doesn’t work, they are not shown. maybe because they are in their own “loop”? but it would be nice to be able to access them.
1. I’ll have to do some research. I had moved to UTF as that seemed to be the general direction most sites were going, and easy to translate everything INTO unicode. I think I have had some CG-FeedRead issues that are similar, though I thought I had addressed some such problems with CG-Amazon around the turn of the year. Hmmm. I might need another config pref for ISO vs UTF (since most every feed is UTF to begin with).
2. I’ll go test it out — I myself haven’t even used the extra fields stuff for almost a year, though it should all stil work. Certainly, there IS a bunch of extra data in the ‘blob’ for a given ASIN (though I think I’ve gone to a slightly-slimmer dataset from Amazon), it’s just how to output it. I have thought a LOT about a ‘template’ schema for Amazon and FeedRead to allow folks to customize the output near-completely, but it starts getting really complex (and I don’t want XSLT translations necessarily, something a BIT easier for folks!). Lemme go look and see if the extra field stuff is at least still working basically… ??
-d
Ahh, okay. #2 works fine, IF you know where to change a ‘false’ into a ‘true’… ?? But really, I just flipped it on, worked right off the bat. Doesn’t look anything amazing (not a lot of formatting ability…), but the data is all there.
The main CG-Amazon call, query_amazon, is now ‘tucked away’ behind show_amazon_items and show_wishlist_items as some folks found it a bit too tricky. Unfortunately, one of the things I ‘lost’ in that transition was passing through an option to enable/disable the extra fields.
So, I guess there’s two possible directions. One is to add show/no-show as an extra param to the current ‘high level’ calls into CGA. The other is to just show the extra fields whenever I’d normally be showing things like Price, etc. The former gives much more control to you, or at least it’ll seem that way! ??
If you want to test it out and aren’t TOO shy of PHP, you can go into cg-amazon.php, into whichever of the functions you are calling, and look for the query_amazon call. The third line of passed params looks like:
$style, false, false, false, true,
You want it to look like
$style, false, true, false, true,
If you are calling query_amazon ‘old school’ direct style, it is param #13 that needs to be true (not false) in order for the extra data fields to be pulled from the array and shown.
I’m still looking/thinking about #1. ??
-d
Okay, while I won’t upload it immediately, I think I have a working solution in place for CG-Amazon, and hopefully translates instantly over to CG-FeedRead, for people NOT using UTF-8 like most of the world. ??
josepo (and anyone else), if you’d like to ‘beta-test’ it at some point, let me know. otherwise, it’ll likely just roll out in a day or two.
-d
ok, #2 works but…
you can access SalesRank or ListPrice, but there is nothing shown for Publisher, Author, PublicationDate, Binding, …
these items exist, i checked the cached file, but cg-amazon seems not to like them.
i added them to the extra-field-array, made sure i spelled them right, still they are not shown.My bad… Amazon Web Services 4 TOTALLY changed the encapsulation of the XML data feed. So a bunch of the data is now ‘hidden’ a layer lower. I can give you a temporary workaround (I think the long-term approach is likely to ‘promote’ everything up one level…).
In CG-Amazon.php, find the following toward the end of query_amazon:
$info = $CurrentAmazonItem["$extraField"];
if (!empty($info))
Between those two lines, add the following line:
if (empty($info)) $info = $CurrentAmazonItem['ItemAttributes']["$extraField"];
That will try to look up any missing fields under the ItemAttributes data section. I just tried with publication date, and it worked (for those items that HAD one!).
I added that ‘workaround’ into my version here, and also manually promoted “AverageRating” from the customer reviews section to the top so it can be accessed easily. At some point I’ll have to add a ‘rating stars’ output routine, to get a graphical output of the rating of a product into the item block…
Try that, let me know how it works for you. I’m actually excited to have someone pushing beyond the truly basic stuff!
-d
you asked what i’m missing, so i tell you ??
the workaround is working. great job.
but, i like to say “but” ;-), if you access the extrafield author there’s a little problem. with only one author, everything is allright. but with two or more authors it prints “Array”. i guess that’s because the XML-structure is using a kind of array for more than one author.uuh, i forget: the umlauts are working – using UTF – ok in the sidebar. but not if i use cg-inline.
it’s a little bit strange. the umlaut is right in the title-attribute of a-tag, but it’s not right in t-amazon-span under the image.AFTER the new line added above, try adding:
if (is_array($info)) $info = implode($info, ', ');
That should help the array issue… MAYBE. ??
As for umlauts, they were ALWAYS working under UTF-8 encoding. UTF-8 is the native format of every piece of XML data internal to the CG systems (Amazon, RSS feeds, etc.). What I added was a re-encode (or decode) to 8859-1 of anything being output to the user, which should go for sidebar and inlines — but possible CG-Inline is mucking with stuff directly… I’ll make sure to address that for this 1.5.1.1 release I’m working on…
(Hrm… no, Inline is doing the same as everything else. Maybe WP is re-translating the inlined info back into another format, or assuming it’s in UTF-8, and it’s blowing up there… If your site is all in UTF-8, does everything look right?)
-d
I just set my test blog to be 8859-15, inserted my test .de inline into a new post, and it came out fine.
The only time there should be problems is if the client browser encoding is being force-set to something other than the page was tagged/delivered as. UTF8=>UTF8 has zero translation, -15=>-15 stores native in UTF8, but then detects the blog setting as -15 and transcodes before output. If you are using say FF and do View::Character Encoding::[some other encoding], unless it’s an ISO=>ISO translation you’ll likely see issues.
And again, even transcoding to -15 should have some (half-doz) incorrect characters supposedly… without specific conversion tables in place, I can’t magically fix those. ??
If you have a particular case still having issues, lemme know! ??
-d
well, seems to have been a problem with switching from iso-8859-15 to utf-8… i tried with a new testinstall, using utf-8 from the beginning and it’s working.
so cg-inline is doing right, sorry for false alarm. but now i know i should stay with iso-8859-15 unless i have a lot of time to make the switchthe implode-line is working. again great job.
i have some other ideas, but i guess they are overkill for cg-powerpack… there’s a plugin for MT what has many nice features https://www.majordojo.com/projects/BookQueueToo/ – i know, cg-powerpack is capable of most of them.
Interesting. Aside from the obvious extra UI work, CG-Amazon is a decent match — I’ve made it a good hybrid, partially for raw Amazon display (CG-Inline embedded, or wishlist sidebar, etc.), but also a decent tool for tracking a ‘library’ of products across any category of Amazon.
Are there particular features of BQT that you like?
Definitely feel free to drop me an email anytime at cgcode at chait dot net if you have ideas for stuff — I’m always willing to listen. ??
-d
- The topic ‘Updated CG-PowerPack 1.5b1 is available’ is closed to new replies.