• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

Max Button for fleet and defence pages

Status
Not open for further replies.
Joined
Jan 1, 2009
Messages
384
Reaction score
20

AdriaN401MasteR - Max Button for fleet and defence pages - RaGEZONE Forums
Hi there O-game lovers,

I'm sorry I haven't posted any tutorial in the last couple of weeks/months but I had some problems and some things I had to solve.

Let's stop talking and start working.



1. Open FleetBuildingPage.php ( you should know where that is.. well anyway.. includes/functions )

2. Search for:
PHP:
// Case nombre d'elements a construire
                $PageTable .= "<th class=k>";
                // Si ... Et Seulement si je peux construire je mets la p'tite zone de saisie
                if ($CanBuildOne) {
                    $TabIndex++;                    $PageTable .= 
"<input type=text name=fmenge[".$Element."] alt='".$lang['tech'][$Element]."' size=16 maxlength=15 value=0 tabindex=".$TabIndex.">";
Remember that if you are looking for the exact match then there are 80% chances your will fail.

3. Add AFTER that code:
PHP:
$maxElement = GetMaxConstructibleElements($Element, $CurrentPlanet);
                    if ($maxElement > MAX_FLEET_OR_DEFS_PER_ROW) 
$maxElement = MAX_FLEET_OR_DEFS_PER_ROW; 
                    $PageTable .= "<br><a href='javascript:' 
onclick=\"document.getElementsByName('fmenge[".$Element."]')[0].value = '$maxElement';\">(Max : {$maxElement})</a>";

4. Save and close.

5. Open DefensesBuildingPage.php ( includes/functions )

6. Search for:
PHP:
// Si ... Et Seulement si je peux construire je mets la p'tite zone de saisie
                if ($CanBuildOne) {
                    $InQueue = strpos ( $CurrentPlanet['b_hangar_id'], $Element.",");
                    $IsBuild = ($CurrentPlanet[$resource[407]] >= 1) ? true : false;
                    $BuildIt = true;
                    if ($Element == 407 || $Element == 408) {
                        $BuildIt = false;
                        if ( $InQueue === false && !$IsBuild) {
                            $BuildIt = true;
                        }
                    }

                    if ( !
$BuildIt ) {
                        $PageTable .= "<font color=\"red\">".$lang['only_one']."</font>";
                    } else {
                        $TabIndex++;
Again, might not be the exact match.

7. Add after it:
PHP:
$maxElement = GetMaxConstructibleElements($Element, $CurrentPlanet);
                    if ($maxElement > MAX_FLEET_OR_DEFS_PER_ROW) $maxElement 
= MAX_FLEET_OR_DEFS_PER_ROW; 
                        $PageTable .= "<br><a href='javascript:' 
onclick=\"document.getElementsByName('fmenge[".$Element."]')[0].value = '$maxElement';\">(Max : {$maxElement})</a>";

8. Save and close.

9. You should also do this step. Open GetMaxConstructibleElements.php and go to the bottom.

10. Insert above:
PHP:
return $MaxElements;
The following code:
PHP:
    if ($maxElement > MAX_FLEET_OR_DEFS_PER_ROW) $maxElement = MAX_FLEET_OR_DEFS_PER_ROW;

I believe that the code is clear and you can see what each line does.

I hope this helps :blush:.

Greetings,
Angel
 
Last edited:
Skilled Illusionist
Joined
Oct 28, 2008
Messages
379
Reaction score
47
Or you can download the files i gave someone in the help section ;p
But still nice guide!
 
Joined
Jan 1, 2009
Messages
384
Reaction score
20
Or you can do that of course...

Depends if you already have some changes made on those files and you want to keep them :-?
 
Newbie Spellweaver
Joined
Aug 26, 2009
Messages
56
Reaction score
1
Thank you! I was needing this! Thank you very much!
 
Status
Not open for further replies.
Back
Top