WordPress.org

Ready to get started?Download WordPress

Forums

124

CG-Amazon ready for primetime! (116 posts)

  1. davidchait
    Member
    Posted 9 years ago #

    I've made the 0.91 BETA release available:
    http://www.chait.net/index.php?p=147
    It provides easy populating of a database full of your favorite Amazon products, and quick adding to your template for displaying recent and random items.
    Supports pretty much any product listed on Amazon (at least first-party items -- anything with an ASIN), in every catalog -- games, toys, music, dvds, books, electronics, apparel, you name it!
    Basic locale support, though I've only ever tested US (people wanting to try outside of US should talk to me).
    Any Qs, fire away!
    -d

  2. davidchait
    Member
    Posted 9 years ago #

    Any takers? Free tech support! ;)
    It's really simple to implement. Copy files to server, move one file into wp-admin, set write permissions on cache directory, modify the admin menu, include file into template, modify base config variables, add one-line php into template, add a ton of products through the admin interface, and voila! Your favorite products in your sidebar!
    I'm open to feature discussions, stuff to put it more in parity with MTAmazon, etc. The low level search/query handle can process most every type of search, but I haven't exposed them all to the upper level yet (most people want to show specific products, not random-query-of-amazon products). Plus samples to show you how to add lists of accessories or related items for a particular product. Best of all, its OWN index page for visitors to see details before heading over to Amazon -- that is, if you want that feature activated! ;)
    -d

  3. Beel
    Member
    Posted 9 years ago #

    Don't want you to think this went unnoticed. I dl'd it and will get to it when I get a little free time.

  4. randybrown
    Member
    Posted 9 years ago #

    Is there a site running this that gives a demonstration of what it does?

  5. Beel
    Member
    Posted 9 years ago #

    Haven't quite gotten it to work yet but don't have a solid block of time. You have my-plugins in one spot instead of cg-plugins and I got a table creation error so did it by "hand". Now getting undefined function "cg_amazon_lookup()" but that will have to wait until later.

  6. davidchait
    Member
    Posted 9 years ago #

    Weird! Maybe I copied up the wrong versions of files (that function doesn't exist in my revised code!) And my-plugins should be cg-plugins -- again, may have copied wrong version -- I have to rename my local dir to cg-plugins finally to eliminate future issues...
    Will look into it in the morning. Thanks Beel! I appreciate the testing-support!
    randy, check out http://www.chait.net for more 'extreme' use of it all. Sidebars on left edge, clicking them takes you to the cgaindex pages which have different left sidebar items (accessories & similar) and a Popular Products list at the right. If you click the Products button on the top of the page, it'll take you to the raw list.
    Will post up more info (and fixed version) in the morning. Thanks all for your patience... first release is always the hardest!
    -d

  7. davidchait
    Member
    Posted 9 years ago #

    To those of you who have downloaded, please grab it again, and NUKE the old copy: I had left in my own DB access information in one file. Like to see that destroyed (there's only 5 of you -- thanks!).
    I also hadn't finished updating the cga-admin interface to new function names, so it fails to let you add/manipulate the database. And lastly, I was using a direct wpdb access function (everything must go through the db_fns file, for abstraction), with the wrong function name. Copy&paste error.
    Let's try 0.92. ;) Download away!
    http://www.chait.net/index.php?p=147
    Thanks everyone!
    -d
    -d

  8. Beel
    Member
    Posted 9 years ago #

    Getting there. Went to include the files in the index page and had a conflict with cg-referer so disabled that just to checkout how it looked. Now I am working through why info from xmlcache is pulled into the page and why I am getting:
    Fatal error: Cannot instantiate non-existent class: xmlparser in D:\Apache Group\Apache2\htdocs\wordpress\cg-plugins\AmazonQueryMgr.php on line 250

  9. Beel
    Member
    Posted 9 years ago #

    You still have some clean-up to do ;-)

  10. Beel
    Member
    Posted 9 years ago #

    OK, probably my bad. I have a couple of hacks of yours, including cg-feedread and xmlparser.php is placed in the root directory for that - it was interfering with cg-amazon (as is cg-referer re-declaring functions). Need to find a way to get them all working together.

  11. davidchait
    Member
    Posted 9 years ago #

    Awesome! Looking good. I'm glad I took the extra time to work on "wpstyle" compatability for cgaindex.php -- It looks like it's a natural page on your site!
    BTW, you'll want to set the :hover color on the block, as the text is turning white/invisible. Other than that, only someone like me would even know it was two different systems running. ;)
    The 'new' versions of feedread and referer up on chait.net are the ones 'synced' with cg-amazon. You can put the new ones INTO cg-plugins, and include them after cga-config and use $myplugins to include them from the right subdir name...
    Let me know if there's features that seem missing, or ability to style, layout, whatever. I'm in the process of allowing you to override the 'block' start/end and 'info' generator functions, though I'll admit I'd rather write a mini tag-replacement system for templating.
    d

  12. davidchait
    Member
    Posted 9 years ago #

    Btw, cg-amazon.css is simply a worker template. Change it all you want. There's nothing expected, I just wanted to have a sample there for people to play with! Override, comment out, add to your hearts delight!
    I figure that some people may want to customize even more specifically, down to the li, li a, whatever... so be it. I just set up the framework, you make it look better. ;)
    Glad it seems to be working. How'd you like the cgaindex thing? I'm thinking about adding an Admin-only button/link on a cgaindex product page that says 'add this to DB', so that when you click to a product or accessory NOT in your DB you can one-click add it in (well, and then go back and edit the custom category... but at least you have the ASIN copied automatically over for you).
    -d

  13. davidchait
    Member
    Posted 9 years ago #

    Just so I make it clear for new people reading this thread (and I've noted this on my site):
    IF you already use one of the CG libraries (Referer and/or FeedRead) AND you download CG-Amazon, you'll want to:
    1. download the NEW referer/feedread versions that are on my site.
    2. put the referer/feedread files INTO the cg-plugins directory that CG-Amazon creates/uses (they all share a directory here, and share a number of common files).
    I may go package up one universal CG-LIB archive with all my hackery in one file, and then you can include/activate each plugin/hack at your leisure.
    -d
    http://www.chait.net

  14. davidchait
    Member
    Posted 9 years ago #

    Definitely let me know about the meta-tag stuff -- I'm interested in where I might fit that into stuff for more automated generation for 'newbie' users.
    Also, just put up revised version with:
    - feedback in the admin interface for adding products. tells you ADDED, DUPLICATE, ERROR. No more guesswork! ;)
    - cgaindex product pages now show an "Add Product to DB" button at the top if the product you are looking at isn't yet in your DB. For instance, you browse an accessory or similar item, and now quick-click the Add button, and immediately that product goes into the DB -- no more copying and pasting ASINs when browsing related products! (I've already found this VERY useful for building up a quick db of related products, without just bulk-adding everything under the sun -- which I dislike as a solution!)
    - and the prior minor fixes to pathing issues.
    Release 0.921 is in the same old location:
    http://www.chait.net/index.php?p=147
    As always, lemme know if people like/dislike it, or have further feature requests! I aim to please! ;)
    -d

  15. Beel
    Member
    Posted 9 years ago #

    Looking for the "add" button but have not found it yet...

  16. davidchait
    Member
    Posted 9 years ago #

    FIRST - FOR NEW USERS:
    the line to create the DB in the helpfile was wrong. the correct line is:
    /wp-admin/cga-admin.php?create=1">http://<yoururl>/wp-admin/cga-admin.php?create=1
    the =1 was missing in the helpfile originally. uploading a new version.
    @Beel:
    It should be at the top of the cgaindex.php page when viewing a single item that ISN'T in your DB already. Oh, AND you are logged in as a user with user_level>4. This is an admin function, after all! ;)
    So, pick an item in your db, then click on the sidebar on a similar item (that isn't yet in your db), and you should get a button just above the start of the product listing, but under the header. Of course, I didn't yet double check this with the 1.2 clean site, just with CHAITGEAR, so it is possible the button is getting covered or shifted offscreen.
    -d

  17. davidchait
    Member
    Posted 9 years ago #

    Okay, 0.922 is now being uploaded -- should fix user-login-detection issues I missed as my site checks login state within wp-config at all times... my bad!
    cga-config.php now does the login checks, and I've also changed the bracketing slightly so that I can use my defaults on my site, but make sure I give a clean copy at to all of you! ;)
    -d

  18. Beel
    Member
    Posted 9 years ago #

    File still says 0921 but now I get (and of course its late and I did not backup so I am off to bed to look at this later):
    7 Items. Sort by age (ascending).
    Current Items (-15-0)
    ID Asin Name AmazCat BlogCat Note Action
    Warning: Invalid argument supplied for foreach() in D:\Apache Group\Apache2\htdocs\wordpress\wp-admin\CGA-ADMIN.php on line 421

  19. Beel
    Member
    Posted 9 years ago #

    Tell me if you can recreate the problem, if not I'll poke around on my end. Just got up so I'd rather go get a cup of coffee and a paper...

  20. davidchait
    Member
    Posted 9 years ago #

    The only thing I can see would cause that is if $maxPerPage somehow got a - sign before it, i.e., $maxPerPage = -16; That would show up as (-15 - 0).
    Well, that's not quite true. If $page was 2 somehow, even though you've only got one page, the same thing would occur.
    I'll put in a few sanity checks.
    I also just added another cool admin feature. There's now a right-floating "@" on cgaindex.php pages, that will jump you into the cga-admin interface at any time. Only shows up if user_level>4, and bc it's simple float-right, possible it could get covered up...
    Making new 0923 version and uploading...
    -d

  21. Beel
    Member
    Posted 9 years ago #

    Something's broke. Before you look any further, I am going to drop my table and recreate it this afternoon or evening. At this point starting from scratch might be the way to go, especially since I only had a few items in the database.

  22. davidchait
    Member
    Posted 9 years ago #

    Sounds good. With the new click-to-add thing, you can quickly populate a DB with a bunch of random items for testing. ;)
    Drop me an email if you want to IM later about this offline til we get it figured out.
    -d

  23. Beel
    Member
    Posted 9 years ago #

    Dropped and recreated the database, but on the first add got:
    Result = [ADDED]
    1 Items. Sort by age (ascending).
    Current Items (-15-0)
    ID Asin Name AmazCat BlogCat Note Action
    Warning: Invalid argument supplied for foreach() in D:\Apache Group\Apache2\htdocs\wordpress\wp-admin\CGA-ADMIN.php on line 433
    I'll keep looking for the cause. You can ICQ, AIM, MSN or Yahoo me anytime.

  24. davidchait
    Member
    Posted 9 years ago #

    Okay, so thanks to Beel, we've hunted down and fixed two more issues, one related to plugins overriding my $page variable for multi-page lists of products, the other related to escaping/slashing strings properly before insertion into the database. I've also added user-config control over the number of items listed per page (same number for cgaindex and cga-admin lists...).
    Release 0.924 is now up:
    http://www.chait.net/index.php?p=147
    -d

  25. lomara
    Member
    Posted 9 years ago #

    Stuck with this error:
    Fatal error: Cannot redeclare findstr() (previously declared in /home/user/public_html/wpblog/helper_fns.php:116) in /home/user/public_html/wpblog/cg-plugins/helper_fns.php on line 116

  26. Beel
    Member
    Posted 9 years ago #

    You are probably using another hack that calls helper_fns, read the May 15th post regarding this.

  27. davidchait
    Member
    Posted 9 years ago #

    As the download page notes:

    NOTE: if you use cg-feedread and/or cg-referer, grab THOSE new versions as well, as they have been synchronized with this release. You’ll want to place them into the cg-plugins folder that’s in this (CGA) zip/archive.

    get the new stuff, put it all in cg-plugins, include cga-config.php FIRST before the others (as it'll setup $myplugins so you can use that for paths to the others)... and all should be good.
    d

  28. davidchait
    Member
    Posted 9 years ago #

    Ugh, just found another minor issue.
    The documentation line to add to your INDEX.PHP is WRONG. It was correct for the first release or two, but is now incorrect.
    The correct line to add after wp-blog-header is:
    require_once('cga-config.php');<br>
    That is all that is needed to start the system. It'll load all other required files.
    Going to update the doc and note on the site, and rev the version.
    -d

  29. davidchait
    Member
    Posted 9 years ago #

    Okay, new files are up. Docs are revised. Better sanity-checking in place.
    Let me know if people run into further issues. I'm here to fix em! ;)
    -d
    http://www.chait.net

  30. Anonymous
    Unregistered
    Posted 9 years ago #

    Had to replace the last line of the create table script in cg-amazon.php as
    ) TYPE=MyISAM;"; // corrected a bad terminated query causing error on some servers
    to get it to work with my severs...thanks to wp-polls for pointing this out!

124

Topic Closed

This topic has been closed to new replies.

About this Topic