Admin Modules Tweak for Default Nuke Main Menu

------------------------------------------------------
# For those that are hellbent on using the default menu
that comes with PHP-Nuke. Just do the following to make 
block-modules.php work with PHP-NUKE. #

# Please note if you already use a main menu which is 
manually edited, this tweak serves no purpose for you, 
this tweak was specifically designed for those who use 
the default menu (block-Modules.php) with PHP-NUKE. #
------------------------------------------------------

The first step is to manually add a row to the end of the
nuke_modules table. We will create an entry for url, 
which we will later use to input the preferred GT url of your module.
(i.e Topics modules preferred GT url would be topics.html)

OK, lets start by opening up what you edit your nuke database with,
most people use phpmyadmin, just open up your database and go into your 
nuke_modules table.

Add a row at the end with the following characteristics
Field/name: url
Type: varchar
Length: 255
Null: null
Default: NULL

You are done playing with the database now!

Next, We will make a few changes to the admin/modules/modules.php file.
You can either edit the file manually with the instruction *below or overwrite your existing file 
with the one provided in the GT-NExtGEn beta distribution. 
It is strongly preferred you make a backup of your current file before overwriting
or editing.
Lets Edit!

*Manual Instruction for admin/modules/modules.php:
Find:
	sql_query("insert into ".$prefix."_modules values (NULL, '$modlist[$i]', '$modlist[$i]', '0', '0', '1')", $dbi);
Replace With:
	sql_query("insert into ".$prefix."_modules values (NULL, '$modlist[$i]', '$modlist[$i]', '0', '0', '1', NULL)", $dbi);

Find:
function module_edit($mid) {
    global $prefix, $dbi;
    $main_m = sql_query("select main_module from ".$prefix."_main", $dbi);
    list($main_module) = sql_fetch_row($main_m, $dbi);
    $result = sql_query("select title, custom_title, view, inmenu from ".$prefix."_modules where mid='$mid'", $dbi);
    list($title, $custom_title, $view, $inmenu) = sql_fetch_row($result, $dbi); 

Replace With:
function module_edit($mid) {
    global $prefix, $dbi;
    $main_m = sql_query("select main_module from ".$prefix."_main", $dbi);
    list($main_module) = sql_fetch_row($main_m, $dbi);
    $result = sql_query("select title, custom_title, view, inmenu, url from ".$prefix."_modules where mid='$mid'", $dbi);
    list($title, $custom_title, $view, $inmenu, $url) = sql_fetch_row($result, $dbi);

Find:
	.""._CUSTOMMODNAME."</td><td>"
	."<input type=\"text\" name=\"custom_title\" value=\"$custom_title\" size=\"50\"></td></tr>";

Replace With:
	.""._CUSTOMMODNAME."</td><td>"
	."<input type=\"text\" name=\"custom_title\" value=\"$custom_title\" size=\"50\"></td></tr>"
        ."<tr><td>Preferred URL for GoogleTap:</td><td>"
        ."<input type=\"text\" name=\"url\" value=\"$url\" size=\"50\"></td></tr>";

Find:
function module_edit_save($mid, $custom_title, $view, $inmenu) {

Replace With:
function module_edit_save($mid, $custom_title, $view, $inmenu, $url) {

Find:
    case "module_edit_save":
    module_edit_save($mid, $custom_title, $view, $inmenu);
    break;

Replace With:
    case "module_edit_save":
    module_edit_save($mid, $custom_title, $view, $inmenu, $url);
    break;

You have completed editing the file, you are already halfway done!

Next we want to upload the block-GT_Modules.php block provided with the GT-NExtGEn beta distribution.

Be sure to add this block in your blocksadmin and activate it. You will notice this block looks identical to the default 
block-Modules.php, the only big difference is it only utilizes the url tweak we did above and displays the .html url of the module if we have defined it in for the module. 

Which brings us to our next step. Go to your modules administration (where you activate and deactivate modules)
click to edit any module you have in your list (**See below for Core Modules). In your edit screen for the module you selected you should now see the text box for entering your preferred GoogleTap URL. Just enter your .html equivalent URL for the module and click save. When the page reloads, your menu will now display your new URL. 

**The core modules already have .html equivalent URL's which exist, please use these URL's in your modules administration:
AvantGo Module = avantgo.html 
Content Module = content.html
Downloads Module = downloads.html 
Encyclopedia Module = encyclopedia.html
Feedback Module = feedback.html 
FAQ Module = faq.html
Forums Module = forums.html
Journal Module = journal.html
Members_List Module = members.html 
Private_Messages Module = messages.html 
Recommend_Us Module = recommend.html
Reviews Module = reviews.html
Search Module = search.html 
Sections Module = sections.html 
Statistics Module = stats.html 
Stories_Archive Module = archive.html 
Surveys Module = surveys.html 
Submit_News Module = submit.html 
Topics Module = topics.html 
Top Module = top.html 
Web_Links Module = links.html 
WebMail Module = webmail.html 
Your_Account Module = account.html 

The one last thing is to ensure that your modules entries have rewrite entries in your .htaccess file. You do no have to worry about the modules listed **above. They have already been done for you. 

An entry will look something like 
RewriteRule ^content.html modules.php?name=Content

The "content.html" part is the URL that we want displayed by GoogleTap. (It is also the preferred GoogleTap URL we entered in our modules administration)
The "modules.php?name=Content" part is the URL that is executed when we click on "content.html"

Just use this template to add your module entries:

Using the url you entered in modules administration, replace where it says (Your URL Name Here) with your url,
Using the module name it goes to in your modules folder, replace where it says (Your Module Name Here) with your module name. Be sure to type your module and url case sensitive (If it is the "News" module then put "News" not "news")
RewriteRule ^(Your URL Name Here).html modules.php?name=(Your Module Name Here)

Ok, once you have added all of your custom modules. You can save and upload the .htaccess file. 

You have completed the admin modules tweak for the automatic mainmenu. Congratulations.

----------------------------------------------------
# DONE! #
----------------------------------------------------