Posts about Web

Using Shadowbox with Virtuemart

March 24th, 2010

I forgot to mention in my previous post that when using Virtuemart and Shadowbox you end up with double popups if you enable the lightbox option in Virtuemart.

It’s easy to fix just following the instructions on the Virtuemart formum

To summarise you just locate the file administrator/components/com_virtuemart/classes/htmlTools.class.php and find this line at line 899.

$link = vmCommonHTML::hyperLink( $image_link, $text, '', $title, 'rel="lightbox'.$image_group.'"' );

Replace it with this instead.

$link = vmCommonHTML::hyperLink( $image_link, $text, '', $title, 'rel="shadowbox'.$image_group.'"' );

Looking at Joomla

March 24th, 2010

I’ve never really looked at Joomla before, mainly because I had no need and am using WordPress as my blogging platform.

However a work colleague recently asked me to help migrate a Jooma 1.0 site to Joomla 1.5. Their site was a small online shop using the Virtuemart shopping cart.

In the end someone else did the work but it got me looking at Joomla in more detail.

It took me a while to work out the sections and categories as well as all the modules but after the rather steep learning curve I can see that Joomla is a very powerful CMS.

I made a test install using WampServer and had the site up and runnig in just a few minutes. The install instructions are very easy to follow and the install went very smoothly.

After that I installed Virtuecart, Joom!Fish and Ninja shadowbox.

JoomFish makes adding translations extremely easy (I live in Denmark so many sites are in Danish and English) and getting a basic site working was a pleasure.

Card Processing Fees

Looking at Joomla got me thinking about on-line shops so I investigated the cost of processing card payments in Denmark. Most people here use Dankort (a debit card) but to use this you have to sign up with PBS to get a merchant ID. Looking at their costs made me realise that a problem is the cost of traditional card processing companies.

PBS charges are shown here. For an account that only accepts Danish cards you pay DKK300 per month for 100 transaction (that’s about US $54) which seems a ridiculously large amount for a completely automated system.

PBS prices

If you want to accept VISA/Mastercard etc. then the prices is US $145 per month for 500 transactions.

I’ve read quite a few articles on companies trying to break this monopoly, most recently this one in Wired.

Hopefully these start-ups can change the balance of power and really open up micro payments and on-line shops to the masses.

Adding CSS Opacity Using JQuery

February 24th, 2010

I recently read about using rgba values for the background CSS property, it’s very easy to apply using JQuery, for example.

$("#element").css("background","rgba(255,63,73,0.5)")

The last value of 0.5 is just the opacity. Of course this doesn’t work in IE so you need to use.

$("#marker").css("filter","alpha(opacity=50)")

Finally to get the RGB values from the hex colour codes you can use these functions I found here.

function HexToR(col) {return parseInt((cutHex(col)).substring(0,2),16)}
function HexToG(col) {return parseInt((cutHex(col)).substring(2,4),16)}
function HexToB(col) {return parseInt((cutHex(col)).substring(4,6),16)}
function cutHex(col) {return (col.charAt(0)=="#") ? col.substring(1,7):col}

User Styles Extension for Firefox and Chrome

February 11th, 2010

I’ve recently had a problem when using EPIServer with either Firefox or Google Chrome. We’re using version 5 and the HTML editor used, HTMLarea, does not support either browser.

I should also mention that the HTML editor is pretty terrible especially when compared to CKEEditor, for example.

As an example, if I write some style rule like this using the source code:

style="border:0"

then after saving the editor manages to mangle to HTML so it looks like this:

style="BORDER-TOP:0;BORDER-BOTTOM:0;BORDER-LEFT:0;BORDER-RIGHT:0

It manages to expand a simple rule plus add ALL CAPS into the mix (which will not validate as valid XHTML by the way).

But to get back to the point, since the editor is not supported I end up with a very small textarea in Firefox that’s hard to use.

To try and solve the problem I tried the Firefox addon called Resizeable Textarea but this doesn’t work in Firefox 3.6 plus it requires manual resizing every time.

The solution that worked for me is the Stylish addon that allows me to override the CSS rules for any site. I simply made a new rule to resize the textarea looking like this.

@namespace url(http://www.w3.org/1999/xhtml);

@-moz-document url-prefix("http://intranet/login") {
textarea.epitextareaeditor  {height:20em !important}
.episize500 {width:800px !important}
}

A similar extension, called Chrome Stylist, is available for Google Chrome that works almost identically.

They Can’t Really Be That Bad

January 29th, 2010

I just found this URL today, http://thesource.ofallevil.com/ that’s apparently a CNAME for microsoft.com.

If you look at http://ofallevil.com/ using Firefox and Firebug you can see the server runs Apache on CentOS 5.2, but the link to Microsoft loads all the data from Microsoft running IIS 7.5

It’s silly but it brought a smile to my face today.

AWStats Analyze Multiple Logs

November 11th, 2009

If you have logrotate running on Apache log files or your IIS server creates a new log every day then you end up with a bunch of logs that have a similar name format. If you want AWStats to process a large number of these without you having to manually join them (using cat on Linux machines) then you should use the included file called logresolvemerge.pl included with AWStats.

To use this simply use this line in you config file.

LogFile="/usr/share/awstats/tools/logresolvemerge.pl /home/iis_logs/iis_logs/ex* |"

Here I’m using logresolvemerge to join my IIS log files in the format exYYMMDD.log. This line will feed all the log files from oldest to newest to AWStats so it can process them. It works incredibly well and is very fast.

Google Chrome Beta 4 on Linux

November 4th, 2009

I’ve used Chrome on and off in Windows for a while now but finally tried it out on Linux (Ubuntu 9.10 to be exact). It was easy to install the .deb file from Google and I had it running without any problems in less than a minute.

Feature wise it’s the same as the Windows version but the performance is fantastic, it starts in under a second and page loads take fractions of a second. The whole browser feels incredibly fast, in fact faster than anything I’ve tried before.

I recommend that if you’re running Debian or Ubuntu you should give it a try and see what you think.

My Company Upgrades to IE7

September 14th, 2009

I received an email at work on Friday that all work computers will be upgraded to Internet Explorer 7 in the next few days. I nearly jumped out of my seat in joy. As someone who develops Intranet pages I can’t begin to say what a pain in the backside it is to support IE6.

IE 7 certainly isn’t perfect but it’s a damn site better than IE 6 especially in term of rendering and performance on JavaScript heavy pages.

Since IE 7 was released in October 2006 maybe we’ll get IE8 in March 2012! Of course I understand that it has to be thoroughly tested against all company applications; but to be honest we don’t have that many and of those I’m pretty sure many actually use Java so it doesn’t have a lot to do with the browser.

Site Moved to Fatcow Hosting

September 8th, 2009

You may or may not have noticed but my my site bobpeers.com went down over the weekend.

This blog seemed to work just fine but I was getting http 500 errors on my main site. Strangely I was able to view 2 or sometimes 3 pages before the error started but once I got the 500 error every page would then not work.

I viewed my hosts error log and first saw errors regarding these lines in my .htaccess file.

php_value session.use_trans_sid 0
php_value session.use_only_cookies 1

The simply stop the session ID being added to the URL and had been in my .htaccess file for ever. After removing these lines as a test I now saw lots of these errors logged.

[Fri Sep 04 03:45:46 2009] [notice] mod_fcgid: call
/home/bobpeers/public_html/blog/index.php with wrapper
/usr/local/cpanel/cgi-sys/php5
[Fri Sep 04 03:45:09 2009] [notice] mod_fcgid: call
/home/bobpeers/public_html/blog/index.php with wrapper
/usr/local/cpanel/cgi-sys/php5
[Fri Sep 04 03:44:51 2009] [notice] mod_fcgid: call
/home/bobpeers/public_html/HTTPErrors/500error.php with wrapper
/usr/local/cpanel/cgi-sys/php5

Seems like at some point my host went from using plain PHP5 to fastcgi but I have no idea if this is the cause of the error.

After 5 attempts to get a response from my hosts support without getting a single reply (and seeing that the forums are defunct and filled with spam) I decided it was time to jump ship.

After copying my content and MySQL databases he site is now back up running on Fatcow. it’s early days but I’m very happy so far.

My old host was very cheap but as the old saying goes ‘Pay peanuts and get monkeys’.

For reference my old host was Vonetwork and my advice is to steer clear!

3G Internet on Danish Trains

September 1st, 2009

The main train company in Denmark is called DSB and they have recently introduced wireless internet on many of their long distance trains.

In theory this is a great idea but in practice I can’t help but think they’re missed an opportunity. Remember when no so long ago you paid for your internet by the minute and so you connected, did what you had to do, and disconnected ASAP, well it’s the same for DSB.

If you don’t buy an access card then it costs 1 DKK per minute, even with a card it costs 299 DKK per month where I’m tied to using their WIFI hotspots.

Quite why I would do this when I can sign up for mobile broadband for between 200 and 300 DKK a month and have internet anywhere I go in Denmark (and abroad), even with unlimited use using the 3 network, is beyond my understanding.

Certainly last time I was on the train about a month ago the vast majority of people seemed to have their own USB dongles to access the internet. I don’t mind paying something (even though I really think it should be free) but this price is so uncompetitive as to be a joke. But then DSB was never known for good value or forward thinking.

On a related note the trains have their own computer that acts as a proxy server and gateway to the 3G network, users connect to this using an 802.11g connection. I didn’t pay for the internet but accessing the gateway I could see that it was running Ubuntu, the http headers are shown here.

Date: Thu, 13 Aug 2009 12:41:47 GMT
Server: Apache/2.2.8 (Ubuntu)
Accept-Ranges: bytes
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html

Their on train solution I’ve translated from this DSB page and included below.

The chosen solution
DSB has chosen to offer wireless internet in the train, in cooperation with TDC. The solution is based on a combination of WiFi and 3G technology.

The train itself is thus a wireless WiFi solution. WiFi technology is the same as TDC for its Hotspot solutions, which are everywhere at home, at work, in hotels and elsewhere. The WiFi solution is based on a standard called IEEE 802.11g and has currently a capacity of 54 megabits per second.

Communication between the trains antenna and TDC terrestrial base stations / masts are using the latest 3G technology, called HSDPA (High Speed Downlink Package Access). Capacity as of early 2009 is up to 5.7 Mbits / sec. and will be expanded as the 3G technology is developed, and the need for higher capacity.

User’s PC communicate “WiFi” language to the trains Access Point. While the trains antenna communicates the “HSDPA” language with base stations / masts along the track and have a cable connection to the Internet.

The Train Access Point and the antenna are connected via cables to an Internet Controller. The Internet Controller is train solutions heart, and as such has 4 cardiac chambers. These are:

* An ethernet switch with firewall
* A mini-computer (which controls the particular capacity allocation among the users logged in)
* An HSDPA modem, and
* A power supply.