Our online blog

Archive for November, 2008

[Tutorial] Coldfusion Detect mobile device

Tuesday, November 25th, 2008
Coldfusion Detect mobile device


This code detects if the browsing media is a mobile/wap device and redirects to a new directory.

Quote:
<CFIF CGI.HTTP_ACCEPT CONTAINS “text/vnd.wap.wml”>
<CFLOCATION URL=”/wap/index.cfm”>
</CFIF>

NOTE: This is untested but I have seen this code used on live projects.

Rewrite URL for Permanent Redirect

Thursday, November 20th, 2008
This is a great SEO tip to get your website higher in the rankings as it puts more focus on your main domain name (either with or without the ‘www’).
Why use Permanent Redirects
Search engines may think www.yourdomain.co.uk and yourdomain

.co.uk are two different sites. Thats why you should set up a permanent redirect (technically called a “301 redirect”) between these sites. Once you do that, you will get full search engine credit for your work on these sites.

The code is simple to use, all you need to do is open notepad / dreamweaver etc and save a file names ‘.htaccess‘. Within this file copy and paste the text in the quote area below.
Quote:
Options +FollowSymLinks
RewriteEngine on
#
RewriteCond %{HTTP_HOST} ^yourdomain\.co.uk

RewriteRule (.*) http://www.yourdomain.co.uk/$1 [R=301,L]

If you open a document window (PC) / finder window (Mac) you may not see the file this is because operating systems treat the .htaccess file as a hidden file. If you turn on show hidden files you will be able to see it.

Many control now have this feature, one that we use on Host Media UK is cPanel and this feature is on the control panel.

Enjoy!

[Tutorial] ColdFusion Components

Wednesday, November 19th, 2008

We are going to look into using the ColdFusion components known as CFC’s and how easy they can make your web applications.

Some benefits of using CFCs

  • Better security
  • Reuseable code
  • Faster applications

The tutorial
Our first step is to create a database & datasource, you can find all SQL & source files with the ZIP file attached to this thread (You may need to login to access).

(more…)

[Tutorial] Flash AS2 Pause & Play Movie Clips

Wednesday, November 19th, 2008
Lately I had been working on flash websites that require a user to pause a movie on what ever frame it is on then continue on another press of a button.

So I thought I would post this code as it has come in handy on all my projects for major websites:

Quote:
/*
This code goes on the start on the movie clip or root
The buttons instance is called ‘actionBtn’ on line 2 of the AS you will see this
*/

var theCase:String = “doPlay”;
actionBtn.onRelease = function() {
if (_level0.theCase == “doPlay”) {
_level0.theCase = “doPause”;
} else {
_level0.theCase = “doPlay”;
}
trace(_level0.theCase);
};
this.onEnterFrame = function() {
if (_level0.theCase == “doPause”) {
this.stop();
} else {
this.play();
}
};

[Tutorial] ColdFusion Basic Sessions

Wednesday, November 19th, 2008

As Sessions is a big deal I have decided to make parts to it. In part 1 we are going to see how to detect if a session is undefined and to create it.

First thing you need to know is that sessions uses structures, you can have multiply structures for your website for different things.

We are going to work up a simple login system using sessions. We are calling the structure loggedin. The first step is to see if the session has been created, so we will need some if statements for the session detect:

Quote:
<cfif not isDefined(‘SESSION.loggedin’)>
</cfif>

Next we want to create the session if its not defined, the code above is shown below but with cfset tags:

Quote:
<cfif not isDefined(‘SESSION.loggedin’)>
<cfset SESSION.loggedin = StructNew()>
<cfset SESSION.loggedin.username = test>
</cfif>

Now what we have asked coldfusion to do is create a new structure (StructNew) with ‘SESSION.loggedin’ as the structure name. After this we want to populate the session structure with a value within the ‘username’ session. We have just used test for now but we go onto bringing in database from a database to work with a login script.

Easy online site thumbnail creator

Wednesday, November 19th, 2008

I was searching for an easy way to create thumbnails for this blog and came across a really easy site to use packed with features.

Thumbalizr: http://www.thumbalizr.com/

“Online and API interfaces have been improved with some new features and better data handling. To make use of the new features, you’ll have to sign up at least for the free standard API. After Sign up, the online version is enhanced by capture delay, image quality and encoding (jpg, png)”

Company site design rumours

Wednesday, November 19th, 2008

AeonCube Networks main designers have been talking about a full corporate update of the company website. This would include integrated PayPal systems for all product ordering and user account management.

New areas such as ticket support systems and members product download areas would be opened up to allow customers to feel more at home using the corporate site. Some designs have been placed but the main areas the teams wants to improve on is the integrated systems on the site.

Branding
The AeonCube Networks branding would stay the same and basic styles would be kept but layout and systems would be greatly improved.

Fast Hosts servers hacked

Wednesday, November 19th, 2008

HOSTING FIRM FASTHOSTS sent a letter to its customers warning them a server had been hacked.

The firm said: “We have recently discovered evidence of a network intrusion involving a Fasthosts server. We have reason to believe that the intruder has gained access to our internal systems, and that this may have in turn given them access to your username and some service passwords.”

As a precaution, it is asking customers to change main account passwords, email passwords, FTP passwords and MySQL and MS SQL database passwords.

It added: “We recognise that this may cause some inconvenience and concern, and for that we sincerely apologise. Please be assured that your account security is extremely important to us, and we have taken every step possible to secure your information against any future intrusion attempts.”

Visit Source

[Tutorial] ColdFusion date and time

Tuesday, November 18th, 2008

I am going to be going into how to get the current date & time with coldfusion, dont worry it is very simple to do and does not require anything special like a datasource.

Date
First we are going to be working with getting the date onto your page.

Step 1
First within your Application.cfm/.cfc we want to add the following cfset to get the date. If you wish you can add this to the same page as the output of the date but it is always nice to have an application file.

Quote:
<cfset TheDate = Now()>

Step 2
The following code mainly formats how the date gets displayed, the sample code below will output the date in the format of YYYY/MM/DD but you can easily turn this into: DD/MM/YYYY.

Quote:
<cfoutput>
#DateFormat(TheDate, ‘yyyy-mm-dd’)#
</cfoutput>

Time

Step 1
Just like the date we want to add the following code to detect what the current time is

Quote:
<cfset TheTime = Now()>

Step 2
Again same as the date we want to format the time in to something we can display and read on screen. There is something that is very different to the date and that is using capitol letters, when you have for example ‘HH’ instead of ‘hh’ for the hour to are saying to the coldfusion to use a 24 hour system with the hours. Below we have set the time to display in a 24 hour clock with HH:MM:SS you can take out the ‘SS’ if you do not wish to display the seconds.

Quote:
<cfoutput>
#TimeFormat(TheTime, ‘HH:mm:ss’)#
</cfoutput>

Thats it for time and dates