Archive | Programming & Code RSS feed for this section

Adding Javascript To Smarty Templates

2. January 2008

0 Comments

I was figuring out how to include Javascript in Smarty templates this afternoon, because you can’t include them directly. After digging around a bit, I realised that all you had to do was to include the Javascript code within {literal}{/literal} tags, like this: {literal} <script type="text/javascript"> var currentTime = new Date() var year = currentTime.getFullYear() [...]

Continue reading...

Use Javascript to Display Random Image and Link

11. December 2007

0 Comments

I was editing a PHP script today when I realised that one of the files did not allow PHP code. Weird. But the annoying thing was that I NEEDED it to run PHP code — or rather, I needed it to randomly display an image with a link. So I had to find other means, [...]

Continue reading...

ZenCart Removing The “Show Quantity in Stock” Message From Template

8. December 2007

3 Comments

I just found this out while playing around in ZenCart. If you have a ZenCart installation and you’re wondering how to remove that “Show Quantity in Stock” message from your product pages, there’s actually a setting in your admin panel to turn it off. Simply log into your admin panel and go to Admin > [...]

Continue reading...

Simple Machine Forums (SMF) Photo Gallery Installation and Setup

2. December 2007

7 Comments

Been playing around with Simple Machine Forums (SMF) — it’s a cool forum software that’s robust and well-supported by an active online community. For those who are unaware of this software, SMF is a free open-source forum application that can be installed on web servers. In contrast to paid software such as vBulletin and Invision [...]

Continue reading...

Free ZenCart Templates / ZenCart Themes / Zen Cart Skins

18. October 2007

7 Comments

If you’re thinking of creating an online ecommerce store, then you’ve probably seen the exorbitant prices that web design firms charge for creating a customised ecommerce shopping cart system. Well, the good news is that there are really powerful open-source (read: free) software available that can do a good job. That’s right – not just [...]

Continue reading...

Recursively Download Folders using FTP with wget in UNIX (even SSH)

15. October 2007

3 Comments

Okay, so you don’t have SSH access to your server, but you do have FTP access to it, and you need *all* the files in a folder. Worse, your directory structure is many levels deep, and extremely messy. Normal FTP won’t cut it, because command-line FTP doesn’t do recursive downloading of folders. Turning off interactive [...]

Continue reading...

Formatting a Decimal Number to 2 Decimal Places in Java or JSP

2. October 2007

2 Comments

I was looking around for the class to format a number to 2 decimal places while I was coding Java, or specifically JSP, and I found it. First, you need to import the DecimalFormat class, so have this line at the top of your Java file: import java.text.DecimalFormat; Or if you’re running JSP: <%@page import="java.text.DecimalFormat" [...]

Continue reading...