Cubecart – some things to consider
After building a website using the Cubecart software I have made the following observations.
On the front end:
- The search results page doesn’t have any text for when your search turns up no results.
- When you add an item to the basket there is no obvious visual clue that the item was added successfully.
- Longer product options in the dropdowns are cut off.
- The thumbnail images randomly disappear.
In the admin area:
- When editing a product or it’s options clicking submit takes you back to the main product list, this makes editing very long winded.
- Tidying orphaned thumbnails deletes any thumbnails whose larger image is contained in a subfolder.
- Adding extra images to products involves searching through all of your uploaded images.
- The setting for maximum file size for uploaded images is apparently ignored.
- Image file names are not tidied, i.e spaces converted to underscores, etc.
- There is no facility for adding alt tags to the uploaded images.
- The stock level works on a whole product, not on specific options with that product.
A little helper for the Stephen Fry L competition
Right, been trying this Stephen Fry L competition thing on Twitter but I’m not having much success. My mind wandered and I ended up writing this little helper form. It counts up all of the L’s so you don’t have to. Please note that pasting may not count until you type a character. Sorry, but I did write this in about five minutes.
Update Twitter from your iPhone via the command line
This guide assumes you have a jailbroken iPhone or iPod Touch with MobileTerminal installed.
I have Twitterific on my iPhone, it’s a nice app but I’m using my iPhone on Orange and they are quite tight when it comes to decent internet access. I wanted to be able to update my Twitter feed without downloading all of the feeds that I follow. Answer: use wget to send an update.
As I didn’t want to have to type the lengthy wget command every time I set up a shell script to do this for me. Make sure you are in /var/mobile and then open nano with nano twitter-update.sh
Type in the following script:
#! /bin/sh
read -p "What are you doing?" -e tweet
wget -q http://twitter.com/statuses/update.xml --http-user=email --http-password=password --post-data="status=$tweet" >/dev/null
echo "Done"
You need to change email and password to your Twitter login details. Save and close the file.
Next open your .bashrc file with nano and add an alias to save you typing ./twitter-update.sh. Mine looks like this:
alias t='./twitter-update.sh'
Again save and close the file. Reload your .bashrc file with source .bashrc. That’s it. Now I can send a Twitter update by opening MobileTerminal and hitting ‘t’, then type in my tweet.
Installing Perl and the Lighttpd webserver on an iPhone
This guide assumes that you have jailbroken your iPhone with firmware 2.2 and have Cydia and MobileTerminal installed.
Installing Lighttpd and Perl
Open Cydia, go to the search tab and search for ‘lighttpd’. Click on the resulting listing and install Lighttpd.
To install Perl you need to add the CoreDev repository to Cydia. Open MobileTerminal and type the following:
(¬ denotes a wrapped line.)
iPod:~ mobile$ wget http://coredev.nl/cydia/coredev.pub
iPod:~ mobile$ apt-key add coredev.pub
iPod:~ mobile$ echo 'deb http://coredev.nl/cydia iphone main' > /etc¬
/apt/sources.list.d/coredev.nl.list
Now when you run Cydia you should see the CoreDev repository in the sources list, look for an entry called something like Perl 5.x.x-x and install it.
Configuring Lighttpd and Perl
Lighttpd will install without a config file or a place to put your website HTML files so you now need to create these. Open MobileTerminal, you should find yourself at /var/mobile. If not, go there by typing the following and creating a folder called Sites:
iPod:~ mobile$ cd /var/mobile
iPod:~ mobile$ mkdir Sites
Next you need to create the Lighttpd config file. Navigate to the /usr/etc folder and create the file lighttpd.conf:
iPod:~ mobile$ cd /usr/etc
iPod:~ mobile$ nano lighttpd.conf
This will open the nano text editor. Type the following into your file:
server.document-root = "/var/mobile/Sites/"
server.port = 80
mimetype.assign = (
".html" => "text/html",
".txt" => "text/plain",
".jpg" => "image/jpeg",
".gif" => "image/gif"
)
server.modules += ( "mod_cgi" )
cgi.assign = (
".pl" => "/usr/bin/perl"
)
index-file.names = (
"index.html",
"index.pl"
)
This is the minimum you need in your config file to run Lighttpd. This config sets the location of the folder that houses your HTML files that you created earlier, sets the port, assigns a few basic file types and tells Lighttpd where to find Perl.
Now save the file by swiping diagonally down and to the right onscreen until the cursor goes red, then press the letter O. To quit nano swipe diagonally down and to the right again and press X.
You can check the syntax of the config file by typing the following:
iPod:~ mobile$ lighttpd -t -f lighttpd.conf
Testing the webserver
In order to test the webserver you need to create a test HTML file and save it to your /var/mobile/Sites folder as index.html.
Get the IP address of your iPhone in the network settings panel and make a note of it. Go back into MobileTerminal on your iPhone and type the following to temporarily activate Lighttpd:
iPod:~ mobile$ lighttpd -D -f lighttpd.conf
Now try and load the iPhone’s IP address in a browser on your computer, you should see your test index.html file.
Starting up Lighttpd automatically
Open MobileTerminal, navigate to /usr/bin and create a shell script containing the previous start up command:
iPod:~ mobile$ cd /usr/bin
iPod:~ mobile$ nano lighttpd-startup
Then inside nano:
#! /bin/sh
lighttpd -D -f /usr/bin/lighttpd.conf
Save the file then and quit nano. This file needs to have its permissions altered to enable it to run:
iPod:~ mobile$ chmod 755 lighttpd-startup
Now for the code to make the lighttpd-startup script run on start up:
iPod:~ mobile$ cd /System/Library/LaunchDaemons
iPod:~ mobile$ nano com.lighttpd.startup
Again, inside nano type the following:
(¬ denotes a wrapped line.)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" ¬
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.lighttpd.startup</string>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/lighttpd-startup</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
Save the file and close nano. Now the next time you restart your iPhone Lighttpd should automatically start up.