Use your provided client login information to view files for your project.
Login:

Blue Ember Design

Web Design Blog

Sharing thoughts, opinions, and strategies for building an effective web presence and a profitable online marketing campaign.

FTP Download with the CodeIgniter FTP Library

Topic: CodeIgniter

I was recently working on a project that involved FTP and I thought it would be a great chance to get away from the built-in PHP functionality and use the CodeIgniter FTP library instead.

I was pretty surprised to find that there was no download functionality in the base FTP library as of CI 1.7.2.  I’ve extended the library to incorporate file download and will share that here.

<?php
// This codes goes in the 'application/libraries' folder with a
// file name of MY_Ftp.php
 
class MY_Ftp extends CI_Ftp {
 
	/**
	 * Constructor
	 **/
	function MY_Ftp() {
		parent::CI_Ftp();
	}
 
	/**
	 * Download a file from a FTP server
	 * @param	<string>	$rem_path	Remote path of the file to download
	 * @param	<string>	$loc_path	Local path destination for download
	 * @param	<string>	$mode		Transfer mode, defaults to auto
	 **/
	function download($rem_path, $loc_path, $mode='auto') {
		// check for an active connection
		if ( ! $this->_is_conn()) {
			return FALSE;
		}
 
		// get remote folder/filename
		$rem_folder   = dirname($rem_path);
		$rem_filename = basename($rem_path);
 
		// if a local directory was passed handle differently.
		// Otherwise, treat same as remote.
		if (@is_dir($loc_path)) {
			$loc_folder   = rtrim($loc_path, '/');
			$loc_filename = $rem_filename;
		}
		else {
			$loc_folder   = dirname($loc_path);
			$loc_filename = basename($loc_path);
		}
 
		// check that the loc path exists
		if ( $loc_folder != '.'  && ! @is_dir($loc_folder)) {
			$this->_error('ftp_bad_loc_path');
			return FALSE;
		}
		// check that loc path and file are writable
		elseif ( ! @is_writable($loc_folder) OR (file_exists($loc_folder.'/'.$loc_filename) && ! @is_writable($loc_folder.'/'.$loc_filename))) {
			$this->_error('ftp_loc_not_write');
			return FALSE;
		}
 
		// store old paths
		$old_rem_path = @ftp_pwd($this->conn_id);
		$old_loc_path = getcwd();
 
		// move to the local path
		if ( ! @chdir($loc_folder)) {
			$this->_error('ftp_bad_loc_path');
			return FALSE;
		}
 
		// move to the remote path
		if ( $rem_folder != '.' && ! $this->changedir($rem_folder)) {
			$this->_error('ftp_bad_rem_path');
			return FALSE;
		}
 
		// check that the file exists remotely
		$found_file = FALSE;
		$files = $this->list_files();
		if (count($files) > 0) {
			foreach ($files as $f) {
				if ($f == $rem_filename) {
					$found_file = TRUE;
					break;
				}
			}
		}
 
		if ( ! $found_file) {
			$this->_error('ftp_bad_rem_file');
			return FALSE;
		}
 
		// Set the mode if not specified
		if ($mode == 'auto') {
			// Get the file extension so we can set the upload type
			$ext = $this->_getext($rem_path);
			$mode = $this->_settype($ext);
		}
 
		$mode = ($mode == 'ascii') ? FTP_ASCII : FTP_BINARY;
 
		// download the file
		$result = @ftp_get($this->conn_id, $loc_folder.'/'.$loc_filename, $rem_filename, $mode);
 
		if ($result === FALSE) {
			if ($this->debug == TRUE)
				$this->_error('ftp_unable_to_download');
 
			return FALSE;
		}
 
		// move back to the root path
		$this->changedir($old_rem_path);
		@chdir($old_loc_path);
 
		return TRUE;
	}
 
}
 
?>

As a side note, you will need to tweak your language file to include all of the message codes (e.g., ftp_bad_loc_path) passed to _error() for proper error display in your app.

Site Launch: Vital Life Wellness Center

Topic: Site Launches

We are excited to announce a recent website relaunch for one of our clients, Vital Life Wellness Center.

With a desire to join the blogging community and share her passion for healthy living, Blue Ember provided Dr. Andrea Pritchett with a custom Wordpress template.  During the entire design process we paid extra care to matching Vital Life’s existing branding, while lightening it up a bit with a fresh, updated look.

Stop by the new blog and join the conversation as Dr. Pritchett helps to “maximize your life and increase your vitality”.

BEFORE

AFTER

Tab Key Skipping Drop-downs in Firefox on OSX

Topic: Apple, Software

I’ve been a Mac user for just about a year now (couldn’t ever go back), but I’ve noticed an annoying little “feature” within Firefox that I was never able to resolve until recently.  While tabbing through form fields, drop-downs are skipped and require switching to the mouse to set a value.

Turns out the issue is pretty simple to resolve.  Go to System Preferences, then select Keyboard.  On the bottom of the window there is a section titled ‘Full Keyboard Access’ (as pictured below).

Simply change the option to ‘All controls’ instead of the default.  This will allow you to tab between all elements on the page.  In addition to drop-downs, you will now be able to focus on links as well.

Tip: The keyboard shortcut Control +F7 will toggle this setting if you prefer to enable/disable it quickly.

A big nod goes to howtogeek.com for this fix.

4 Reasons Open Source Email Marketing Sucks


We’ve tried quite a few open source email marketing solutions from Mailman, to PHPMailer, to poMMo and they all suck for one reason or another.  Here are our reasons why:

1. They are self hosted solutions
In our experience, self hosting email marketing rarely works out well. Most hosting providers have tight limits on how many emails can be sent per hour from a given domain.  A somewhat average limit of 300 emails/hour implies that it would take 16 hours and 40 minutes to email a list of 5,000 addresses.  While that could be acceptable in certain circumstances, it is less than ideal for a big marketing push or product launch.  Hit 10,000+ addresses and you are talking in days, not hours.  No good for us or our clients!

2. They have clunky and non-intuitive interfaces
We’re BIG supporters of open source software, but have yet to see an open source email marketing tool that has been as slick as the likes of Campaign Monitor or MailChimp.  When passing off open source software to a client, pray they are somewhat technology proficient or you have a support nightmare on your hands.  The best client interface we’ve seen to date is poMMo, but it still leaves much to be desired.

3. They lack crucial features for professional use
To be usable by a business with any sizable email address list, an email marketing tool has a few “must-have” features:

  • Email throttling
  • Intuitive and simple administration interface
  • Elegant WYSIWYG email editor (with the ability hand-edit HTML if necessary)
  • Automated bounce handling
  • Comprehensive analytical tools to measure campaign success

4. There is no strong community
Unlike many other great open source projects, we’ve found much to be desired in the communities for the top open source email solutions.  This makes support and bug fixes a disaster zone.

You tell us…
Have you found any great open source email marketing tools that we have missed? Disagree? Let us hear from you…

2 Comments

PPC or SEO: Which is Best for My Company?

Many companies, especially in the current tough economy, are looking at their marketing budgets and are asking a very important question: “Where can we spend our marketing dollars and make the largest impact?”

When making this decision it’s important to consider that both PPC advertising and SEO have their merits. At the same time, they also have dissimilar levels of commitment (both in time and money) and use entirely different methods for determining their success. We’ll look into those differences here in an effort to help in the decision-making process.

Pay Per Click Advertising

Advertising online is an easy and quick way to drive traffic to a website. If executed correctly, traffic will arrive on highly targeted keywords and improve sales conversion rates. As long as the advertising bills are paid, website traffic should stay at its elevated level. However, stop paying and they’ll cut traffic just as fast as it started.

So what does this mean for a company? It means that pay per click advertising is a great way to instantly generate new traffic. As long as the campaign is active, the traffic will flow. This model makes cost per click (CPC) a perfect way to determine the return on investment (ROI) because of its distinct start/stop times and set number of marketing dollars spent.

Unlike pay per click advertising, these lines are not so clear with a search engine optimization campaign.

Search Engine Optimization

In most cases, it’s accurate to say that an SEO marketing campaign with a high quality search engine optimization company will result in a lower CPC than a pay per click advertising campaign. Here’s why:

Unlike pay per click advertising, search engine optimization is a lasting investment into the quality and success of a company’s website. There is no clear end to when an SEO campaign stops being effective. A 12-month campaign with an SEO professional that is halted due to budget issues will continue to exhibit improved results well after the work has entirely stopped. Depending on the industry, the competition, and the quality of the SEO, improved results could last for weeks or even potentially years. Because of the indefinite end to its results, cost per click is not an adequate way to determine the return on investment of an SEO campaign.

If the results are so long-lasting, why isn’t everyone going with SEO? Largely because there is a minimum required commitment to search engine optimization. A campaign can take weeks or months to start showing improved results and even more importantly will require patience, diligence and time to build into a highly successful campaign. If either time or money are limited, it’s likely that a pay per click advertising campaign is going to be the best short-term choice.

So Which is Right For My Company?

After reading this article, it should hopefully be clear that there are some core differences between how pay per click advertising and search engine optimization work and how their results should be quantified. Pay per click advertising campaigns have a hard start and end date, immediately drive targeted traffic, and have a simple formula to determine their ROI. Meanwhile, an SEO campaign may take longer to put into place at a higher initial cost, but the results will long outlast those of PPC advertising.

Want more information or need help? Blue Ember Design can build a quality Search Engine Optimization or PPC Advertising campaign for your company.

1 Comment

Client Testimonial

"I am very pleased to recommend Garrett St John of Blue Ember. Over the past year Garrett has done a wonderful job enhancing the Valley Pregnancy Center's ability to reach our target audience through our web site. He is incredibly knowledgeable in his field of expertise, available to assist in any way he can and has been honorable in all of his dealings with us. I recommend him without hesitation."

Barbara Saba

Valley Pregnancy Center

Subscribe

Stay up-to-date with our latest postings without having to check the site.