Print

SiteGround Tutorials


PHP-Nuke Tutorial

PHPNuke is a powerful Open Source portal application. It can be used as a weblog or as a CMS. PhpNuke allows webmasters and editors to easily post new content and comment existing articles. PHP Nuke is written in PHP and requires a MySQL database.

Php-Nuke is one of the most popular tools for creating game clan websites. Php-Nuke has large supporting community and you can find lots of addon resources for your nuke software, like modules, integrations, themes, etc.

phpNuke Tutorial includes:



phpNuke Hosting
(c) Copyright 2005 SiteGround PHP Hosting Services. All rights reserved.

You may use this tutorial for your own use. You may not distribute it in any form without the express permission of the publisher. You may provide a link to the publisher's web site, where this tutorial can be used from. This tutorial is provided free of charge and without any warranty of any kind.

phpNuke Installation

Get a FREE phpNuke installation with SiteGround PHP-Nuke hosting Package!

It is fairly easy to install the phpNuke application. Generally, there are 2 ways of installing it - using the Fantastico Auto-Installer tool, available on every SiteGround hosting account, or a manual installation using the tarball provided by the phpNuke developers and available for free from their official web site. This tutorial will try to show you both the ways of installing the application. We will start with the easier and faster way - Fantastico Auto-Installer.

How to install phpNuke with Fantastico

In order to install phpNuke using the Fantastico Auto-Installer you will first need to login to your CPanel control panel and enter the Fantastico panel section. To do so, please click on the big blue smiley face icon in the CPanel icon list, which is the last icon in the Software/Services section. Once inside the Fantastico Panel, please select PHP-Nuke under the Content Management sub-menu at the left and click on the New Installation link as shown here:

PHPNuke - Fantastico Auto-Installer

This will open a new page with several form fields inside. In order to complete the installation, please fill in the requested information. Mandatory fields are 'Install in Directory', 'Administrator username' and 'Password'. The rest can be left as is and can be easily edited later from the PHP-Nuke administrative control panel. Click on the [Install PHP-Nuke] button and then on [Finish] to complete the installation. If no error messages appeared, you should end with a page similar to the one shown below:

PHPNuke - Install PHP-Nuke

This is all! PHP-Nuke is now successfully installed on your account and you are ready to manage your new Community Portal script! To do so, please log in your administrative control panel, which is accessible at

www.yourdomainname.com/admin.php.



phpNuke Hosting
(c) Copyright 2005 SiteGround PHP Hosting Services. All rights reserved.
Next

Manual Installation of PHP-Nuke

Get a FREE phpNuke installation with SiteGround PHP-Nuke hosting Package!

Installing PHP-Nuke manually is a little bit harder than the Fantastico Auto-Installer procedure. It involves downloading of the source tarball, configuring the application and importing a MySQL database.

Creating a subdirectory and a database for PHP-Nuke

First, let us prepare your account for the installation. We will need a directory where PHP-Nuke files will be uploaded and a database, where it will store its data.

Step 1: Create a directory for the PHP-nuke files.

To create a new directory, please follow our CPanel -> FileManager tutorial.

If you would like manually to install phpNuke in the main directory of your website (and not in a subfolder), all you need to do is to upload phpNuke files in the public_html folder of your website.

Step 2: Create MySQL database and user.

Second, let us create the database and user for phpNuke. Please, follow the instruction in the MySQL database and user tutorial and create a database for the PHP-Nuke installation. For example, you can call it nuke.

Your hosting account is now prepared for the PHP-Nuke installation.

Installing PHP-Nuke

Step 1: Download the PHP-nuke files.

We should now obtain the script files and upload them to your account. PHP-Nuke official web site is located at http://www.phpnuke.org and we are going to download the latest PHP-Nuke release from there. Here is a direct link to the latest source tarball:

http://www.phpnuke.org/modules.php?name=Downloads&d_op=viewdownload&cid=1

Visit the page and download the latest zip file containing the phpNuke files. Once downloaded, please unzip it using any archive program (such as WinZip or WinRar) somewhere on your computer. This will create 3 different directories: 'html', 'sql' and 'upgrades'.

Step 2: Config.php

The phpNuke files reside under the 'html' directory, but before uploading them we will need to change the database configuration values in the 'config.php' file. To do so, please open the 'config.php' file inside the 'html' directory using your favorite text editor (preferably NotePad) and locate the following 4 lines:

$dbhost = "localhost";
$dbuname = "root";
$dbpass = "";
$dbname = "nuke";

You should change them to reflect your newly created database and username. Change the words between the quotations with the right values.

$dbhost = "localhost";
$dbuname = "username_nuke";
$dbpass = "yourpass";
$dbname = "username_nuke";

Step 3: Upload the PHP-Nuke files.

After you have modified the 'config.php' file and added the correct values, please save the file in the same directory and overwrite the previous one.

Now we should upload the PHP-Nuke files. This can be easily done using any FTP client program. You can check our FTP tutorial here.

Step 4: Populate the MySQL database.

Meanwhile, we will populate the database we have created earlier. Please, open CPanel -> phpMyAdmin tool and a new page will load. Please, select the database you have created from the drop-down menu at the left-hand side and wait for the right side of the screen to update. Once fully loaded, click on the 'Import' tab and then on the [Browse] button. This will open a file upload browser window. Please, navigate to the sql/ directory, which comes with the phpNuke archive file and which we have previously extracted on your local computer. There should be only one file called nuke.sql. Double click on it and then click on the [Go] button. The process might take up to several minutes to complete and at the end you should see 'Import has been successfully finished' confirming that the procedure was completed successfully.

To finalize the installation and create the administrative user, please go to your admin.php page. In your case this will be either http://www.yourdomainame.com/subfolder/admin.php or http://www.yourdomainame.com/admin.php. Fill in the form and submit it:

PHPNuke -

You have successfully installed PHP-Nuke on your account.

Important Please, note that as of February 2006, for the latest official releases of PHP-Nuke you will be charged an appropriate fee. Learn more here.



phpNuke Hosting
(c) Copyright 2005 SiteGround PHP Hosting Services. All rights reserved.
Previous

PHP-Nuke Themes

Changing the Overall Look & Feel of PHP-Nuke

Changing your PHP-Nuke theme is quite an easy task. Generally, you will just have to download the theme archive, extract it to your local computer and upload it to your 'phpNuke themes' directory. A good source of free PHP-Nuke themes is the PHP-Nuke template gallery at SiteGround.com. Now let's try to change a theme.

First, you will need to find a theme archive to use. For the purpose of this tutorial, please, choose any of the templates available at PHP-Nuke template gallery. Please, download the .zip file of any theme on your local computer and extract it. This will create a new directory named after the theme's name.

To make the new template available for your PHP-Nuke application, however, we will have to upload it first. Please, open an FTP connection using your favorite FTP client and navigate to your PHP-Nuke directory. In our case this is the 'public_html' directory. From there, please enter the themes directory and upload the whole extracted theme directory. This will create a new directory with the same name, which will have the following full path: /public_html/themes/theme_name.

Once uploaded, please enter your PHP-Nuke administrative control panel (using admin.php) and click on Preferences tab.

PHPNuke Themes - Preferences

Scroll down a little and locate the 'Default Theme for your site' drop-down menu. Click on it and select new theme from the list in order to switch to the new theme. Click on the [Save Changes] button at the end of the page and the new theme will be up.

PHPNuke Themes - Choose theme

Additionally, you can try changing the theme to one of the pre-installed themes that comes with every default installation of PHP-Nuke.



phpNuke Hosting
(c) Copyright 2005 SiteGround PHP Hosting Services. All rights reserved.

PHP-Nuke Modules, Blocks and Addons

There is no doubt that the most exciting feature of PHP-Nuke is its expanding capability through the use of modules, blocks and add-on components. We have chosen 3 major 'upgrades' for phpNuke and will try to show you how easy is to install them.

Also our Advanced Support Team can complete many modules, blocks and components installations for you. They can be purchased through the Exclusive Professional Services -> Adding a module to an application ticketing category.



phpNuke Hosting
(c) Copyright 2005 SiteGround PHP Hosting Services. All rights reserved.
Next

PHP-Nuke Modules: Gallery

Installation of Gallery to your PHP-Nuke site

Title: Installation of Gallery to your PHP-Nuke site

There are several gallery modules that are available for PHPNuke. The Coppermine gallery is probably the most famous and easy-to-use one, However, since Coppermine Gallery and PHP-Nuke are now incorporated into one application called CPGnuke and are not available for integration anymore, we are going to install 'Em's eGallery' which is available for download here.

To install the gallery, you should first download the archive file and extract it on your local computer. This will create 2 new directories: db/ and html/. The db/ directory contains the database update script we will need in order to install the database structure for the gallery and the html/ directory contains the files needed by phpNuke for the installation. Please, open your favorite FTP client, connect via FTP to your web hosting account and navigate to the directory where phpNuke is installed. Then upload all the files and directories found under the html/ directory in the Gallery extracted archive file.

Once you complete the upload, you should import the database tables that come with Em's eGallery script. To do so, please open your CPanel and select the phpMyAdmin tool. Click on it and a new page will load. From the drop-down menu at the left-hand side, please select the PHP-Nuke database you have created and wait for the right-hand side of the screen to update. Then click on 'SQL' tab and paste inside the window the content of the 'emsgallery.sql' file. Click on the [Go] button. In this way you will import the gallery tables in the PHP-Nuke Database.

Once both the files are uploaded and the database is imported all you have to do is to configure your new gallery module. Please, go to your PHP-Nuke admin screen and click on the new icon for Em's eGallery:

PHPNuke Modules - Em's eGallery

Scroll down a little and click on the 'Gallery Settings' link. From the 'Gallery Settings' page, please click on the [Edit Gallery Config] button. The only setting that you need to configure is 'Server Upload Directory' value.

PHPNuke Modules - Server Upload Directory

It should be:

/home/user/public_html/modules/emsGallery/images

where "user" should be replaced by your actual CPanel username. You can change the other settings according to your personal preference. Save the configuration and you will have a nice and simple to use gallery integrated into PHPNuke.



phpNuke Hosting
(c) Copyright 2005 SiteGround PHP Hosting Services. All rights reserved.
Previous Next

PHP-Nuke Modules: Gallery

Installation of Gallery to your PHP-Nuke site

Title: Installation of Gallery to your PHP-Nuke site

There are several gallery modules that are available for PHPNuke. The Coppermine gallery is probably the most famous and easy-to-use one, However, since Coppermine Gallery and PHP-Nuke are now incorporated into one application called CPGnuke and are not available for integration anymore, we are going to install 'Em's eGallery' which is available for download here.

To install the gallery, you should first download the archive file and extract it on your local computer. This will create 2 new directories: db/ and html/. The db/ directory contains the database update script we will need in order to install the database structure for the gallery and the html/ directory contains the files needed by phpNuke for the installation. Please, open your favorite FTP client, connect via FTP to your web hosting account and navigate to the directory where phpNuke is installed. Then upload all the files and directories found under the html/ directory in the Gallery extracted archive file.

Once you complete the upload, you should import the database tables that come with Em's eGallery script. To do so, please open your CPanel and select the phpMyAdmin tool. Click on it and a new page will load. From the drop-down menu at the left-hand side, please select the PHP-Nuke database you have created and wait for the right-hand side of the screen to update. Then click on 'SQL' tab and paste inside the window the content of the 'emsgallery.sql' file. Click on the [Go] button. In this way you will import the gallery tables in the PHP-Nuke Database.

Once both the files are uploaded and the database is imported all you have to do is to configure your new gallery module. Please, go to your PHP-Nuke admin screen and click on the new icon for Em's eGallery:

PHPNuke Modules - Em's eGallery

Scroll down a little and click on the 'Gallery Settings' link. From the 'Gallery Settings' page, please click on the [Edit Gallery Config] button. The only setting that you need to configure is 'Server Upload Directory' value.

PHPNuke Modules - Server Upload Directory

It should be:

/home/user/public_html/modules/emsGallery/images

where "user" should be replaced by your actual CPanel username. You can change the other settings according to your personal preference. Save the configuration and you will have a nice and simple to use gallery integrated into PHPNuke.



phpNuke Hosting
(c) Copyright 2005 SiteGround PHP Hosting Services. All rights reserved.
Previous Next

PHP-Nuke Modules: Forum

How to activate phpBB Forum software to your PHP-Nuke site

Forums are the 'must-have' component for every CMS/Portal system and as such PHP-Nuke developers had phpBB (probably the most popular forum software available on the net) built into phpNuke for your convenience.

In order to activate the forums module, you will just have to log in your administration screen, click on modules and activate it using the activate icon as shown here:

PHPNuke Modules - Forum

Once activated, the module will be available for administration/management through your admin control panel -> Forums.



phpNuke Hosting
(c) Copyright 2005 SiteGround PHP Hosting Services. All rights reserved.
Previous Next

PHP-Nuke Modules: Shopping Cart

Installation of Shopping Cart to your PHP-Nuke site

For the purpose of this tutorial we are going to install CallowaysCart shopping cart, which is available free of charge for download at the CallowaysCart website.

In order to install the cart, please visit the above URL and download the script to your local computer. Extract the archive files that are inside the scripts.zip file and then extract the Calloway's_Cart_Pro_v.2.1b.zip archive. This will create a new directory Calloway's_Cart_Pro_v.2.1b with several files and directories under it.

Please, open your favorite FTP client, connect via FTP to your web hosting account and navigate to the directory where phpNuke is installed. Then upload all the files and directories found under the Calloway's_Cart_Pro_v.2.1b directory into your phpNuke home directory.

Once the files are uploaded successfully, we should go and install the base of our database structure. Please, visit http://www.yourdomainname.com/path2phpnuke/ccinstall.php, where 'yourdomainname.com' is replaced with your real domain name and path2phpnuke with the real path to the application.

Now that we have the database created, we should populate and update the content in it - go to your administration section and click on the newly created CCart_Pro icon. Scroll down a little and click on "Main CCart Settings" which will lead you to the main configuration screen for the shopping cart. To update the database, locate 'Click to upgrade your MYSQL Tables to version 2.0b Pro' link and follow it. It should say 'Good News..', which means everything was completed successfully and now you will be able to use the cart fully.

Go back to the configuration panel and finish the rest of the configuration form:

PHPNuke Modules - Shopping Cart

Important Remember to delete ccinstall.php and cc_update_2.0b.php in your root folder when you are done.

Go to your Paypal account and activate IPN under Profile at the top of Paypal. To do so go to http://www.yourdomainname.com/ipn.php - the URL in the ipn box in paypal (Replace yourdomainname.com with your actual one). Now go to ipn.php in your root folder and edit your message to your customer(s) after they place an order. You will see it commented.

That's it! Well done!



phpNuke Hosting
(c) Copyright 2005 SiteGround PHP Hosting Services. All rights reserved.
Previous

PHP-Nuke and Google AdSense

How to show Google Adsense advertisements in PHP-Nuke

Advertisements are a popular source of revenue for webmasters. It doesn't take long until the young webmaster feels attracted to the call of affiliate programs, banners or context relevant advertising. We will show you 2 of the many possible ways to include a GoogleAdsense box in your PHP-Nuke application.



phpNuke Hosting
(c) Copyright 2005 SiteGround PHP Hosting Services. All rights reserved.
Previous Next

PHP-Nuke and Google AdSense

Google AdSense in the News module

We are going to add an AdSense JavaScript code in a phpNuke module. For that purpose you will need to enter your CPanel -> File Manager utility and navigate to your PHP-Nuke folder -> modules -> News directory. Edit the article.php file. To insert the code you will have to:

Look for the following code:

$boxtitle = ""._RELATED."";
$boxstuff = "<font class=\"content\">";
$sql = "select name, url from ".$prefix."_related where tid=$topic";
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) {
$name = $row[name];
$url = $row[url];
$boxstuff .= "<strong><big>·</big></strong> <a href=\"$url\"
target=\"new\">$name</a><br>\n";
}

And above it copy and paste the following code:

echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"2\"
bgcolor=\"#FFFFFF\"
width=\"160\"><tr><td>\n"
."<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"160\">\n"
."</table>\n"
."<table border=\"0\" cellpadding=\"2\" cellspacing=\"2\"
bgcolor=\"#FFFFFF\"
width=\"100%\">\n"
."<tr><td align=\"center\">\n"
."<font class=\"title\" size=\"1\"><b>Related Websites</b></font>\n"
."</td></tr>\n"
."<tr>\n"
."<td bgcolor=\"#FFFFFF\"><font size=\"1\">";
?>
<center>
<script type="text/javascript"><!--
google_ad_client = "your client-number";
google_ad_width = 120;
google_ad_height = 600;
google_ad_format = "120x600_as";
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "336699";
google_color_url = "000000";
google_color_text = "000000";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</center>
<?php
echo "</td>\n"
."</tr>\n"
."</table></td></tr></table>\n"
."<br>\n\n\n";
 

This, although it seems a bit complicated, is very easy to achieve. To do so, just click ctrl+f when the code is fully loaded and search for

$boxtitle = ""._RELATED."";

and above that line copy and paste the code:

PHPNuke and Google AdSense

Save the file and your AdSense box will appear in the News sections.

ImportantPlease, do not forget to change your actual Google Adsense code in the above example.



phpNuke Hosting
(c) Copyright 2005 SiteGround PHP Hosting Services. All rights reserved.
Previous Next

PHP-Nuke and Google AdSense

Google AdSense on top of a PHP-Nuke module

Another approach is to add a Google AdSense banner on top of every module. You can include the AdSense Javascript code in a separate file, call it adsense.php, and then just include this file from your module, as we did for the News sections above.

Put the following code in includes/adsense.php:

<center>
<script type="text/javascript"><!--
google_ad_client = "your client-number";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "336699";
google_color_url = "000000";
google_color_text = "000000";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</center>
 

Once you have adsense.php in the includes directory, it becomes trivial to use its code in every module you choose. For every module where you would like to add the Google AdSense, look for the following code:

require_once("mainfile.php");

and place the following line after that:

require_once("includes/adsense.php");

as we did that in the more detailed example with the News articles:

PHPNuke Google AdSense



phpNuke Hosting
(c) Copyright 2005 SiteGround PHP Hosting Services. All rights reserved.
Previous

PHP-Nuke Resources

PHP-Nuke Security

Because PHP-Nuke is so popular, it is frequently attacked by those, who are looking for security flaws. Also, since it contains a port of phpBB2, it also has to deal with the security issues of that piece of software.

It is important to note that many of the security risks may be blocked by following a few key guides:

  • Never use the default table prefix, change it to something unique and do not publish it;
  • Disable PHP's register_globals setting;
  • Disable the ability to display_errors;
  • Do not use versions that include the TinyMCE WYSIWYG Editor. Many security features had to be removed from PHP-Nuke in order for this editor to work.

In a production environment, the above will keep critical information from leaking. Since many SQL injection attacks make use of default table names, changing the prefix is a good idea - one not much discussed.

ImportantThese recommendations are not applicable only for PHP-Nuke. Executing them for any PHP based content management system is suggested.

PHP-Nuke Forks

The PHP-Nuke project has been forked many times by different people, for different reasons. The most popular of these are:

  • Postnuke - based on PHP-Nuke 5.0.
  • Dragonfly CMS/CPG-Nuke - based on PHP-Nuke 6.5 with Coppermine Photo Gallery included.
  • Nuke-Evolution - Based on PHP-Nuke with many security fixes, custom modifications, and PHP-Nuke modifications pre-installed (Available in Basic, Advanced, Clan, & Business Versions).
  • eNvolution - based on Postnuke.
  • myPHPNuke - based on PHP-Nuke 4.4.1a.
  • NPDS - based on PHP-Nuke 4.3.
  • openPHPnuke - based on myPHPNuke.
  • phpWebSite - project managed by the Web Technology Group at Appalachian State University.
  • XOOPS - based on PHP-Nuke and myPHPNuke.
  • Xaraya - based on Postnuke.
  • UNITED-NUKE - based on and fully compatible with PHP-Nuke (new features are ported continuously).
  • Platinum PHP-Nuke.
  • Zentri.

These forks, and others, have had their own ideas regarding several aspects of the system, and thus do many things in different ways in an attempt to produce a better product. Nevertheless, most, if not all of these systems can be used to produce a community portal similar to that which can be built using PHP-Nuke, although it is possible that these systems are better at doing some things than PHP-Nuke (and vice-versa).

PHP-Nuke Resources

You can check SiteGround CMS hosting services for other CMS/Nuke software choices. You can also check SiteGround PostNuke Tutorial.

Please, feel free to contact us if you have any questions or recommendations about this tutorial at: tutorials 'at' siteground.com



phpNuke Hosting
(c) Copyright 2005 SiteGround PHP Hosting Services. All rights reserved.