Website Design Blog

April 22, 2010

When I am working on a website I have a local development version that I program and test locally. When an update is implemented, it is tested locally before it is copied to the live server. Wordpress sites are treated no differently. Here is how you can make the wp-config.php portable to work in your live and local environment. Simply replace the variables below with the actual information for your web site and you will be have a wp-config.php that can happily thrive in both environments.

I defined an additional constant ‘LIVE’ that I can refer to elsewhere in my code to determine if I am on the live server or not.

wp-config.php


if($_SERVER['HTTP_HOST']==’livedomain.com’ || $_SERVER['HTTP_HOST']==’www.livedomain.com’){

define(‘DB_NAME’, ‘db_name_live’); // The name of the database
define(‘DB_USER’, ‘mysql_username_live’); // Your MySQL username
define(‘DB_PASSWORD’, ‘mysql_password_live’); // …and password
define(‘DB_HOST’, ‘localhost’); // db host
define(‘DB_CHARSET’, ‘utf8′);
define(‘DB_COLLATE’, ”);
define(‘AUTH_KEY’, ‘put your unique phrase here’);
define(‘SECURE_AUTH_KEY’, ‘put your unique phrase here’);
define(‘LOGGED_IN_KEY’, ‘put your unique phrase here’);
define(‘LIVE’, true);

}else{

define(‘DB_NAME’, ‘name_of_db_local’); // The name of the database
define(‘DB_USER’, ‘mysql_username_local’); // Your MySQL username
define(‘DB_PASSWORD’, ‘mysql_password_local’); // …and password
define(‘DB_HOST’, ‘localhost’); // db host
define(‘DB_CHARSET’, ‘utf8′);
define(‘DB_COLLATE’, ”);
define(‘AUTH_KEY’, ‘put your unique phrase here’);
define(‘SECURE_AUTH_KEY’, ‘put your unique phrase here’);
define(‘LOGGED_IN_KEY’, ‘put your unique phrase here’);
define(‘LIVE’, false);

}

// You can have multiple installations in one database if you give each a unique prefix
$table_prefix = ‘wp_’; // Only numbers, letters, and underscores please!

// Change this to localize WordPress. A corresponding MO file for the
// chosen language must be installed to wp-content/languages.
// For example, install de.mo to wp-content/languages and set WPLANG to ‘de’
// to enable German language support.
define (‘WPLANG’, ”);

/* That’s all, stop editing! Happy blogging. */

if ( !defined(‘ABSPATH’) )
define(‘ABSPATH’, dirname(__FILE__) . ‘/’);
require_once(ABSPATH . ‘wp-settings.php’);
?>

MySQL Queries

Another thing to be conscious of when moving between a live and local server environment with Wordpress are couple of records in the wp_options table of the database. The siteurl and liveurl records will be different in your local environment and live environment. If you copy your database from one to the other, just run the appropriate query below (with the liveurl and localurl variables changed to your actual data) depending on if you are copying from local to live or live to local.

Live to Local Query

Run query on local database.

UPDATE wp_options SET option_value=’http://localurl.com’ WHERE option_name=’siteurl’ ;

UPDATE wp_options SET option_value=’http://localurl.com’ WHERE option_name=’home’

Local to Live Query

Run query on live database.

UPDATE wp_options SET option_value=’http://liveurl.com‘ WHERE option_name=’siteurl’ ;

UPDATE wp_options SET option_value=’http://liveurl.com’ WHERE option_name=’home’

If you have any questions or suggestions, your comments are welcome below.

  • Share/Bookmark
April 14, 2010

If you do a lot of Emailing back in forth as I often do, you may want to try Google Wave.Tim the Enchanter Google Wave is still an invitation-only beta (Gmail was an invitation-only beta from 2004-2007 years before being released to the public), so you will need an invite to start using it. I have about 10 invites left, so you can drop me a note and I will send you one if you are interested in trying it and promise to post something nice in my wave. Google Wave is hard to describe as I am quite a wave newbie myself. It is an amalgamation of Email, chat, bulletin board, shared document and a live meeting.

Google WaveSince wave is currently the bleeding edge of technology, you will need a couple things besides an invite to make your web browser Wave ready. First of all I recommend using Firefox, so if you don’t have that web browser go ahead and install it. Next go install gears. Ok you should be all set! Now go visit my wave and try it out.

You will probably need to watch some of the videos and read the instructions at wave.google.com/about.html. If you have other resources and links, please share them in my wave. I am still a little perplexed by it all myself, but see some potential here. Who knows, maybe this thing will be really useful when it gets out of beta in 2013.

Thanks blog.zenika.com for sorting out the details.

  • Share/Bookmark
April 12, 2010

I am looking forward to the launch of Adobe CS5. Although I have never been an early adopter of major software releases, preferring to read others feedback and take my time to understand the benefit of new features before shelling out hundreds of dollars, this release has my attention.

Adobe Flash CS5
I just got through watching a sneak peak of Flash CS5 at gotoAndLearn.com and it looks like Adobe is hitting the suite spot when it comes to what developers are looking for.

Text handling and fonts have always been a weak point when working in Flash. I am impressed with the features in CS5 that address text flow, better multi-lingual character support and the new font palette.

Flash has established itself as the most popular video streaming platform on the web today. Being able to scrub the video on the stage and add ActionScript cuepoints will be extremely useful timesavers.

Flash’s real power lies in it’s powerful ActionScript programming language that gives developers the freedom to shape the user experience without limits. Code snippets and a host of new features make it easier for programmers to control Flash using ActionScript. The XML-based source files are interesting too. From what I can tell at this early stage it looks like Flash is opening up their traditionally closed, complied SWF files for developers to be able to edit it’s properties and library items on the fly. Not only will this help with using version control, but also unlocks some interesting possibilities with custom content management systems.

The most hype about this release is centered around it’s wide distribution feature. In a nutshell, Adobe wants to allow a project created in Flash to be deployable across any platform (web, desktop, mobile, tablet). Ahead of this release Apple has announced it will not support applications developed using 3rd party (Adobe) software on the operating system running their widely popular iPhones, iTouches and iPads. This latest plot twist in the friction between Apple and Adobe definitely puts a crimp into this feature. However even without the Apple devices this feature will make it easier for developers to port their applications created in Flash to other popular mobile devices running Google’s Android, Windows and others.

I am much more excited about the release of Adobe’s CS5 than I was for the launch of the iPad. This one looks like it might actually be worthy of the hype.

  • Share/Bookmark
March 3, 2010

I posted photos from the Big Boy EXPO in Estero, Florida on Flickr and FaceBook.

View them on FaceBook

View them on Flickr

  • Share/Bookmark
February 15, 2010

Big Boy ShowI think everyone involved would agree the show was major a success this year. It was a pleasure participating this year and meeting so many of you at the show. I really was impressed at the number of activities and attractions, the amount of visitors and the quality of the exhibitors. If I didn’t get a chance to talk to you at the show please drop me a line and we can talk about your experience at the show. See you in Charlotte in September and back at Germain in October!

  • Share/Bookmark
February 10, 2010

Accepting Payment OnlineThere are multiple options when accepting payment online. This post will focus on 3 of the most popular payment methods: PayPal, Authorize.net, Google Checkout and the possibilities that exist for using all 3.


PayPal offers 3 methods to use their service to accept payment online: Express Checkout, Website Payments Standard and Website Payments Pro.

PayPal Express Checkout

PayPal Express Checkout allows visitors to pay using their PayPal account. The visitor must have a PayPal account to use Express checkout. This option will be chosen by a visitor who is comfortable using PayPal versus entering their credit card information. If you have Website Payments Pro or Website Payments Standard integrated it is required to offer Express Checkout as a payment option. PayPal Express Checkout may also be offered in addition to Authorize.net, Google Checkout or any other merchant service you may use.

PayPal Website Payments Standard

When a customer pays using website Payments Standard they temporarily leave your web site and go to PayPal to enter their credit card information. This process is relatively painless but may not be ideal depending on your situation. The benefits of using PayPal Website Payments Standard include: easy set up, no monthly fee and a SSL (Secure Socket Layer) is not required on your site since the actual shopping cart and checkout page is hosted on PayPal and not your web site.

PayPal Website Payments Pro

PayPal Website Payments Pro is PayPal’s merchant service that allows you to accept credit cards directly on your site. The funds from the transaction will go to your PayPal account. As with most merchant accounts there is a monthly fee associated with Website Payments Pro (currently $30.). PayPal Express Checkout must be included as a payment option with PayPal Website Payments Pro.

Authorize.net
Authorize.net provides a payment gateway for you to accept credit cards directly on your web site. The benefits of Authorize.net include low cost and direct integration using a trusted merchant service provider. Authorize.net can be used to process credit cards in addition to offering PayPal Express Checkout and Google Checkout.

There are a variety of ways to integrate with Authorize.net. Typically Web Site Design By, LLC will integrate Authorize.net directly with a shopping cart or custom checkout application on your web site. We are an an Authorized.net affiliate reseller. Please use the button below to start your application process. Start now by creating a login.

Google Checkout
Google provides another payment option for shoppers who prefer to checkout using Google Checkout. Visitors must have a Google Checkout Account or register for one to pay using Google Checkout. With Google Checkout, Google simply stores the visitors credit card information and transfers the funds to your bank. There is a fee associated with each transaction. Google Checkout can be implemented in addition to PayPal and Authorize.net.

Tell us about your specific plans for accepting payments online and we will help you implement the best possible solution.

  • Share/Bookmark
February 6, 2010

I have been using authorize.net as a merchant service provider for many years. They provide a payment gateway that enables you to authorize, settle, and manage credit card and electronic check payments. Their payment gateway can be integrated into your web site to accept payment online, or you can use their virtual terminal to process credit cards manually.

Are you ready to get started with your authorize.net application process?
sign up now

If you would like more information about authorize.net or accepting credit cards on your web site please contact us.

  • Share/Bookmark
September 26, 2009

You can now log in to post comments on my blog using FaceBook via WP-FacebookConnect.

  • Share/Bookmark
September 10, 2009

This example uses the php class developed by Mark Sandborn (now hosted at code.google.com here). I made a couple slight modifications to the class. Using Marks’ class I created this form to serve as a starting point for you to present your user with various UPS shipping options and their associated costs to integrate into your own shopping cart.

download my sourcecode for the form
Rates and Service Selection XML Tool Developers Guide from UPS

Happy coding!

  • Share/Bookmark
September 7, 2009

Loading data from the server via AJAX is an efficient and increasingly popular way to present content from a user request. After starting out by writing my own AJAX functions I started using the prototype framework. I am currently using the jquery load function as jquery is a very powerful and easy to use framework that can handle the nuts and bolts of a variety of other javascript functions and effects.

Part of implementing an AJAX request is to have a message displayed while the request is being made to the server to let the user know exactly what is going on and give your application a more professional and responsive appearance. In the past I have found myself spending too much time hand creating an animated loading indicator that spins with just the right colors and size. Fortunately someone out there has had the same experience and chose to share their solution. Here is a very handy tool to use to automatically generate a professional AJAX loading indicator GIF animation. ajaxload.info lets you define the foreground and background color and generates a perfect, professional AJAX load indicator every time!

Load indicator generated at ajaxload.info
  • Share/Bookmark