Haiti Earthquake Relief - http://www.brotherhaiti.com

I don’t usually post things that aren’t somehow geek related, but this is a special circumstance.

I urge everyone reading this to PLEASE go to Brother Haiti and read the content. A good friend of mine has a brother that has lost absolutely everything in the recent earthquakes in Haiti. If you are in a position to donate, that would be great. If you aren’t, then please just take a minute to consider yourself in their situation and react accordingly. Every little bit helps, guys… it doesn’t have to be $100 or $1000, even something as low as $20 or $50 would help out enormously. On behalf of my friend’s family, THANK YOU.

Flex 3 Dashboard with DYNAMIC XML CHARTS

Yes, you read that right! After much searching and reading, I have FINALLY figured out how to get the pie and bar charts in the Flex 3 Dashboard working with dynamically generated XML fed from a CFC. It took a while and I’m pretty proud of myself for getting it done! It works like a charm - the application reads the values from pre-compiled XML files to give the initial pie or bar chart values. When the page is loaded, it fires off a CFC which generates the drill-down data in XML (using CFXML) from the SQL Server 2000 instance on the web server. The XML files are created with CFXML and CFFILE, writing to a directory with nameconflict=”overwrite” specified. The Flex 3 Dashboard then goes to that directory and pulls the appropriate XML file needed to display the pie or bar chart drill down data. How does the Flex 3 Dashboard know which XML file to load, you ask? Well, I’m passing in the value of the pre-defined drill down XML file as an attribute of the original XML file loaded at run-time. It’s honestly not as hard as I thought it was going to be, but this is my first real application in Flex 3 and I’m pretty happy that it works.

I don’t think I can post the code, but I would be glad to help anyone that asks, if I can.

CFMAIL redux using CFC’s and a ColdFusion Custom Tag, part 2

I know I said I would post the code for this, but I’m not sure that I can… it’s pretty much a custom instance for each time I need to send mail, and it’s not something that is easy enough for one particular posting. I can tell you that I am now able to shortcut the CFMAIL operation by having a user enter in a string, check that string against a pre-defined value, and (depending on the value of the entered string) either let the user proceed and send the mail or prompt the user again for the correct string. So far, it works great and I haven’t had any complaints.

If anyone is interested, drop me a line and let me know and I’ll do what I can to get the code to you, along with some basic instructions.

CFMAIL redux using CFC’s and a ColdFusion Custom Tag

I’ve been working on a new project that will allow for a user to enter validation data before sending an email using CFMAIL. The main purpose of this is that the customer doesn’t want unsolicited email sent from the application without consent of the user. To do this, I put together a custom tag (cheekily called cf_mail) and a CFC that handles all of this by using CFWINDOW to prompt the user for the appropriate text (it must be a pre-defined string that the user must type in) and then passing this text to the CFC for validation. If successful, then it sends the mail under the users credentials. If unsuccessful, it sends the user back to the original email page and tells them to quit fudging around (basically).

I’ll post all the code for this later, in beautiful ColdFusion. Many thanks to a certain ColdFusion Jedi for helping me with this solution.

Free Flex Builder 3 Professional… if you’re unemployed

How cool is this? Go here and solemnly swear that you’re currently jobless, and you’ll get a free copy of Adobe Flex Builder 3 Professional.

ColdFusion cfgridupdate

From my previous post - working with cfgrid can be fun, and easy… except for when I try to do things without reading the documentation first. One such example was taking what I did before with the onChange calling the ActionScript getURL method and posting variables to a page. Getting these pages in the URL was easy, but getting them by FORM was much harder. After seeing how the form processes the information (a big, long, ugly string of characters with random form info embedded), I started to write a quick and dirty parser to get rid of all that crap I didn’t need. As I’m writing this, I happen to glance at the LiveDocs for cfgrid, and I see the cfgridupdate tag. I am literally on the last line of the parser I was writing. I copied the example for cfgridupdate, fit it around my existing code, and… it failed. Quick database tip: when wanting to use cfgridupdate, be sure that you have a primary key defined and you have keyOnly=”yes” specified in the cfgridupdate tag, otherwise bad things can and will happen. After changing this around, it worked like a charm!

Learn from my mistakes and ALWAYS read the LiveDocs or the CFWACK before attempting this at home.

ColdFusion 8 cfgrid getURL troubles…

Here’s something interesting I found out today while trying to get some code working. What I had was a cfgrid control, and I wanted to be able to access a URL using the onChange method of the cfgrid (or, whenever the cfgrid was clicked, a URL would load based on what was clicked - in this case, a part number).

My code for the onChange method in the cfgrid tag:
onChange=”getURL(gridName.dataProvider[gridName.selectedIndex]['PART']);”
And in the cfgridcolumn tag, which defined the part value:
<cfgridcolumn name=”part” header=”Part Number”>

Anyone see anything interesting? When I defined the selectedIndex of PART, I left it capitalized… and apparently, ColdFusion decided that it wanted to be case-sensitive in this case (excuse the pun).

ASDoc Index - styling Flash Forms for mortals

Take a look at this page for some goodness on how to style Flash Forms away from the ugly, generic templates they give us. I use the methods listed on this page regularly with all of my Flash Forms to great effect. I hope you do too, if you use Flash Forms generated by ColdFusion’s <cfform format=”flash”> tag.

Here are some general attributes that you can insert into a cfform also.

_global.styles.Accordion.setStyle(”backgroundColor”, 0xffffff);
_global.styles.Accordion.setStyle(”dropShadow”, “false”);
_global.styles.Accordion.setStyle(”color”, 0×000000);
_global.styles.Accordion.setStyle(”fillColors”, [0xC7D6EB, 0xffffff]);
_global.styles.Accordion.setStyle(”selectedFillColors”, [0x99B5DB, 0xffffff]);
_global.styles.Button.setStyle(”borderThickness”, 1);
_global.styles.Button.setStyle(”borderStyle”, “solid”);
_global.styles.Button.setStyle(”borderColor”, 0×000000);
_global.styles.Button.setStyle(”fillColors”, [0xC7D6EB, 0xffffff]);
_global.styles.CheckBox.setStyle(”fillColors”, [0xC7D6EB, 0xffffff]);
_global.styles.ComboBox.setStyle(”fillColors”, [0xC7D6EB, 0xffffff]);
_global.styles.ComboBox.setStyle(”rollOverColor”, 0xFFFFF4);
_global.styles.ComboBox.setStyle(”selectionColor”, 0xC7D6EB);
_global.styles.DataGrid.setStyle(”headerColors”, [0xC7D6EB, 0xffffff]);
_global.styles.DataGrid.setStyle(”alternatingRowColors”, [0xffffff, 0xF5F9FC]);
_global.styles.DataGrid.setStyle(”rollOverColor”, 0xFFFFF4);
_global.styles.DataGrid.setStyle(”selectionColor”, 0xC7D6EB);
_global.styles.Form.setStyle(”themeColor”, 0×5A88C5);
_global.styles.Form.setStyle(”color”, 0×000000);
_global.styles.HBox.setStyle(”backgroundColor”, 0xffffff);
_global.styles.HBox.setStyle(”marginTop”, 5);
_global.styles.HBox.setStyle(”marginBottom”, 5);
_global.styles.HBox.setStyle(”marginLeft”, 5);
_global.styles.List.setStyle(”rollOverColor”, 0xFFFFF4);
_global.styles.List.setStyle(”selectionColor”, 0xC7D6EB);
_global.styles.Panel.setStyle(”backgroundColor”, 0xffffff);
_global.styles.Panel.setStyle(”dropShadow”, “true”);
_global.styles.Panel.setStyle(”color”, 0×000000);
_global.styles.Panel.setStyle(”headerColors”, [0xC7D6EB, 0xffffff]);
_global.styles.RadioButton.setStyle(”fillColors”, [0xC7D6EB, 0xffffff]);
_global.styles.Submit.setStyle(”borderThickness”, 1);
_global.styles.Submit.setStyle(”borderStyle”, “solid”);
_global.styles.Submit.setStyle(”borderColor”, 0×000000);
_global.styles.Submit.setStyle(”fillColors”, [0xC7D6EB, 0xffffff]);
_global.styles.TextArea.setStyle(”fontSize”,10);
_global.styles.TextInput.setStyle(”fontSize”,9);
_global.styles.VBox.setStyle(”borderStyle”, “solid”);
_global.styles.VBox.setStyle(”borderColor”, 0×000000);

To put these in your form, just use the following code:
<cfformitem type=”script”>
_global.styles.VBox.setStyle(”borderStyle”, “solid”);
_global.styles.VBox.setStyle(”borderColor”, 0×000000);
</cfformitem>

Setting up a new website with CPanel X

cPanel X: Setting up a new website with cPanel X
Most times, a new website will get set up by someone judging from price alone. What I mean by that is that the web designer is usually the person that registers the domain name, sets up the DNS, and secures server space somewhere for the web site to live. The driving force for this is price. Think about it…when was the last time that you went to a site (with the exception of this one) and weren’t bombarded by ads about hosting? Personally, I find it hard to believe that EVERYONE out there has the lowest price and highest up time in the industry. There are a few good eggs out there, like the WebHostFreaks.com and HarborCityIT.com. Those are really the only ones that I have worked with in the past, and the only ones that I will work with in the future. If it ain’t broke, don’t fix it.

The main reason that I am with Harbor City IT is because of their awesome customer service. Sure, they have an incredibly powerful backend for all of the domain management as well. I have had brainstorm-multimedia.com hosted with them for over 3 years now, I think. Every other site that I’ve done (almost) has gone to the WebHostFreaks, mainly because they have superior technical know-how, and they also have the uber-cool cPanel X as a standard install. For those that don’t know, cPanel X is ‘just another domain admin tool’. For those that do know, go ahead and give a little giggle. cPanel X is so much more than your standard, off the shelf domain administration tool. The purpose of this tutorial is to explain the features that cPanel X has, how to use them, and how to get on with designing your new site.


cPanel X: Addon Domains
The Addon domains feature lets you host several websites from a single website account.

The difference between Addon domains and Parked domains is that Addon domains don’t have to be pointed at the root of the domain, they can be pointed anywhere inside of the main domain that you choose.

Say I have a domain called brainstorm-multimedia.com (which, incredibly, I do) and then I pointed brainstorm-tutorials.com at a folder called tutorials within brainstorm-multimedia.com. The path to brainstorm-tutorials.com would automagically become brainstorm-multimedia.com/tutorials.

To set up a new addon domain, enter the domain you are going to addon to the account into the first box without http://www. prefix. Be sure that you have registered the name properly first! Then enter the folder where the addon domain will point to (in the case of the example, it would be the /tutorials folder). This will also act as a ftp user name so the contents of this folder can be accessed and updated by someone else with out giving away the main account details.

In the Password box you define the password for the FTP account for this addon domain.


cPanel X: Agora Shopping Cart
Bundled with the cPanel is the incredibly cool Agora Shopping Cart tool that is free to use.

You can find more information about this shopping cart by going to Agora’s web site.

Agora’s has a full administration and user demo to experiment with for free. It is recommended that you do any testing on their servers, and only install the shopping carts on your account through cPanel when you are definitely going to use it.

According to cPanel: “As a courtesy to other users, we kindly ask that you do not click on the install shopping cart links unless you are planning to configure and use one of the shopping carts. The shopping carts utilize system resources and they will be automatically installed by clicking on the links below. Once installed, they can only be uninstalled from the backend by our technical support team.


cPanel X: Apache Handlers
Like the MIME handlers, this is just like adding your own file extension in Windows, only these files will get parsed/executed by the Apache server.

Examples of scripts that are parsed/executed by the server are Perl/CGI scripts and SHTML files.

A potential use:
If you had a web site that you moved from another host, the files would have the extention that the pages were written in. If the server ignored the files because it was an unrecognized file type, you could easily add the file extension in here to do the same job as HTML, and the site will work normally.


cPanel X: Backup
This section enables you to backup and restore your site files, databases and settings with the click of a button.

To backup your entire site:
If you want to download a home directory back up via your browser just click “Download a home directory Backup”.

If you want to back up your site but don’t have the connection speed to download it choose the “Generate/Download a Full Backup” option.

If you choose to “Generate/Download a Full Backup” you will be given some more options :
Backup and store the file in your webspace
Backup and store the file on another server - to use this option just enter all the ftp details for the other server and you will be emailed once it is completed.

To backup a database:
1. Click the name of the database you wish to backup
2. Choose to save the file
3. Select a location on your hard disk and click save
4. The backup file will start downloading. Note that it may take some time to download the backup depending on the size of your site and the speed of your internet connection.

To backup files in a subdomain seperately:
1. Click the name of the alias/filter you wish to backup
2. Choose to save the file
3. Select a location on your hard disk and click save
4. The backup file will start downloading. Note that it may take some time to download the backup depending on the size of your site and the speed of your internet connection.

To restore a backup:
1. Click the browse button under the correct section (Home, SQL DB or Alias/Filter) depending on the type of backup you are going to restore
2. Locate the backup file on your hard disk and click OK
3. Click the upload button and wait for the file to upload. Note that it may take some time to upload the backup depending on the size of the file and the speed of your internet connection.
4. A confirmation message will be displayed when the backup has been restored successfully.


cPanel X: Bulletin Board
Here you can install forums or BBs with the minimal amount of effort. What you can install from here depends entirely on your system administrator. For detailed information on the forum systems, visit the manufacturers of the products.


cPanel X: CGI Center
The CGI Center area allows you to use some pre-installed CGI scripts through CPanel. This section contains information about using these scripts, as well as using CGI scripts in general.

Simple CGI Wrapper
This is a CGI Wrapper that will allow you to run CGI Scripts with your User ID.

Random HTML
This is a Random HTML generator. It picks a string of HTML code from a list and inserts it in an SSI (Server Side Includes) enabled web page.

Simple GuestBook
This is a just a simple guestbook for your visitors to view and sign.

Advanced GuestBook
This is a more advanced guestbook written in PHP and MySQL.

Counter
You can create a counter to count and show how many visitors have been to your site.

Clock
This utility will create a real time java clock for your site.

Countdown
You can create a countdown box to countdown to a specified date.

CGI EMail
CGI Email takes the input of an HTML form and converts it to an email format defined by the author of the form.

FormMail Clone
FormMail-clone is a clone of Matt Wright’s FormMail.

Entropy Search
Setup Search Engine for your domain.

Entropy Banner
This feature allows you to create rotating banner ads for your site.


cPanel X: Change Password
Enter your existing password in the top box. Enter your new password in the the other two boxes. You have to enter it twice to verify that it’s actually the password you wanted.

When choosing a password, it is better to err on the side of caution. Pick a hard to think of password, preferably with somewhat confusing characters or punctuation. CPanel will not let you have too easy of a password, so you pretty much have to come up with something unique. Get creative!


cPanel X: Chatroom
The following Chat Rooms can be installed on your account:

CGI Chat
This is a CGI chat script written in Perl.

PhpMyChat Room
This is a PHP script that needs one MySQL database to itself for its files.

Java Chat
If you would prefer a java chat, just place the link below in any of your pages:
http://24-7dns.net/cgi-sys/mchat.cgi?channel=24-7dns.net


cPanel X: CRON Jobs
Cron jobs allow you to automate repetitive tasks on the server that hosts your web site. This is a powerful tool that allows you to take a hands-free approach to repetitive tasks. For example, you could add a cron job that automatically copies a MySQL database to a separate location on your site as a backup.

There are two different modes you can use to add a cron job:

Standard - Provides a range of pre-set options that you can choose. This is the simplest method and is recommended.

Advanced (Unix Style) - Provides the regular Unix style cron options. Recommended for users who are used to this method of entering cron entries.


cPanel X: Disk Usage
The Disk Usage Viewer enables you to see exactly how much disk space is being taken up by various parts of your web site. Several different viewing options are available:

Show Parent Directories - Displays the parent directories as individual items.

Show More Directory Depth - Displays directories one level deeper as individual items.

Show Less Directory Depth - Displays directories one level higher as individual items.

Show Top Level - Displays the top level of the web site.

Clear File Usage Cache - Deletes all file usage information from the cache and recalculates all disk usage information.

Show Small Files - Displays very small files.

Show File Size as bytes/Megabytes - Displays file sizes as bytes or megabytes. There are 1024 bytes to one megabyte.

Most of the above viewing options have a reverse option. For example, if Show Small Files is chosen, Hide Small Files is now displayed.

To use the Disk Usage Viewer:

Click on the Disk Usage button on the home page.

A list of items that take up space on your web site is now displayed, from largest to smallest. Click on the required buttons to view the use of space on your web site.


cPanel X: Error Log
The last 300 error messages that were on your site are displayed on this page in reverse order. Information includes the time of the error, IP address of the visitor that ’caused’ the error, and the URL that caused the error. This page is good for figuring out if something is wrong with your site like missing or broken files, and also to see if someone is trying to hack your account.


cPanel X: Error Pages
Error pages are displayed to Internet users when any one of a variety of errors occur, such as when a user enters an incorrect URL or is not authorized to access a specific directory in your web site. Companies often customize error pages to brand them with a specific corporate image and a link to their home page. You do not have to customize these pages - the error page is always available, whether customized or not.

Note: Custom error pages that are smaller than 10k in size will not display properly in Internet Explorer. Insert a large amount of text into a comment to create the required size.

To create or modify a customized error page:

Click on the Error pages button on the home page.

Click on the button of the required error page, such as the 403 button.

Enter the HTML code for the error page. You can use the buttons at the top of the page to insert variables into the displayed code.
Example:
<h1>404 Not Found</h1>
<p>The requested page, <!–#echo var=”REQUEST_URL” –> ,is not available.</p>

Click on the Save button.


cPanel X: File Manager
The File Manager allows you to manage your site through HTML, rather than an FTP tool or other third-party application. You can upload, create or delete files, organize files in folders, and change file permissions. While not as sophisticated as most FTP tools, File Manager is free and gives you all the basic functionality necessary to manage your site.

Note: All of the other topics in this section assume that you are already in File Manager.

To open and navigate in File Manager:

Click on the File Manager button on the home page.

Navigate by using the following: Open a folder by clicking on the folder icon.

Go up a level by clicking on the Up one level link.

Use the path links at the top of the window to move up and down the path.

Select a folder, so as to view or modify its properties, by clicking on the folder name link.


cPanel X: FrontPage Extensions
Frontpage Extensions allow you to publish your web site using Microsoft Frontpage. These extensions can occasionally become corrupted, so you can uninstall and then reinstall Frontpage Extensions whenever required.

To (re)install Frontpage Extensions:

Click on the Setup Frontpage Extensions button on the home page.

Click on the Install / Reinstall Extensions button.


cPanel X: FTP Manager
The FTP area deals with all the tools relating to setting up and managing FTP accounts, as well as managing FTP sessions. FTP (File Transfer Protocol) is a method by which you can transfer files between computers, usually using the Internet. There is a huge amount of information stored on FTP servers around the world that can only be accessed by using FTP. When using FTP you use an application called a “client” to connect to a machine called a “server”.

There are a large number of FTP software packages available. Some of them are built in to your browser (such as Internet Explorer), others are dedicated applications (such as such as CuteFTP or WS_FTP), while still others are built into web applications (File Manager in CPanel is one example). Generally speaking, if you are going to spend a lot of time using FTP or have a large amount of files to upload/download, a dedicated FTP client is the way to go.

CPanel allows you to set up FTP accounts so that certain external users can access a restricted part of your system. You can also set up an anonymous FTP account so that anyone can access a restricted part of your system. You can also manage these FTP sessions, cutting them off if they go on for too long.

Warning: FTP, by its very nature, allows external users to modify your web site (albeit a restricted area of your web site). External users can upload, download, and delete files. Keep this in mind when you set up an FTP account.


cPanel X: HotLink Protection
Hotlinking is when another web site owner links directly to one or more of your images or multimedia files and includes it on their web page. Not only is this theft of your intellectual property, you are paying for the bandwidth used by that site.

CPanel can prevent hotlinking by only allowing named sites (such as your own web site) to access files on your site.

To prevent hotlinking:

Click on the HotLink Protection button on the home page.

Enter any other addresses that you will allow to access your site other than the provided defaults in the central area.

Enter the protected extensions in the Extensions to allow field. Make sure you separate each extension with a comma.

Enter the address to redirect any hotlinking to in the Url to Redirect to field.

Click on the Allow direct requests tick box if you want to allow direct URL access to non-HTML files, such as images.

Click on the Activate button.


cPanel X: Index Manager
The Index Manager enables you to control how directories on your web site are displayed. If there is no index.html in a particular directory, the contents of the directory will be displayed to the browser. This is usually undesirable and can cause security issues. You can set the four different options for any directory through the Index Manager:

Default System Setting - Use the system setting for your hosting machine. This is set for all directories by default.

No Indexes - Do not use any indexes. Any browser that accesses this directory will see a list of all files in the directory.

Standard Indexing (text only) - Prevents browsers from viewing the contents of this directory. The browser receives a 403 (Forbidden) error. This option should be used for directories that do not contain image files.

Fancying Indexing (graphics) - Prevents browsers from viewing the contents of this directory. The browser receives a 403 (Forbidden) error. This option should be used for directories that do contain image files.

To change index settings for a directory:

Click on the Index Manager button on the home page.

Navigate to the folder that you want to alter and click on its name.

Click on the radio button next to the option that you want to use for this folder.

Click on the Save button.


cPanel X: IP Deny Manager
The IP Deny Manager enables you to block access to your web site from specific IP addresses. This is useful to remove nuisance surfers who use a large amount of bandwidth or to prevent hotlinking to your site (refer to HotLink Prevention for more information about hotlinking).

To add an IP address to the IP Deny Manager:

Click on the IP Deny Manager button on the home page.

Enter the IP address that you want to block in the IP Address field.

Click on the Add button.


cPanel X: Mail Manager
This page contains sections for Webmail, adding/removing email accounts, defining the default address, set up auto-responders, set up email blocks, forwarders, lists, setting up Spam Assassin, and modifying the MX entry. It is not meant to be all-inclusive, but only a rough guide to helping you get started in setting up your mail functions.

cPanel X: Webmail
You can read your online e-mail using NeoMail, Horde, or SquirrelMail if your web hosting account allows this. All of these popular web mail applications allow you to read your e-mail, save them, keep an address book, and perform all of the other basic e-mail functions that you are used to. The main difference between web mail and an offline e-mail applications, such as Eudora or Microsoft Outlook Express, is that all of these functions are performed online, rather than on your own computer, and offline applications generally provide more features.

Web mail is optional. You can still use your favorite offline e-mail applications, if you prefer. You can even use a combination of web mail applications and another tool - you can check your e-mail online, perhaps when you’re at work, and download your e-mail to your computer when you get home. You can automatically configure Outlook Express, or manually configure other mail applications to read your e-mail offline.

To read your e-mail online:
Click on the Web Mail link in the Mail area to access your default e-mail account, or click on the Add/Remove accounts link and click on the Read Webmail button next to the account that you want to read.
Note: You can also save this link as a bookmark, so that you can access it without having to use CPanel.
Click on the web application that you would like to use.
You are now in the web mail window for your default e-mail address. Please refer to the following topic links if you need more information about the web mail application you are using.

cPanel X: Add / Remove accounts
You can set up as many POP (Post Office Protocol) e-mail accounts as you require, up to the maximum limit set for your hosting account. Each one of these is in the standard e-mail formation of address@yourdomain.com. As with your default e-mail address, you can access these accounts through web mail or through your own offline e-mail application.

To add an e-mail account:

Click on the Add/Remove Accounts link in the Mail area.

Click on the Add Account link.

Enter the first part of the e-mail address and the password for the account in E-mail and Password fields.

Enter the maximum size limit of this mailbox in the Quota field, if required. The size limit is in megabytes. Not entering a number means that the mailbox size is only limited by the available disk space.

Click on the Create button.

Your new account has been added. Refer to Configuring Outlook Express to read e-mail if you want to use Outlook Express to read e-mail received by the new account.

cPanel X: Default Address
Any e-mail that is sent to an unknown account at your domain name, such as unknown@yourdomain.com, gets automatically rerouted to your default e-mail account. All web site accounts are automatically assigned a default e-mail address - user@yourdomain.com - which you can change, if required.

To set your default e-mail address:

Click on the Default Address link in the Mail area.

Click on the Set Default Address link.

Enter the complete e-mail address of the new default in the field next to your web site name drop-down list.

Note: You can enter :blackhole: to throw away all incoming mail, or :fail: no such address here to bounce the e-mail back to the sender.

Click on the Change button. Your new default e-mail address has now been set.

cPanel X: Auto-Responders
Autoresponders are e-mail messages that are sent automatically when an e-mail arrives for a specific e-mail account. Autoresponders are most commonly used for an “Out of Office” style message to inform your correspondents that you are not available, without you having to reply manually. You can have more than one autoresponder on one account. You can use plain text or include HTML code in the autoresponder, and choose from a wide variety of character sets.

To add an autoresponder:

Click on the Autoresponders link in the Mail area.

Click on the Add Autoresponder link.

Enter the address of the account that the autoresponder responds to in the Email field.

Enter your name or address in the From field. You do not have to put anything in this field.

Enter the subject line of the autoresponder in the Subject field.

Click on the required character set for this autoresponder from the Character Set drop-down list, if required.

Click on the HTML Message tick box if you want to include HTML code in the autoresponder.

Enter the autoresponder message in the Body field. You can not use HTML code in this field - plain text only.

Click on the Create button.

cPanel X: Block an E-mail
You can block an e-mail using spam filters. There are many definitions of spam, but one particularly useful one is the following:

Spam is the electronic version of junk mail, and has been around since the Internet was created. E-mail filters are a way of filtering your e-mail to remove unwanted mail based on a variety of criteria. You can block any sort of e-mail, not just mail of a commercial nature. Blocked mail can be deleted automatically or sent to another e-mail address or script. These filters are quite flexible - some examples are provided after the instruction on how to add a spam filter below. All filters are cumulative.

To add an e-mail filter:

Click on the E-mail Filtering link in the Mail area.

Click on the Add Filter link.

Click on the required header field in the first drop-down list. These are the various fields in any e-mail message.

Click on the required filter action in the second drop-down list. This action will act on the text entered in the third field. equals - match the text exactly (whole words only). “Credit” will block “Credit”.

matches regex - matches the text based on regular expression (regex) rules. Regular expressions are a powerful but complex area. You do not need to use regular expression filters for most circumstances. Refer to these two good introductory tutorials - Using Regular Expressions and Learning to Use Regular Expressions - for more information.

contains - match the specified text in any circumstance. “porn” will block “porn” and “pornography”.

begins with - match the specified text when it is the beginning of a word. “porn” will block “porn” and “pornography” but not “teenporn”.

Enter the filter text in the third field. This text is case sensitive.

Enter the destination for the filtered e-mail in the Destination field. There are three separate types of destination: Destroy the e-mail - Enter Discard in the field.

Redirect to another address - Enter the e-mail address to which to redirect the e-mail.

Redirect to a script - Enter the full script path on the machine that hosts your web site.

Click on the Activate button.

Example:
To redirect all e-mail from “broderick@hoser.net”, enter: From, equals, broderick@hoser.net, some other email address.
To delete all e-mail from hoser.net, enter: From, contains, hoser.net, Discard.
To delete all references to pornography, enter: Any Header, contains, porn, Discard.
To discard all e-mail that Spam Assassin has marked as spam, enter: SpamAssassin Spam Header, begins with, yes, Discard.

cPanel X: Forwarders
Forwards simply allow you to automatically forward e-mail sent to one account to another account. This is useful when you work at two separate locations, or have gone on holiday.

To forward mail from one account to two or more accounts, just add two or more forwards for the account that is being forwarded.

To add a forwarder:

Click on the Forwarders link in the Mail area.

Click on the Add Forwarder link.

Enter the first part of the e-mail address that will be forwarded in the first field.

Choose the required domain from the drop-down list.

Enter the full e-mail address that the forwarder will forward mail to in the second field.

Click on the Add Forwarder button.

cPanel X: Mailing Lists
Mailman is a popular mailing list script. Mailing lists are an ideal tool for communication between far-flung participants and can be about anything you want. Mailman allows you to set up a mailing list with a large number of configurable options, such as who is on the list, where mailing lists messages are sent, and whether you include welcoming messages to new subscribers.

The Mailman documentation, which is incorporated into its Administration panel, is clear and helpful, and should be referred to for all questions about using the script. The instructions in this section deal with how to set up, modify, and delete a Mailman mailing list from your CPanel. You can can also refer to the Mailman home page for more information.

Note: It is a good idea to be aware of spam and its definition before setting up a mailing list - refer to E-mail Filtering for more information.

To add a mailing list:

Click on the Mailing Lists link in the Mail area.

Click on the Add Mailing List link.

Enter the name of the mailing list in the List Name field, the password for the list in the Password field, and the domain it is for from the Domain drop-down list.

Click on the Create button. The list is created in the /usr/local/cpanel/3rdparty/mailman/lists folder.

cPanel X: Spam Assassin
Spam Assassin is a mail filter installed on a mail server used to identify spam. It checks for spam using a large number of pre-set rules that check the header, body, and sender of all e-mail messages sent to your domain mailbox.

To enable Spam Assassin:

Click on the Spam Assassin link in the Mail area.

Click on the Enable Spam Assassin button.

cPanel X: Modify Mail Exchanger (MX Entry)
CPanel manages your e-mail through its own mail server. However, by altering your MX (Mail Exchange Record) Entry you can point your e-mail to another mail server, if this is required.

Note: CPanel will not be able to manage your e-mail if you change your MX Entry setting. Do not change your MX Entry unless you know what you are doing.

To alter your MX Entry setting:

Click on the Modify Mail Exchanger (MX Entry) link in the Mail area.

Click on the Change an MX Entry link.

Enter the domain name of the new MX Entry in the available field.
Note: You can only change the entry to a domain name (e.g. yourdomain.com), not an IP (Internet Protocol) address.

Click on the Change button.


cPanel X: Manage OpenPGP Keys
OpenPGP is a tool for secure online communication. CPanel uses GnuPG for its public-key cryptography so that users may communicate securely. Each person gets a pair of keys, called the public key and the private key. Each person’s public key is published while the private key is kept secret. Messages are encrypted using the intended recipient’s public key and can only be decrypted using their private key.

General documentation and comprehensive user guides are available at the GNU Privacy Guard site.

To generate a public and private key:
Click on the Manage OpenPGP Keys button on the home page.
Click on the Add Key link.
Enter your name, e-mail address, and nickname in the Your Name, Your Email, and Comment/NickName fields.
Enter the password for the key in the Key Password field.
Enter the expiry date for the key in the Expiry Date field. You can suffix the entered number with the following:
y = year
m = month
w = week
d = day
Choose the size of the key that you want to generate in the Key Size field. 1024 bytes is a common size.
Click on the Generate Key button. Note that it may take a few minutes to generate the key, depending on its size.


cPanel X: MIME Types
This is just like adding your own file extension in windows.

For example:
If you have a piece of software that outputs a text file but doesn’t use the .txt extension, you can still store it on your web space without altering the extension, you just add the extension as a MIME type, copying the MIME information from the .txt one.

So if I had text files with the extension .bdb i would enter text/plain in the MIME type box and “bdb” in the extension box, and from now on the webserver will treat these files as text files, and open them in the browser window, instead of offering a download.


cPanel X: MySQL Databases
This section displays your current databases and the users assigned to each one. Below this are the options which control everything to do with your MySQL databases:

Creating a New Database
Simply enter the name of the database you wish to create and click the Add DB button. The DB name will be prefixed with your account username and an underscore so the full DB name will be username_dbname.

Creating a User
Simply enter a username and password and click the Add User button. The username will be prefixed with your account username and an underscore so the full DB username will be username_dbusername. You can create one user which you can add to all your databases or create a different user for each database which adds to security.

Add a User to a Database
You must create a user and add them to a database before that database can be used by, for example, a PHP script. Select the user from the first drop-down box and select the database from the second drop-down menu and click the Add User to Db button.

Access Hosts
If you wish a website on another domain to be able to access and use one of your databases, you can add the domain to allow access to in this section. Simply enter the domain name (without the www.) and click the Add Host button.

phpMyAdmin
You can use phpMyAdmin to administrate your MySQL databases in a web based environment.


cPanel X: Network Tools
Here you can use a couple of simple networking tools.

Domain Lookup
Performs a simple lookup of any domain name

Trace Route
Trace the route from the server to you.


cPanel X: Parked Domains
You can set up a domain name that you own to point to another domain name. This is known as “parking” a domain.

Example: You own the business.co.nz and innovation.co.nz domain names. You already have a web site for business.co.nz, but you do not want to create a new web site for innovation.co.nz at the moment. By parking innovation.co.nz on top of business.co.nz, all URL requests for innovation.co.nz will automatically go to business.co.nz instead.

To park a domain:

Click on the Parked Domains button on the home page.

Enter the name of the domain that you want to park in the New Domain Name field.

Click on the Add button.


cPanel X: Password Protect Directories
You can protect directories within your site from browsers by using a password to protect them. This allows you to restrict material to only authorized users or store sensitive material online. This has the same appearance and effect as the password protection on CPanel.

To password protect a directory:

Click on the Password protect directories button on the home page.

Navigate to the directory that you want to protect. Select a folder by clicking on the folder name link, or open a folder by clicking on the folder icon.

Click on the tick box next to the lock icon.

Enter the name that you want to appear in the Protected Resource Name field. This is optional and purely for the user’s benefit.

Click on the Save button. Generally, you now need to add at least one authorized user to enable access to the directory.


cPanel X: PostgreSQL Databases
This section displays your current databases and the users assigned to each one. Below this are the options which control everything to do with your postgre databases:

Creating a New Database
Simply enter the name of the database you wish to create and click the Add DB button. The DB name will be prefixed with your account username and an underscore so the full DB name will be username_dbname

Creating a User
Simply enter a username and password and click the Add User button. The username will be prefixed with your account username and an underscore so the full DB username will be username_dbusername

You can create one user which you can add to all your databases or create a different user for each database which adds to security.

Add a User to a Database
You must create a user and add them to a database before that database can be used by, for example, a PHP script.

Select the user from the first drop-down box and select the database from the second drop-down menu and click the Add User to Db button.

phpPgAdmin
You can use phpPgAdmin to administrate your Postgres databases in a web based environment.


cPanel X: Raw Access Logs
You can set the Raw Log Manager to archive this information every month and/or delete the previous month’s log at the end of every month. The following options are available:

Archive Logs in your home directory at the end of each month - Save the raw access logs in a compressed file in your home directory at the end of every month.

Remove the previous month’s archived logs from your home directory at the end of each month - Delete last month’s archived file at the end of each month.

To set the Raw Log Manager:

Click on the Raw Log Manager button on the home page.

Click on the required tick boxes to set the Raw Log Manager.

Click on the Save button.


cPanel X: Redirects
The Redirects area allows you to redirect Internet traffics from one web page to another. This is usually used when a web page has been moved to another location.

To set up a redirect:

Click on the Redirects button on the home page.

Enter the address of the web page to move in the first field.

Enter the redirection address in the second field.

Choose one of the following options in the drop-down list:
Temporary - This tells Internet traffic agents (browsers, search engines, etc.) that this is only a temporary redirection, and that they should return to this initial location again in the future for the same page.

Permanent - This tells the Internet traffic agents to go to the redirection address in the future, as the old address will never be used again.

Click on the Add button.


cPanel X: Scripts Library
This allows you to install a number of scripts with ease as they are already on the server all you have to do is click install.

The number of scripts and type of scripts available is entirely up to the server administrator, and will vary from server to server.

The only real way to find out what is available on your server is to take a look.


cPanel X: Search Engine Submit
CPanel allows you to submit your web site details to several search engines at one time. Some pointers on this process:

This is not a guaranteed way of becoming registered by these search engines, as some may charge a registering fee. It is always best to check each search engine site individually to see what their registration policy currently is.

It may take several weeks (4-8 weeks is common) before your web site will appear on a search engine.

Do not submit your site multiple times to the same search engine within a short period of time, as the search engine may ban you from its list.

To submit your site to one or more search engines:

Click on the Search Engine Submit button on the home page.

Click on the tick boxes next to the search engines that you want to submit to.

Enter the address of your site in the URL field and your contact e-mail address in the Email field.

Enter a short description of your site in the Comments field.

Enter the keywords of your site in the Keywords field. These are the handful (3-6) of words that are predominantly used by search engines to index your site. Separate each key word by a comma.

Choose the language of the site in the Language drop-down list and the country in which the site is located in the Country drop-down list.

Choose the category that your web site best fits into from the Category drop-down list.

Click on the Submit button.


cPanel X: SSH/Shell Access
This is shell access to the server.

For security reasons, shell access is not enabled by default. In order to activate shell access on your account, you will have to contact your server administrator.

Please Note: This feature will not work if you are accessing your control panel with your IP address. Make sure your browser reads http://domain.com:2082/frontend/… and not http://IP_ADDRESS:2082/frontend/…


cPanel X: Subdomain Stats

You can view statistics specifically for each subdomain using the Analog and Webalizer tools.

To view subdomain statistics:

Click on the Subdomain Stats button on the home page.

View the statistics as required.


cPanel X: Subdomains
Subdomains are a way of creating separate accounts within your master account, which are accessed as separate URLs. For example, you could set up a “timber” subdomain on your master account “hardware.org.mart”, which would be accessed as “timber.hardware.org.mart”. A lot of larger businesses use subdomains to establish branding and focus on separate product lines, because a subdomain creates a separate URL and web presence. However, you do not create a new CPanel when you create a subdomain. You still perform most administration functions for the subdomain through your master CPanel.

Practically, a subdomain is a sub folder within the public_http level of your account that has it’s own cgi-bin directory. The “timber” example above creates a new top-level folder called timber, with a cgi-bin sub-folder. Upload your files for the subdomain to this location, including a separate home file (such as index.htm).

Currently you cannot create e-mail accounts with the subdomain extension. A workaround for this is to create an account called “sales-timber@hardware.org.mart”, or similar.

To add a subdomain:

Click on the Subdomains button on the home page.
Note: You can only successfully create a new subdomain once your DNS number has successfully propagated for this account.

Enter the text for the new subdomain in the field in the available field. You must conform to domain name conventions for the addition to the name.

Click on the Add button. A folder with the same name as the subdomain has now been added to your public_html folder, with a cgi-bin sub-folder (if CGI scripts are enabled on your account).


cPanel X: Web/FTP Stats
The Web / FTP Statistics area presents you with a wide variety of information about your web site, from the latest visitors to a detailed monthly summary of hits, as well as providing an error log. Use the Statistics tools to keep track of what pages are being visited most often, and where they are being referred from.


cPanel X: Webmail
This is the easiest page on the site. All you do is click on the email client that you want to use, enter your username and password (if required), and you’re done! Thank CPanel for making it so easy on you.

Fireworks MX Drop Down Menu Tutorial

Fireworks MX Drop Down Menu Tutorial

In the course of working at my new job, I have become fairly accustomed to Fireworks MX. I used to think that it was a far cry from the power of other graphics programs like Photoshop or Quark. It really isn’t. What I like most about Fireworks MX is simple - almost everything that you need or want to know about an image can be found from a simple right-click on the canvas (not on the picture, on the gray part). The main thing that I used it for was to create transparent GIF page headers, and also for their pretty cool drop down menus. The trouble with the drop-down menus was that I couldn’t find a resource to explain what all that generated Javascript meant. See, when Fireworks makes a drop down menu…tell you what, let’s step through how to make a drop down menu and I’ll explain it as we go.

Step one in any tutorial - make sure that you have the program that the tutorial is about. For those of you that don’t (I can’t imagine that you wouldn’t have it, but still…), skip over to Adobe’s site and download it.

Start it up and open a new document. Remember that we’re doing a menu, so it doesn’t need to be huge. We’ll make this a horizontal menu, so set the width at 750 pixels and the height at 50 pixels. For most 800×600 resolution monitors, this will fit quite nicely. For monitors bigger than that, we can set it to center on the web page later.

Okay, now we’ve got a blank canvas. Make sure you have the Layers window open (if you don’t, press F2 and it will pop up). It’s probably safe to assume that you want to have a line of text open up the drop down menu, so we’ll do that first. Click on the ‘A’ on the Toolbar (the Text tool) and type what you want the main menu will say. I spaced it out with just text and then inserted Rectangular Hotspots over the text.

Okay, we’ve set up our text and hotspots. Now click on one of the hotspots and go up to the “Modify” tab on the top menu. Select “Pop-up Menu” and then “Add Pop-up Menu…” from inside the menu. This brings up the Pop-Up Menu Editor, where all of the customizing will take place.

The first tab says “Content”, this is where the visible text goes, as well as the href links and the target. For Text, I entered ’submenu1′, Link is http://www.brainstorm-multimedia.com, and the Target is ‘_blank’. This means that the user will see the text ’submenu1′, and when they click it, it will open up a new browser page that points to http://www.brainstorm-multimedia.com.

It is interesting to point out an additional note here…when you add more than 1 menu item, a little icon at the top of the Editor becomes enabled that allows for a menu to be indented. This allows a sub-submenu to be created. Nifty, eh?

After you fill in the areas on the Content tab, click on the Appearance tab. This is where the rubber meets the road. I chose the following options, but you are free to choose what you want to:
Cells: Image, Vertical Menu
Font: Verdana, Arial, Helvetica, sans-serif
Size: 18
Left Indented

Up state:
Text: #FFFFFF
Cell: #000000
Style: the one on the top left, like a button…

Over State:
Text: #000000
Cell: #FFFFFF
Style: again, the one on the top left

So that set us up a pretty generic looking menu. Like I said, do what you want to with the colors and stuff, it’s all yours.

When you’re done there, click on the ‘Advanced’ tab. This is where you can choose various layout options, and have the Editor show you the changes as you make them. I kept the Cell Width and Cell Height at Automatic; the reason for this is because it will ‘grow’ to the size of the biggest menu item. Cell Padding is at 3, Cell Spacing is at 0, Text Indent is at 0, and Menu Delay is set to 500ms. I still have Show Borders enabled with a Shadow of #FFFFFF.

After you’re done with the layout, click on the Position tab. This allows you to set where you want the menu to come out, but we’re going to change that in just a second. I clicked on the second one from the right, with the submenu slightly offset from the main menu. If you selected to have sub-submenus, you can choose the position of those here as well. When you choose what you want, click on Done and see what you’ve created!

When you click Done, you should a blue set of squares, depending on the number of submenus you opted to create. Click on the submenu and drag it underneath the first menu, wherever you want it to be. I always like it to be directly underneath and centered. And that’s just about it. The rest of the menus are made exactly the same way as this one was created. After you create all the menus, all that is left is to export it by going to File -> Export (HTML and Images should be selected) and choosing a name for the menu.

JavaScript

JavaScript Overview

I love JavaScript. Seriously. I’m glad that it has finally come into it’s own as an integral part of AJAX, and Spry (for you ColdFusion users out there). There are lots of uses for JavaScript in real world web applications, for many reasons: it’s clean, neat (as neat as the programmer, anyway), fast, and convenient. Granted, there is a bit of a learning curve to JavaScript, but you kind of have to expect that.

Basic JavaScript 101

Here is how you do basic stuff in JavaScript.

New content, anyone?

Well, here’s how it’s going… I’m slowly and surely converting everything over from the old Brainstorm site that is worth keeping. Those of you that have been here a while know better than I do that there was a lot of stuff on the old Brainstorm site that won’t make it to this site. In it’s place, I’ve decided that I need to post daily updates to cool things that I’m working on - whether it’s code, music, or whatever.

The first bit that I’m working on is the cPanel info guide. That’s a popular one. Also, the CuteFTP stuff, the Fireworks menu stuff, and the rest of the JavaScript stuff continue to be fairly popular, so I’ll be adding those as well.

As always - anything particular you’re looking for, just let me know and I’ll try my best to help you out.

Watch this space!

Editing Google Maps using JavaScript

I just finished a rather tough piece of JavaScript for a new customer. Let me explain what they wanted… they had a map made from the Google API. I didn’t know it, but these maps are generated basically by a giant <script> dynamically. On this map, there were a number of companies that my customer does business with. Well, inevitably, one of the companies went out of business, so they wanted to have the company removed from the Google Map.

Originally, the code looked like this:

<script type=”text/javascript”>
//<![CDATA[
var i = 0;
var gmarkers = [];
var mtypes = [];
var map;

function toggleset(obj, mtype) {
var j;
for(j=0;j<i;j++) {
if(mtypes[j]==mtype) {
if(obj.checked) {
map.addOverlay(gmarkers[j]);
} else {
map.removeOverlay(gmarkers[j]);
}
}
}
}

function load() {
if (GBrowserIsCompatible()) {
function createMarker(point, title, details, icontype, typeid) {
var marker = new GMarker(point);
GEvent.addListener(marker, “click”, function() {
marker.openInfoWindowHtml(”<div style=’color: black; width: 250px; overflow: auto;’><b>” + title + “</b><br>” + details + “</div>”);
});

gmarkers[i] = marker;
mtypes[i] = typeid;
i++;
return marker;
}

map = new GMap2(document.getElementById(”map”));
map.addControl(new GLargeMapControl());
map.addControl(new GMapTypeControl());
map.addControl(new GScaleControl());
map.setCenter(new GLatLng(29.78, -98.08), 10);
map.setMapType(G_HYBRID_TYPE);
var icon = new GIcon();
var HQicon = new GIcon();
var UNIVicon = new GIcon();
var TOP10icon = new GIcon();

GDownloadUrl(”index.php?module=base&page=mapdata”, function(data, responseCode) {
var xml = GXml.parse(data);
var markers = xml.documentElement.getElementsByTagName(”marker”);
for (var i = 0; i < markers.length; i++) {
var point = new GLatLng(parseFloat(markers[i].getAttribute(”lat”)),
parseFloat(markers[i].getAttribute(”lng”)));
map.addOverlay(createMarker(point,
markers[i].getAttribute(”title”),
markers[i].getAttribute(”details”),
markers[i].getAttribute(”icontype”),
markers[i].getAttribute(”typeid”)));
}
});
}
}
//]]>
</script>

Geez, that’s ugly! Well, after going through it a bit, I saw the line

markers[i].getAttribute(”title”)

and thought, “hmmm… I wonder if I can capture the name of the company and shortcut it before the marker is set?”

With that, I got working on this JavaScript. I was tearing it apart and alerting everything I could. I finally wrapped it in with a quick conditional, and what do you know - it worked first time. Gotta love it when a plan comes together!

Here’s how I did it…

I changed the section

for (var i = 0; i < markers.length; i++) {
var point = new GLatLng(parseFloat(markers[i].getAttribute(”lat”)),
parseFloat(markers[i].getAttribute(”lng”)));
map.addOverlay(createMarker(point,
markers[i].getAttribute(”title”),
markers[i].getAttribute(”details”),
markers[i].getAttribute(”icontype”),
markers[i].getAttribute(”typeid”)));
}

so that it would look like

for (var i = 0; i < markers.length; i++) {
if(markers[i].getAttribute(”title”)!== ‘Name of the company goes here’) {
var point = new GLatLng(parseFloat(markers[i].getAttribute(”lat”)),
parseFloat(markers[i].getAttribute(”lng”)));
map.addOverlay(createMarker(point,
markers[i].getAttribute(”title”),
markers[i].getAttribute(”details”),
markers[i].getAttribute(”icontype”),
markers[i].getAttribute(”typeid”)));
}
}

All it took was that one conditional statement. I’m still excited about this! With this, you can now programmatically add or remove points on a Google Map simply by searching for the markers[i].getAttribute(”title”) attribute and acting accordingly.

Setting Up

Please bear with me while I get brainstorm-multimedia.com set up again! I promise, within a week or so, it will be better than ever AND have a lot more content on it.

I switched hosts away from my old place (I’ll never go there again), so now I am EXCLUSIVELY promoting my current host, HarborCityIT.com, for ALL new website development.

I’ve been wanting to tear down the old site for a long time anyway, so this just gave me a good reason to go ahead and turn this into a blog for me. I’ve got a lot of content from the old site that I’ll get around to putting up, plus I’ll be able to put up a lot more content now that HarborCityIT.com has graciously doubled just about everything in my hosting package - except my price. Gotta love that.

Something you want to see - a tutorial, perhaps? Just drop me a line at bradley [at] brainstorm-multimedia [dot] com. I am fairly competent in PHP/MySQL, ColdFusion, Spry, SQL Server, and JavaScript.

I’ll try to add something every day… and if not, well I’m sure that life WILL go on!