Archive for category Programming

Fixing WP e-Commerce

I’ve been implementing the Wordpress e-Commerce plug-in on another site, it’s not a bad freebie but if you’re selling anything more than a handful of items then you’ll need to let your users search your products.  To add this functionality, along with a few other features, you need to purchase the $50 Gold Cart add-in.

I duly purchased and installed the update only to find that the “search” only looked at product titles, meaning that all the description text, additional description text and meta tags were being ignored.   Looking around it appears I wasn’t the only person who needed this functionality and I was able to get hold of some code to change in gold_shopping_cart.php. I still didn’t get the results I was expecting so after checking out the Database table structure I went from

$category_list = $wpdb->get_col("SELECT `id` FROM `".WPSC_TABLE_PRODUCT_CATEGORIES."` WHERE `name` LIKE '".$search_string_title."'");

to

$category_list = $wpdb->get_col("SELECT id FROM `".WPSC_TABLE_PRODUCT_LIST."` WHERE name LIKE '".$search_string_title."' OR description LIKE '".$search_string_title."' OR additional_description LIKE '".$search_string_title."'");

Notice the change in the table being searched. The original code I found still looked in the WPSC_TABLE_PRODUCT_CATEGORIES table but this does not contain the additional_description field, an oversight on the original modders part.

Yet I still wasn’t getting the expected results. A quick count of the $category_list array showed I was getting results but they were getting filtered out further on in the function by this little check:

if($category_list != null) {
				$category_assoc_list = $wpdb->get_col("SELECT DISTINCT `product_id` FROM `".WPSC_TABLE_ITEM_CATEGORY_ASSOC."` WHERE `category_id` IN ('".implode("', '", $category_list)."')");
				$category_sql = "OR `".WPSC_TABLE_PRODUCT_LIST."`.`id` IN ('".implode("', '", $category_assoc_list)."')";
      }

Remember that I’m now searching products directly and the above code is looking to match the products unique ID against a category ID, clearly this will fail on 99% of searches. A quick change to the search criteria is all that was needed to return valid results:

if($category_list != null) {
				$category_assoc_list = $wpdb->get_col("SELECT DISTINCT `product_id` FROM `".WPSC_TABLE_ITEM_CATEGORY_ASSOC."` WHERE `product_id` IN ('".implode("', '", $category_list)."')");
				$category_sql = "OR `".WPSC_TABLE_PRODUCT_LIST."`.`id` IN ('".implode("', '", $category_assoc_list)."')";
      }

With that completed I looked at adding a separate search interface and came across WP e-Commerce Search Widget, a handy bit of code but unfortunately it doesn’t appear to be compatible with the latest version of WP e-Commerce so I had to quickly update

<form method='GET' name='product_search' id="productsearchform" action="<?php bloginfo('home');  ?>/">

to

<form method='GET' name='product_search' id="productsearchform" action="<?php bloginfo('home');  ?>/products-page/">

WP e-Commerce is a lot of work, especially considering you have to pay $50 just to get basic functionality and then hack in the desired features. Lets hope the checkout refresh bug doesn’t hit again….

Tags: , , ,

Halo 3 Asset-O-Matic R.I.P?

As expected, the redesign of Bungie.net; has stopped the Halo 3 Asset-O-Matic from working.

I’m not sure if I will be updating the app to support the new layout, I’ll have to see how inspired I am with the release of ODST…;)

Tags: ,

Halo 3 Asset-O-matic Beta 4

Download Halo 3 Asset-O-Matic Beta 4

What happened to Beta 3 you may ask. Well Bungie made a few changes in between me completing Beta 3 and actually finding time to upload it. By that time it no longer worked.

So, what you have in your metaphysical hands is Beta 4, it’s just like Beta 3 but it works!

The changes are:

*You can now search Matchmaking or Custom games

*You can now go directly to the files instead of the match details

*It is significantly faster (think 5 minutes to search over 2500+ matches..)

*Templates are working (sorta, no word wrapping enabled and no way to clear the output box). This allows you to enter some text in the top section, hit a button and have your text repeated with the following tokens replaced by data from the currently loaded database: %SCREENS%, %CLIPS%, %GAMEID% (used for linking directly to the game), %GAMETYPE%, %GAMEDATETIME% and %MAP%

Alas, Campaign searching did not make it in. I wrote half the code and then realised it needs a whole new DB format to support the relevent information found for a Campaign record. I will add support once my busy work life allows.

Databases from previous versions are not compatible with this new release. A fresh search is always preferred in this house :D

Give it a try yourself, tell your friends! Download the Halo 3 Asset-O-Matic Beta 4 today!

(Feedback is always appreciated folks! :) )

Tags: , , ,

Another Bungie.net update, another revision required

The latest changes to Bungie.net broke Halo 3 Asset-O-Matic again. I’m working on a new build featuring:

  • Search Matchmaking or Custom Games
  • Direct linking to the files page
  • Faster searching (5 times more grabbing threads)

A problem with increasing the amount of network activity is that the thread checking for the next page of results sometimes times out. It’s fine if a grabber thread times out because there’s 24 more left to continue to continue the work but there’s only one thread looking for the next page. I’ll have to see if I can add some fallback code to reinitilise the thread if it falls over.

Tags: ,

Beta 3?

Halo 3 Asset-O-Matic Beta 3

Halo 3 Asset-O-Matic Beta 3

Tags: , ,

Halo 3 Asset-O-Matic Beta 2

Halo 3 Asset-O-Matic Beta 2 is finished, tested and confirmed working with the redesign of Bungie.net :)

This is a hot fix build, all previously created databases are fully compatible with this version. I’m considering implementing support for Custom Games and Campaign game history but this will require the existing code being refactored, something I haven’t yet had time to do…

Tags: , ,

Bungie updates website, Asset-O-Matic still required

I’d been holding off on doing more work on the Halo 3 Asset-O-Matic due to Bungie’s announcement that the File Share system was going to get a major overhaul. Bunige have done a great job of improving the basic system they had in place before but it despite all the improvements they have made it’s still not possible to bring up a list of Assets taken from games you were in, making the Halo 3 Asset-O-Matic still the only way to achieve this.

However
During the refit of the website Bungie made some major changes to the way Assets are displayed which break Asset-O-Matic :( I’ll be making a quick fix version to replace the current beta ASAP, a new beta with more features and bug fixes will be available in a month or two…

Tags: ,

Selected Asset-O-Matic databases

I’ve collected a few Asset-O-Matic search results from a few names you might find familiar ;) I’ll add a few more from Team Bungie when I get chance

Tags: ,

Halo 3 Asset-O-Matic FAQ

As people have been playing with the newly released Asset-O-Matic BETA I posted last night some common questions and problems have popped up..

  • You must extract the files from the zip before running the program.. You cannot run the file from zip as it may not be able to access the SQLite DLL and the search results are saved in the application directory, if this is a temp directory then there’s a good chance you won’t be able to find it or it might get deleted!
  • Once a search is complete the results are not automatically loaded, you must use the Load DB button to open the saved results.
  • Search results are stored in the application directory and are named gamertag_date_time.h3
  • Searches do take some time, to scan my game history of 1774 games takes approximately 20 minutes. Leave it running in the background, you can always load up some other search result files to keep you interested :)
  • If the staus bar is stuck at Scanning Bungie.net game history… and hasn’t changed after 5 minutes try closing the program and restarting the search

Tags: , , ,

Halo 3 Asset-O-Matic BETA

<update>
I should have included a game history file with the beta to keep you occupied whilst you’re scanning your own, here’s Ferrex’s game history. Just load the file into Halo 3 Asset-O-Matic using the Load DB button, you can continue any scans you’ve already started as viewing a scanned game history and downloading one are totally seperate :)
</update>

It’s not quite as complete as I had planned to release but due to not having enough time to refactor the code at the moment and a strong desire to get his tool into the publics hands I’m proud, and slightly worried, to present the Halo 3 Asset-O-Matic beta!

The usual cavets apply, if your PC explodes it is totally not my fault!
I strongly advise that you read the included README.txt as it explains the basic usage and what’s missing.

Please leave bug reports here so I can get them fixed as well as improving the UI and getting those features I had to cut out for this release back in!

Please link to this post rather than directly to the file, thanks!

Here’s a screenshot so you know what to expect ;)

Halo 3 Asset-O-Matic

Halo 3 Asset-O-Matic

Tags: , ,