Sunday, June 28, 2009

Joomla BreezingForms Preview Issue

If you have installed the BreezingForms component and find that the preview pane for all of your forms is muddled in such a way that the site styles are being displayed and making it difficult to see your changes you'll need to update the following:

Line #2833 - File: administrator/components/com_facileforms/admin/element.html.php

Remove the /
$ff_mossite.'index2.php'

This should remove the site styling from the preview and make it nice and clean.

EDIT: I've noticed that on some sites that use styles setting the background to say, black... the above still doesn't fix the issue completely. Add the following lines to your stylesheet to make a nice clean white background.

body.contentpane{
background: #FFFFFF;
}

Tuesday, June 16, 2009

Joomla! sh404SEF Component Notes

General notes for installing the sh404SEF search engine optimization component

Joomla! 1.5+

1. Select Extensions ->Install/Uninstall
2. Browse to and select the latest version of the sh404SEF component.
3. A successful unzip/install should notify you appropriately. If the upload fails check to be sure your ftp_path variable for your joomla install is correct.
4. Go to Site->Global Configuration and click on the Site tab. Be sure that the Use Apache mod_rewrite value under SEO Settings is set to "Yes".
5. Go to Components->sh404SEF, switch to the extended display on the right. Verify that there are no errors reported for the folders the component uses. You may need to set some to 777 initially to get the component working.
6. Click the sh404SEF Configuration icon.
[a] Main Tab - Basic Configuration - Set Enabled to Yes & select your own custom 404 Page (created in the article manager) as the value for the 404 Page.
[b] Advanced Tab - Advanced Component Configuration - Rewriting mode = with .htaccess (mod_rewrite)
7. Download the textfile htaccess.txt, upload this file to the root level of your joomla site and rename it to .htaccess (hidden system file)

If the planets are aligned properly you should be set.

Monday, June 15, 2009

Joomla - Relocating Your Site to a New Server

How do you relocate your Joomla! 1.5+ website from one server to another?

The idea of moving your Joomla! site may seem a bit daunting when you first think about it, especially if you've gone through the trouble of installing heaps of modules and custom components to get your site exactly how you want it. In truth however, this task is actually quite easy.

1. Backup your mysql database
Joomla! runs on top of a mysql database. I believe it may be possible to configure Joomla! to work with other types of databases but if you're reading this guide chances are your Joomla! install was setup to use the default database type: mysql. Most web servers that use mysql have phpMyAdmin installed as a web based database administration tool. phpMyAdmin makes backing up your database easy!

[Note: If you're web server doesn't have phpMyAdmin installed hop over to the mysql GUI tools page to obtain a copy of their free database administrator tool. If you need help with these tools feel free to respond with your questions and I'll be glad to help.]

Login to phpMyAdmin by entering the URL for your mysql database server into any web browser. This information should have been provided by your web host, but on the off chance you've lost it and can't get in touch with them you can find all the information you'll need in the configuration.php file located in the root of your Joomla! website folder. See the values listed below.

var $host = 'mysql.mywebhost.com'; <-- Your mysql server URL
var $user = 'project88'; <-- Your username
var $db = 'project88'; <-- Your database
var $pass = 'password'; <-- Your password

Once you've logged in, click the databases link under mysql, select your database and click the Export tab at the top. Be sure to make sure ALL database tables are selected, click the save as file check box and hit go. Save the file somewhere on your computer.

2. Backup and transfer your Joomla! site
Essentially you want to zip the entire site into a single zip file and then upload this file to your new site and unzip it there. There are scores of ways to do this so I won't go into detail here. If you're unsure how to do this ask your web host if they can create a site zip for you, and alternatively have them unzip it on your new site after you transfer the file.

I typically create a zip file called zippedsite.tgz and once uploaded to the new site I unzip it using a php page that contains the following code:

<?php

exec('tar -xzf zippedsite.tgz');

?>

3. Setup your new mysql database
Connect to your new database server using phpMyAdmin like we did above but instead of clicking the export tab click the SQL tab instead. Open the database backup file you created with Notepad (Windows) or TextEdit (Mac) and copy the contents of the file into the SQL query window of phpMyAdmin and click go. If you're successful you should see a list of tables appear down the left side of the screen.

4. Configure Joomla! to work on your new server
Open configuration.php from the root folder of your new site and update the following values:

var $log_path = '<*see below>/logs';
var $tmp_path = '<*see below>/tmp';
var $ftp_host = 'ftp.yournew.server';
var $ftp_port = '21';
var $ftp_user = 'your_new_ftp_username';
var $ftp_pass = 'your_new_ftp_password';
var $ftp_root = '<*see below>';
var $host = 'mysql.newserver.com';
var $user = 'newproject';
var $db = 'newproject';
var $password = 'newpassword';

* - For the values above replace <*see below> with the absolute path for your new server. To find this value create a new php document that contains the following code:

<?php

phpinfo();

?>

Call this file whatever you want, I typically call it deleteme.php so I remember to remove it later. You don't want to leave this file on your server. It's a major security risk. Upload the file for now and navigate to it in your web browser. Search the results displayed for the string _SERVER["DOCUMENT_ROOT"]. The value stored in this variable is your absolute path.

Once you've updated these values delete the temporary file deleteme.php and you should be good to go.

Sunday, June 14, 2009

BreezingForms - Multiple Recipients for Email Forms (Joomla)

How do you modify an email notification form using Joomla and BreezingForms so it can be sent to multiple recipients?

1) Open the form you want to modify.
2) Put the form into edit mode.
3) Select the submit pieces tab.
4) Under the "Begin Submit" section select "Custom"
5) Below is a sample of the php code you will place in the text box

BEGIN CODE
----------

// declare globals used in this piece
global $mosConfig_mailfrom, $mosConfig_fromname;

// include FacileForms standard library
$this->execPieceByName('ff_InitLib');

// Note: txt_firstname and other variables below are simply the names I used. Be sure to update the values you place here to match YOUR form.
$emailSenderName = ff_getSubmit('txt_firstname')." ".ff_getSubmit('txt_lastname');
$emailSenderAddr = ff_getSubmit('txt_email');
// Multiple recipients declared here
$emailRecipients = 'tester@copperbot.net, me@myprivatemail.com';
$emailSubject = 'Enter the email subject here';

$emailMessage = "Message received from webform:\n";
$emailMessage .= "\n";
$emailMessage .= "Company: ".ff_getSubmit('txt_company')."\n";
$emailMessage .= "First Name: ".ff_getSubmit('txt_firstname')."\n";
$emailMessage .= "Last Name: ".ff_getSubmit('txt_lastname')."\n";
$emailMessage .= "Email: ".ff_getSubmit('txt_email')."\n";
$emailMessage .= "Street Address: ".ff_getSubmit('txt_street')."\n";
$emailMessage .= "City: ".ff_getSubmit('txt_city')."\n";
$emailMessage .= "State: ".ff_getSubmit('list_state')."\n";
$emailMessage .= "Zip/Postal Code: ".ff_getSubmit('txt_postal')."\n";
$emailMessage .= "Phone Number: ".ff_getSubmit('txt_phone')."\n";
$emailMessage .= "Website: ".ff_getSubmit('txt_website')."\n";
$emailMessage .= "How did you hear about us: ".ff_getSubmit('list_hearaboutus')."\n";
$emailMessage .= "Serial Number: ".ff_getSubmit('txt_serial')."\n";

// send the mail
$this->sendMail(
$emailSenderAddr, // email addr of submitter (1)
$emailSenderName, // name of submitter (1)
$emailRecipients, // email of recipient (2)
$emailSubject, // subject of the mail (3)
$emailMessage // body of the mail (3)
);

Monday, June 8, 2009

Creating an Autorun CD or DvD

How can you easily install the Autorun feature on a CD or DvD?

Earlier today I was asking myself this very question. Wow, who knew this could be so easy? How I've managed to go this many years working in the IT field without creating a single Autorun CD is beyond me but as of today I finally know how and I'd like to share that information with all of you.

Truth be told I'm not a big fan of the Autorun feature on windows machines (I now primarily use the OSX partition on my MacBook Pro) but in cases where you need to distribute functional copies of websites (or other media) to clients via CD this is something good to know. Computer users are becoming more and more savvy every day but there are still heaps of people out there who may not know that opening the index.html file located on the root level of the CD will open the site. Using Autorun can eliminate some initial confusion and help make the disk distribution more successful.

We'll create two text files to achieve the desired result: (autorun.inf and autorun.bat)

Note: You cannot tell an autorun to directly open a HTML file. This is why we have the .bat file as well, to serve as the "middle-man". Windows will treat the .bat file as a program, run it, and in turn the .bat file will open our index.html page.

Contents of autorun.inf
[autorun]
open=autorun.bat

Contents of autorun.bat
@echo Loading CD
@start index.html
@cls
@exit

Once both of these files are created, place them in the root of your local website folder (this is where your index.html file should also be located) Now simply burn the contents of your local website folder (including the two new files we created) to disk. When you pop the disk into a windows machine it should automatically load the index.html page in the machines default web browser. It's as simple as that.

Can you use autorun for other file types?
Absolutely! Alternatively you could use this same process to autoload a flash presentation, game, excel spreadsheet, or anything else (as long as the required software is loaded on the target machine). Simply modify the line @start index.html, replacing index.html with whatever file you want to automatically load.

It's worth noting that this process won't work on Macs or Linux machines. I'll have to sort that out in another post.

Human Beings Are Sad Creatures

World Oceans Day

Reading the comments posted for this story reminds me of those I heard when an Inconvenient Truth came out. Rather than at least saying "Hmmmm, you might have a point. Perhaps I could be less wasteful in my own personal life. Thank you for the reminder. I'll do my part to help..." people always immediately attack the messenger.

The sad thing about human beings is that we rarely change our ways until we're forced to. People can go on and on about jobs, livelihood and the need to eat all day long but just who do you think you're educating? These are givens and you're not breaking any new ground by restating them. The point is, we need to adapt, to consistently strive to do more with less, that or we have to cap our own population. It's not rocket science. This bubble we call earth is finite, it can only provide so much. Fail to recognize this and perish, it's quite simple. Defaming the messenger because what they say is "inconvenient" rather than at least acknowledge that conservation and moderation is always sound practice is really stupid.

Tuesday, April 21, 2009

BreezingForms Captcha Issues (Joomla)

Recently I was having problems with captchas using BreezingForms on one of my Joomla sites. The captcha was working fine for the sample contact form but not for the new form I had just created. Using the sample form as an example I was was sure to create the captcha on my new form in the exact same way but for some reason it simply refused to show up.

As it would happen, this was just one of those things that happens when you're new to a given CMS. Here are the steps I took to fix the problem:

1. Go to the BreezingForms form manager
2. Open the form you want to edit.
3. Select the "Edit Form" icon (top right)
4. Click the "Form Pieces" tab
5. In the "Before Form" section set Type = "Library" and choose FF::ff_InitLib for pieces.
6. Click save.

Huzzah! Your BreezingForms captcha should now work!