In this article I'm going to teach you how to add a new custom module to your PHP-Nuke website.

In PHP-Nuke, modules are used in order to build up the menu items of your site. You could create for example a module that has some simple text content and a link to a remote website. Visitors to your site would be able to get to this page by clicking on the module's link in your Modules menu.

Creating a new module in PHP-Nuke

Following the steps below I'll walk you through creating a new custom module called Support, that simply has some text and then a link back to our support center.

  1. Login to your cPanel
  2. Under the Files section, click on File Manager, select Web Root and click on Go.
  3. Navigate to the directory you've installed PHP-Nuke to, then go into the modules directory.
  4. In the top menu, click on + New Folder, then name the folder what you'd like to name your module. In this case I've named mine Support, then click on Create New Folder.
  5. Now click on the newly created Support modules folder.
  6. Next click on + New File, name your new file index.php, then click on Create New File.
  7. Now right-click on the newly created index.php script, and select Edit.
  8. This is the example code I have used for my module:

    <?php
    if (!eregi("modules.php", $PHP_SELF)) {
    die ("You can't access this file directly...");
    }
    $index = 1;
    require_once("mainfile.php");
    $module_name = basename(dirname(__FILE__));
    get_lang($module_name);
    include("header.php");

    echo "<p>This is a test module!</p>";

    echo '<a href="http://inmotionhosting.com/support">InMotion Support Center</a>';


    include("footer.php");
    ?>

  9. Now click on Save Changes up at the top-right.

Activating newly created module in PHP-Nuke

Now that you've created a new module, we need to login to PHP-Nuke to set it to active. Follow along with these steps to accomplish that.

  1. Login to your PHP-Nuke admin dashboard.
  2. In the 2nd row, 4 icons over, click on Modules.
  3. Scroll down till you see the newly created Support module, and click on the cog icon to the far-right of it to enable the module.
  4. Now if you navigate back to your PHP-Nuke main page, you should see under the Modules menu the new Support one, and clicking on it will take you to the page that includes our text and link!

You should now understand the very basics of creating a new custom module to use with PHP-Nuke.

Did you find this article helpful?

We value your feedback!

Why was this article not helpful? (Check all that apply)
The article is too difficult or too technical to follow.
There is a step or detail missing from the instructions.
The information is incorrect or out-of-date.
It does not resolve the question/problem I have.
How did you find this article?
Please tell us how we can improve this article:
Email Address
Name

new! - Enter your name and email address above and we will post your feedback in the comments on this page!

Like this Article?

Related Questions

Here are a few questions related to this article that our customers have asked:
Ooops! It looks like there are no questions about this page.
Would you like to ask a question about this page? If so, click the button below!
Ask a Question

Post a Comment

Name:
Email Address:
Phone Number:
Comment:
Submit

Please note: Your name and comment will be displayed, but we will not show your email address.

0 Questions & Comments

Post a comment

Back to first comment | top

Need more Help?

Search

Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail: support@InMotionHosting.com
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!