|
|
![]() |
| Thread Tools | Search this Thread |
#1
| |||
| |||
How to create custom module for PHP-Nuke portal system Let me tell you first that I am not having enough knowledge about exactly what modules are.?! I have done some basic study about PHP along with the basic commands. I am having idea about the structure. And I have outlined the structure of a portal made with PHPNuke. Now the problem is that I am not able to create the custom module that can be used for PHP-Nuke portal system. I need some helping hand, and I am sure that some members will give important notes on it. Most important for me now, is how to create custom module for PHP-Nuke portal system? It would be very grateful if you people provide more information about it. ![]() |
#2
| |||
| |||
Re: How to create custom module for PHP-Nuke portal system I think that you should learn how to make extensions of the "body" of a nuke portal, or new modules. The modules are also called plugins or addons, and there is a large library of these components. For example, if you want a Forum, you can go on http://www.phpnuke.org. On this website, the home of PHP-Nuke, you will find in the section entitled "Download" a substantial number of additional modules. Because of this modularity, some modules have been removed from the core of the product and only available as extensions. This was the case for example for the Forum module which was previously available as an integrated module. The modules are for those who install them do not have to do is copy the files in the correct directory. The documentation is quite explicit about the features that must have a module to be installed in the structure of PhpNuke. In general, the forms are included in the subdirectory html / modules distribution. Usually the contents of the html directory is uploaded via ftp root directory on the website, so to install a module downloaded from the Internet must unpack and upload the directory that contains subdirectories under the modules. |
#3
| |||
| |||
Re: How to create custom module for PHP-Nuke portal system The modules that are installed have a simple rule: once loaded, are displayed in the main menu, under "Other Options, and their name is the same directory that contains them. To be precise, we will change the underscore in space. For example, suppose you want to create a form that displays all the horoscope (unlike the previous time the side block, which displays a horoscope time). You need to create a directory under modules Daily_Horoscope. If for some reason do not want the module to appear in the main menu, there is a very simple way to hide it: just enter "NS-" in its name as a prefix. Obviously, NS stands for No Show. A form of this type, called NS-Addon_Sample, is included in the distribution. This is a module that has been listed as shown, and obviously you do not want to appear in the main menu. |
#4
| |||
| |||
Re: How to create custom module for PHP-Nuke portal system To develop their own modules, we need to know something more, and in technical terms. First, let's see how you call the modules. Access is mediated by a component of PHPNuke that we call "module manager", and is accessible as modules.php. The manager module handles various tasks, the largest of which is (in our case) MODLOAD, appropriately selected by setting the variable op. For the record, the full URL that in general allows us to access a module. You should also examine in order the entire URL. First you need the name of the module, which is modules.php. This module takes a set of parameters: The parameter op is essential: it selects the upload function module. The module to load is specified with the name, because a module may consist of multiple files, the file parameter takes care of selecting what we want .. Generally, it is simply index. Also we can add the URL parameters, specific to the module: in particular, usually specify a parameter that is used to select sub-module functions. This last parameter is similar to the parameter p, which is only used internally by the module, and therefore must be named differently from op. This is written very clearly in the documentation. The variables are reserved as follows: $ index, $ name, $ file, $ op. The last three we have already seen, are precisely the standard parameters that are passed to the module. The variable $ index is one of our old acquaintance of the previous installments: indicates whether the current form to be displayed in three columns or two. |
#5
| |||
| |||
Re: How to create custom module for PHP-Nuke portal system The URL of appeal form must also be generated when using the form. For example, if we want to invoke the form from a form, we use a code like the following: Code: <form action="modules.php">. <input type="hidden" name="op" value="modload"> <input type="hidden" name="name" value="Daily_Horoscope"> <input type="hidden" name="file" value="index"> <input type="hidden" name="func" value="one"> ... </ Form> ![]() |
#6
| |||
| |||
Re: How to create custom module for PHP-Nuke portal system As above members said, the module code is in the file modules / Daily_Horoscope / index.php. The rules for encoding modules require that the form has a intestate which prevent unauthorized access. So the code begins with: Code: if (eregi ("modules.php", $ PHP_SELF)) { die ("You can not access this file ..."); Directly } The body of the first module implements a function for selecting the options that provides: $ Index = 1 // 3 columns include ("header.php"); OpenTable (); switch ($ fn) { case "detail": close (); break; default: list (); break; } CloseTable (); include ("footer.php"); Code: function list () { $ Q = mysql_query ("select from horoscope sign order by order"); echo "<h1 align='center'> Signs of the Zodiac </ h1> \ n"; echo "Choose your sign. <br>; echo "<ul> \n"; while ($ r = mysql_fetch_row ($ q)) { echo "<li> <a href = 'modules.php. ? MODLOAD op = & name = Daily_Horoscope. "& File = index & & fn = det seg = $ r [0] '> $ r [0] </ a> </ li>"; } echo "</ ul>"; } |
#7
| |||
| |||
Re: How to create custom module for PHP-Nuke portal system As you might expect, is made to a database query, selecting all the signs of the horoscope. The thing to note is that the product is a list of URLs in accordance with those rules before. In particular, you use the fn to select detail. The link calls the module itself, citing as a sign you want to view. The code of the function that displays the details are as follows: Code: detail function () { global $ seq; $ Weather = mysql_fetch_row ( mysql_query ("select horoscope forecasts from WHERE symbol = '$ seq'")); echo "<h1 align='center'> Horoscope: $ seq </ h1>"; echo "<blockquote> <b> $ expected [0] </ b> </ blockquote>"; } |
![]() |
|
Tags: code, module, php, phpnuke, portal, url parameter |
Thread Tools | Search this Thread |
|
![]() | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to create a Custom Capsule that is a Custom Firmware with root on lacie 2big Network drive | Kane89 | Networking & Security | 8 | 06-05-2012 12:21 PM |
How to create maps on Portal 2? | Sherise | Video Games | 4 | 26-04-2011 10:36 AM |
Administrative Forms for PHP-Nuke portal system | Betelgeuse | Software Development | 5 | 12-01-2011 07:25 PM |
How to create Module in VB.NET? | RadhaV | Software Development | 3 | 19-02-2009 07:37 PM |
Re: Outlook MAPI32.DLL Error How to Fix It /Nuke C:\Windows\System | Owala | Vista Setup and Install | 1 | 19-03-2007 03:22 AM |