Building A Better Web Site

Published Date
01 - Jul - 2005
| Last Updated
01 - Jul - 2005
 
Building A Better Web Site
Most SoHo businesses today need to have a Web presence, especially given the increasing number of searches for products and solutions being conducted online. The days of consulting the Yellow Pages are almost gone, at least in every city or town that's been Net-enabled for the past two years.

Previously, in this space, we've shown you how you can set up a very basic HTML-based Web site-at almost no cost. Now, for you to take your Web site to the next level, and start creating a true online presence, you need to get into the world of scripted Web pages, and things such as server-side scripting to create dynamic Web pages that will give your site the professional look it needs.

This is where coding languages such as Microsoft's ASP (Active Server Pages) and PHP (PHP: Hypertext Preprocessor) come in. However, it's not something that just anyone can sit down and learn overnight. For the SoHo segment, or even for a personal Web site, hiring a few site developers to build your site is also not an option. What next, then?

Nuke 'em
PHP, the open source alternative to Microsoft's ASP, is the obvious choice to build a Web site. Why? Because it is cross-platform-a PHP site can be hosted on any Web server, running any OS, unlike ASP, which needs a Microsoft OS-and because it's open source.

The biggest advantage of open source software is the thousands of developers who dedicate time to improve or simplify such software.

PHP-Nuke is a project by dedicated developers who decided that people shouldn't need to know how to code in order to develop their own PHP-based Web sites.

There are many offshoots of PHP-Nuke, which is the beauty of open source, and these are listed in the box "Options". The installation and control panel of each do not logically differ much from PHP-Nuke, so you can feel free to experiment with some of them as well.

Here, however, we will stick to PHP-Nuke, and learn how to install, configure, and finally, tweak it to give you a Web site that's unique and looks exactly  what you want it to look like.

Prerequisites
There are some things you will need to have in place before you can begin setting up your site, such as a domain name and hosting space on a Web server that supports PHP and MySQL databases. Both are relatively easy to find.

On GoDaddy.com, for example, a .COM domain will cost about $9 (Rs 390) yearly and basic hosting with 25 GB data transfer and 500 MB Web space will cost about $4 (Rs 175) a month. This brings your total yearly expenditure to about $57 (Rs 2,500). Thankfully, this is all you will have to pay. Using this article, you will be able to set up a personal or company Web site for exactly that price and not a paisa more.

Getting PHP-Nuke
Once you've bought your domain name and Web hosting, the next step is to download the PHP-Nuke installer from www.phpnuke.org. The latest version will cost you $10 (Rs 435) to download, but they offer the previous version for free. So, as of the writing of this article, if the latest version is 7.8, you can download version 7.7 for free. The latest
free version is available at http://snipurl.com/digit_php.

Installing PHP-Nuke
Once you have downloaded the file, unzip it to your hard drive. You will see three folders-'html', 'sql' and 'upgrades', along with multiple text files.


Since you are freshly installing PHP-Nuke, all that concerns you is the 'html' and 'sql' folders. The 'upgrades' folder is meant for those of you upgrading PHP-Nuke to the latest version. The first thing you should do is read the 'Readme' and the 'Install' text files, as you should do before preparing to install any software.

Now all you have to do is follow the step-by-step instructions below to install PHP-Nuke.
Step 1. Creating A New MySQL Database
A MySQL database is what a PHP Web site uses to store data. It reads the MySQL database and displays content, and the settings that you select.

When you sign up for Web hosting, you will be told how to control your databases. Most hosting companies offer a simple phpMyAdmin or mysqladmin front-end for managing your databases. In our example, using GoDaddy.com's hosting package, we got an allocation of one database, which we created from our account at GoDaddy.com itself.


You will have to create a database here and call it anything you want. Now you will have to use the phpMyAdmin or mysqladmin front-end to create the hundreds of tables and thousands of fields in MySQL that PHP-Nuke needs.



Fortunately, all you need to do is find a link called SQL, as shown in the accompanying screenshots.

Step 2. Adding PHP-Nuke Tables To The Database
Once you click on the SQL link, you will see something similar to what's shown in the screenshots. There will be an option to upload a file to the server and run the SQL commands in it. Basically, you need to upload the file called 'nuke.sql' which is in the 'sql' folder you came across after unzipping the PHP-Nuke installer.


There will be a button titled 'Choose', which will ask you to select a file from your hard disk. Select the file 'nuke.sql' and click 'Go'. This will execute all the required SQL commands, and you can now begin uploading your Web content.

EasyPHP: The Easiest Way To Test Your PHP Site 
If you don't have a Web server, but would still like to try your hand at designing a Web site, you can always set up a local server on your own computer. This is also useful if you want to test a module before installing it on your main site, or if you want to try out a theme, or any such tweaks. However, you need a Web server that supports PHP, such as Apache, and a MySQL database daemon running, and you're probably using Windows. Complicated, huh?
Well, not really-thank God for Open Source and Free software! There's a software called EasyPHP, available at http://snipurl.com/digit_easyphp. Don't be put off by the French used everywhere-when you finally install it, there's an English option!
All you need to do is install EasyPHP, and it creates a '/Program Files/EasyPHP/www/' folder where you can just paste your Web sites to see them work. Now you need to start EasyPHP, and navigate to 'http://localhost' to see your Web site. It even has a phpMyAdmin, accessible by right-clicking on the EasyPHP logo in the taskbar when the software is running. Truly easy PHP!

Step 3. Editing The config.php File Correctly
In the 'html' folder, you will find a file called config.php. Open this with a text editor such as Notepad or Wordpad. You will see the following lines:
$dbhost = "localhost";
$dbuname = "root";
$dbpass = "";
$dbname = "nuke";
$prefix = "nuke";
$user_prefix = "nuke";
$dbtype = "MySQL";
$sitekey = "<something>";
$gfx_chk = 0;
$subscription_url = "";
$admin_file = "admin";
$advanced_editor = 0;
These are the default settings, and you will need to change these. An explanation for each field is given within the config.php file itself. The important ones you should take special care when changing are:

à $dbhost = "localhost";
Set this to wherever your MySQL database is hosted. With GoDaddy hosting, this is generally something like "mysqladmin99. secureserver.net". If you are sure that the database is hosted on the same machine as the Web server, then leaving this to "localhost" should be fine.

à $dbusername = "<name>";
Here, "<name>" is the username you set with your hosting provider for database management.

à $dbname = "<dbname>";
Here you should enter the database name you set in Step 1 for your database.

à $admin_file = "admin";
If you want to change the name of the admin.php file to something else, say "da-big-boss.php", for obvious security reasons, then you should change this setting to reflect that ($admin_file = "da-big-boss";). Make sure that this setting and whatever you rename the admin.php file to always match, or you will end up with a non-
functional site.

Step 4. Uploading The Site
Now you're finally through with all the actual editing and changing. All you have to do is upload all the files, as they are, to your Web server's root directory. This will take a while, and may fail frequently on slower connections.

It would be best to find an FTP utility that supports resume and allows you to upload folders and keep folder structures. If you have a decent connection, Internet Explorer will also do just fine.





Once everything is uploaded, just type in your domain in a browser and you will see a message on the main page that tells you to create an admin account and set a password. Once this is done, you will be logged into the Administration Control Panel (ACP). This is where you will be able to tweak your site and its content-all from within your browser.
Step 5. Understanding The PHP-Nuke Layout
Once you've gotten all the above steps right, you will have reached the Administrative Control Panel (ACP) for your PHP-Nuke Web site. Now, before you can start building your site, you need to know what each little icon in your ACP means, and how you can leverage them within your site.

Since we cannot list all of them in detail, we will only cover the most important ones. You should be able to decipher the rest easily enough by clicking on them.

Preferences
This is where you set all the important settings of your site, such as the name of the site, the logo it uses, the theme or colour of the entire site, and all administrative information and settings.

Make sure to set all the correct information here first. You should also check out the different theme options that come bundled with PHP-Nuke and decide on one that suits your site best. You can always tweak the design later, or even download a PHP-Nuke theme from the thousands available online.

Blocks
Blocks are just that-blocks! The different boxes you see around the default site that you already have are its blocks. We have marked out different blocks in boxes in the accompanying screenshot to better illustrate this. From the ACP, you can control which blocks are shown on your site, and more importantly, where on the site they appear.



You will see the following details mentioned: Title, Position, Weight, Type, Status, Visible To, and Functions with Edit, Activate/Deactivate, Delete and Show options. So, for example, let's say you want to move the Login block to the left of the Web site and disable the Languages block:

First, you click on the Edit icon in line with 'Languages'. In the new page that loads, you will see that you can change the option for Activate to 'No'. This will deactivate the Languages module, and you should also set the 'Visible to Subscribers' option to 'No', to hide the Languages block.

Now, just edit the Login block the same way, and just set the value of "Position" to "Left".

Now you can go ahead and play about with the blocks to see what you want where and what you want to remove. You can also create new blocks, with links to new pages that you construct. It's really very easy once you do it yourself.

Modules
Modules are like functions of your Web site, and can be controlled easily using the ACP. Clicking on the Modules link takes you to a page with a long list of modules. Here you have to choose what's important for your site to have and what isn't. Remember, there has to be at least one module linked to your home page.

By default, this is set to the News module, as PHP-Nuke was primarily built for community boards. You can change this to anything else, and you can also download and install more modules from the Net.

By default, the following modules are active after you install PHP-Nuke:
AvantGo, Downloads, Feedback, Journal, Private Messages, Recommend Us, Search, Statistics, Stories Archive, Submit News, Surveys, Top 10, Topics, Web Links, Your Account.

The easiest way to learn what each one is, is to click on the link and see where you go. It's all pretty straightforward.

Options 
PHP-Nuke has many offshoots; as developers took up the challenge and started developing their own versions of easy-to-configure PHP-based sites. Here are a few examples, in case you'd rather try them out instead:
PostNuke: Based on PHP-Nuke 5.0; www.postnuke.com
myPHPNuke: Based on PHP-Nuke 4.4; www.myphpnuke.com
Xaraya: Based on PostNuke; www.xaraya.com
NPDS: Based on PHP-Nuke 4.3; http://www.npds.org/us
XOOPS: Based on myPHP-Nuke; www.xoops.org
PHP-Nuke Platinum: PHP-Nuke, but with a lot more modules thrown in to help skip searching for them online; http://snipurl.com/nuke_plat

Messages
The default message you see in your home page is listed here. Messages are sort of like posts that get priority over everything else in the home page. They can be set to be permanent, such as an introduction to your site, or temporary, such as informing site visitors that the downloads section will be down for a week. You can also have messages only for registered users, or other administrators-basically different usergroups.

Step 6. Investing The Time
Though this will only get you started with your Web site, PHP-Nuke is built to be easy to understand. Even if you do come across problems, or cannot understand something, there are hundreds of forums that discuss and solve any questions or problems that people face.

In the end, how well-designed and snazzy your site looks depends solely on the amount of time you can dedicate to it. You can also add a shopping cart and a payment gateway, and sell your goods online. The options are unlimited, especially with PHP-Nuke modules, which seem to be made for each and every function you could ever imagine.

Building your dream site is a lot easier now-all it takes is some time, the right keywords in Google, and a little bit of bandwidth!



Team DigitTeam Digit

All of us are better than one of us.