Month: February 2008

Construct navigation for your Amazon aStore using php and YUI

Amazon “aStores” are very easy to set up, but you will probably find you want to customize the navigation, particularly if you want to integrate the store into your own site. I’m in the process of doing just that, and decided to construct my own navigation system for the DesignSpace book shop.. The php script that creates the tabs for the store is based on the YUI (Yahoo UI) “Tab View Control” and can be easily adapted to your own site.

This is just a down and dirty approach but it is a good start for you to build from.

Continue reading

Construct a variable name in PHP from a string and another variable

The “Shop” page of this site is a php page which displays an amazon a-store category and the second level tabs appropriate to that category, using a “node id”.

The html for the tabs is defined in an included page like this:

<?php
//-------------//
$tabs6= '<ul class="yui-navset bd">';
$tabs6.='<li class="first selected" id="tab6"><a href="shop.php?tab=6" >Web Development</a></li>';
$tabs6.='<li class="" id="tab180"><a href="shop.php?tab=180" >CSS</a></li>';
$tabs6.='<li class=" " id="tab183"><a href="shop.php?tab=183">Javascript</a></li>';
$tabs6.='<li class="last" id="tab181"><a href="shop.php?tab=181">DHTML</a></li>';
$tabs6.='</ul>';

$tabs180= '<ul class="yui-navset bd">';
$tabs180.='<li class="first " id="tab6"><a href="shop.php?tab=6" >Web Development</a></li>';
$tabs180.='<li class="selected" id="tab180"><a href="shop.php?tab=180" >CSS</a></li>';
$tabs180.='<li class=" " id="tab183"><a href="shop.php?tab=183">Javascript</a></li>';
$tabs183.='<li class="last" id="tab181"><a href="shop.php?tab=181">DHTML</a></li>';
$tabs180.='</ul>';

$tabs183= '<ul class="yui-navset bd">';
$tabs183.='<li class="first " id="tab6"><a href="shop.php?tab=6" >Web Development</a></li>';
$tabs183.='<li class="" id="tab180"><a href="shop.php?tab=180" >CSS</a></li>';
$tabs183.='<li class=" selected" id="tab183"><a href="shop.php?tab=183">Javascript</a></li>';
$tabs183.='<li class="last" id="tab181"><a href="shop.php?tab=181">DHTML</a></li>';
$tabs183.='</ul>';

?>
Continue reading

Site Optimization: use Google Suggest and Google Trends to determine top searches

Google Suggest and Google Trends are easy-to-use tools you might not have thought of using for search engine optimization (SEO).

Google Suggest suggests terms related to whatever keywords you type in, and lists the number of results for each one. According to the FAQ, it uses data about the overall popularity of various searches to help rank the refinements it offers.

Continue reading

SyncServer can take up 100% of CPU on OS X

On an underpowered G5 iMac running OS X 10.4, I spent a lot of time troubleshooting performance issues. One of them was the “spinning beachball” effect, where some process would take over for a moment, resulting in everything else hanging until it released some CPU.

On at least one of these instances, launching Activity Monitor showed that Sync Server was taking up 100% of the CPU every few minutes.

Apparently this is a common problem on both 10.4 and 10.5:

SyncServer Problem Post on Mac Forums

Continue reading

Voice recording with the iPhone

UPDATE 2: March 27, 2009 I’ve been using QuickVoice for a couple of months now. It’s good enough that I use it to record piano sessions and meetings. It is pretty sensitive. I did purchase the 15.00 syncing software which you need to pull the files off the iPhone if you haven’t jailbroken it.
UPDATE: Jan 24, 2009 Since this article was written, the app store was launched and there are now many Voice recording apps for the iPhone. Click here to search for the latest list of Voice Recorder applications available in the iTunes Store

Now you can record your voice with the iPhone (or any other phone), and get speech to text functionality as well!

Continue reading

Timing Issues and Javascript

Sometimes, when you use javascript to make a change to some element on a page, you will get a Javascript error along the lines of: “element ‘n’ has no properties.” You check your page, and yes, the element is definitely there, and it is definitely named correctly, and your syntax is definitely correct. So where is the problem?

Well, it may be a timing issue. If your script executes before the element targeted by the script has been rendered, it will not find the element. This can particularly be a problem with frames or iframes. The solution is to move the function call to the bottom of the page, after the element has loaded.

Continue reading