Misc done, working copy, few bugs remain in html, and need to clean up code

This commit is contained in:
Hash Borgir 2022-03-28 00:38:41 -06:00
parent a041997dc4
commit 8a98f51445
11 changed files with 5895 additions and 65 deletions

View File

@ -45,7 +45,7 @@ ini_set('max_execution_time', '0');
*/
$title = '<span style="color: #880000">D2</span> Modder';
$author = " HashCasper";
$version = '<span style="color: #aaa">5.1.1 beta ';
$version = '<span style="color: #aaa">5.1.2 beta ';
define('APP_DB', "D2Modder.db");

View File

@ -194,6 +194,7 @@
width: 100%;
}
body {
overflow-x: hidden; /* Hide scrollbars */
}
@ -216,6 +217,7 @@ body {
$('.utable').dataTable();
$('.gemtable').dataTable();
$('.rtable').dataTable();
// $('.mtable').dataTable();
userAgent = window.navigator.userAgent
@ -252,7 +254,10 @@ body {
<li class="nav-item">
<a class="nav-link btn btn-danger" target="_blank" href="uniqueitems.html">Unique Items</a>
</li>
</ul>
<li class="nav-item">
<a class="nav-link btn btn-info" target="_blank" href="misc.html">Misc Items</a>
</li>
</ul>
</div>
</nav> <table border=1 class="cubetable">
<thead>

View File

@ -194,6 +194,7 @@
width: 100%;
}
body {
overflow-x: hidden; /* Hide scrollbars */
}
@ -253,7 +254,10 @@ body {
<li class="nav-item">
<a class="nav-link btn btn-danger" target="_blank" href="uniqueitems.html">Unique Items</a>
</li>
</ul>
<li class="nav-item">
<a class="nav-link btn btn-info" target="_blank" href="misc.html">Misc Items</a>
</li>
</ul>
</div>
</nav> <table border=1 class="gemtable">
<thead>

View File

@ -205,9 +205,12 @@ $(document).ready(function() {
<li class="nav-item">
<a class="nav-link btn btn-warning" target="_blank" href="uniqueitems.html">Unique Items</a>
</li>
<li class="nav-item">
<a class="nav-link btn btn-warning" target="_blank" href="missc.html">Misc Items</a>
</li>
<li class="nav-item">
<a class="nav-link btn btn-warning" target="_blank" href="changelog.html">Changelog</a>
</li>
</li>
</ul>
</div>
</nav>

5728
docs/ironman-dev/misc.html Normal file

File diff suppressed because it is too large Load Diff

View File

@ -194,6 +194,7 @@
width: 100%;
}
body {
overflow-x: hidden; /* Hide scrollbars */
}
@ -216,6 +217,7 @@ body {
$('.utable').dataTable();
$('.gemtable').dataTable();
$('.rtable').dataTable();
// $('.mtable').dataTable();
userAgent = window.navigator.userAgent
@ -252,7 +254,10 @@ body {
<li class="nav-item">
<a class="nav-link btn btn-danger" target="_blank" href="uniqueitems.html">Unique Items</a>
</li>
</ul>
<li class="nav-item">
<a class="nav-link btn btn-info" target="_blank" href="misc.html">Misc Items</a>
</li>
</ul>
</div>
</nav> <table class="rtable rw">
<thead>

View File

@ -194,6 +194,7 @@
width: 100%;
}
body {
overflow-x: hidden; /* Hide scrollbars */
}
@ -216,6 +217,7 @@ body {
$('.utable').dataTable();
$('.gemtable').dataTable();
$('.rtable').dataTable();
// $('.mtable').dataTable();
userAgent = window.navigator.userAgent
@ -252,7 +254,10 @@ body {
<li class="nav-item">
<a class="nav-link btn btn-danger" target="_blank" href="uniqueitems.html">Unique Items</a>
</li>
</ul>
<li class="nav-item">
<a class="nav-link btn btn-info" target="_blank" href="misc.html">Misc Items</a>
</li>
</ul>
</div>
</nav>
<table border=1 class="utable">

View File

@ -126,4 +126,6 @@ rbgr32
rbgr33
magharv
showkills
iforge
iforge
killcounter
soulcounter

View File

@ -514,7 +514,7 @@ EOT;
} else {
$ostr = implode("<br>", (array_reverse(explode('\n', $output["input $i"][0]))));
}
$htmlRow .= $ostr . "<br>";
if (str_contains($output["input $i"][1], "=")) {
$htmlRow .= $output["input $i"][1] . "<br>";
@ -658,8 +658,8 @@ EOT;
$htmlFinal .= $tableBottom . $htmlbottom;
// save file and redirect to it
//file_put_contents("$dir/cubemain.html", $htmlFinal);
//header("Location: docs/{$_SESSION['modname']}/cubemain.html");
file_put_contents("$dir/cubemain.html", $htmlFinal);
header("Location: docs/{$_SESSION['modname']}/cubemain.html");
}
if ($cmd == "getImages") {
@ -1015,19 +1015,24 @@ if ($cmd == 'genDocRunewords') {
}
if ($cmd == "genDocMisc") {
$sql = "SELECT misc.*,gems.code
$filter = "smh";
$sql = "SELECT DISTINCT misc.*,gems.code
FROM misc
LEFT JOIN gems ON misc.code = gems.code
WHERE gems.code IS NULL AND misc.spawnable != 0";
WHERE gems.code IS NULL AND misc.spawnable != 0
AND misc.namestr NOT LIKE '%$filter%'
";
$res = PDO_FetchAll($sql);
$res = array_reverse($res);
$tableTop = <<<EOT
<table border=1 class="mtable">
<thead>
<tr>
<th>Item</th>
<th>Stats</th>
<th>Properties</th>
</tr>
</thead>
<tbody>
@ -1035,78 +1040,81 @@ if ($cmd == "genDocMisc") {
$htmlFinal = null;
$htmlFinal = $htmltop . $tableTop;
$tr = null;
foreach ($res as $r) {
$data = null;
$stats = null;
$data['name'] = $strings[$r['namestr']];
if (str_contains($data['name'], "ÿc")) {
$p = "/ÿc[\d:;\/.]/i";
$data['name'] = preg_replace($p, "", $data['name']);
$data['spelldesc'] = preg_replace($p, "", $data['spelldesc']);
}
$name = array_reverse(explode('\n', $data['name']));
$data['name'] = (implode('<br>', $name));
// later display these in a li
$img = "/img/items/{$r['invfile']}.png";
if ($r['level']) {
$data['level'] = "Item Level: <span class=''>{$r['level']}</span>";
}
if ($r['levelreq']) {
$data['levelreq'] = "Required Level: <span class=''>{$r['levelreq']}</span>";
}
$data['level'] = "Level: <span class=''>{$r['level']}</span>";
$data['levelreq'] = "Level Required: <span class=''>{$r['levelreq']}</span>";
if ($r['rarity']) {
$data['rarity'] = $armorRack = "Can drop from Armor Racks.";
$data['rarity'] = $armorRack = "Can drop from Armor Racks";
}
if ($r['speed'] > 0) {
$data['speed'] = "Slow your character down.";
$data['speed'] = "Slows your character down";
}
if ($r['durability']) {
$data['durability'] = "Base durability: <span class=''>{$r['durability']}</span>";
}
if ($r['hasinv']) {
if ($r['gemapplytype'] == 0) {
$data['gemapplytype'] = "Gem Apply Type: <span class=''>Weapon</span>";
} else if ($r['gemapplytype'] == 1) {
$data['gemapplytype'] = "Gem Apply Type: <span class=''>Armor/Helm</span>";
} else if ($r['gemapplytype'] == 2) {
$data['gemapplytype'] = "Gem Apply Type: <span class=''>Shield</span>";
if ($r['gemapplytype'] == "0") {
$data['gemapplytype'] = "Socketing gives <span class='gold'>Weapon</span> stats";
} else if ($r['gemapplytype'] == "1") {
$data['gemapplytype'] = "Socketing gives <span class='gold'>Armor/Helm</span> stats";
} else if ($r['gemapplytype'] == "2") {
$data['gemapplytype'] = "Socketing gives <span class='gold'>Shield</span> stats";
}
}
if ($r['Transmogrify']) {
$data['Transmogrify'] = "Can right click transmogrify into <p> {$strings[$r['namestr']]}</p>";
$data['Transmogrify'] = "Can right click transmogrify into <p> {$strings[$r['TMogType']]}</p>";
$p = "/ÿc[\d:;\/.]/i";
$data['Transmogrify'] = preg_replace($p, "", $data['Transmogrify']);
$data['Transmogrify'] = str_replace('\n', "<br>", $data['Transmogrify']);
$transmogrify = array_reverse(explode('\n', $data['Transmogrify']));
$data['Transmogrify'] = (implode('<br>', $transmogrify));
}
if ($r['useable']) {
$data['useable'] = "Can be right clicked.";
if (!empty($r['useable'])) {
$data['useable'] = "Can be right clicked";
}
if ($r['throwable']) {
$data['throwable'] = "Can be thrown.";
$data['throwable'] = "Can be thrown";
}
if ($r['unique']) {
$data['unique'] = "Can only spawn as a unique item.";
}
if ($r['stackable']) {
$data['stackable'] = "Can be stacked on top of each other.";
$data['stackable'] = "Can be stacked";
}
if ($r['quest']) {
$data['quest'] = "Quest Itemstats";
$data['quest'] = "Quest Item";
}
if ($r['spelldesc']) {
$data['spelldesc'] = $strings[$r['spelldesc']];
if ($r['spelldesc']) {
$data['spelldesc'] = $strings[$r['spelldescstr']];
$p = "/ÿc[\d:;\/.]/i";
$data['spelldesc'] = preg_replace($p, "", $data['spelldesc']);
$spelldesc = array_reverse(explode('\n', $data['spelldesc']));
$data['spelldesc'] = (implode('<br>', $spelldesc));
}
if ($r['nameable']) {
$data['nameable'] = "<span class=''>Can be personalized by Anya</span>";
}
@ -1131,36 +1139,45 @@ if ($cmd == "genDocMisc") {
$stats['calc3'] = "{$r['calc3']}";
}
$data = array_filter($data);
$li = '';
foreach ($data as $d){
$li .= "<li>$d</li>";
}
$data = array_filter($data);
if($stats) $stat = array_filter($stats);
$tr .= <<<EOT
<tr>
<td><img style="height: 25%;" src="$img"><p>{$data['name']}</p><p>{$data['spelldesc']}</p></td>
<td style="min-width: 420px;font-family: Arial,Tahoma; font-weight: normal;">
<ul>
$li
</ul>
</td>
<td style="font-family: Arial,Tahoma">
<ul>
<li>{$stats['calc1']} {$stats['stat1']}</li>
<li>{$stats['calc2']} {$stats['stat2']}</li>
<li>{$stats['calc3']} {$stats['stat3']}</li>
<td style="background: black; font-weight: normal; text-align: center;">
<div style="margin-left: 40px;">
<img style="max-height: 200%;" src="$img" />
<p style="font-size: 1.5em;" class="">{$data['name']}</p>
</div>
<ul style="font-weight: normal; font-family:">
<li class="orange">{$data['level']}</li>
<li class="orange">{$data['levelreq']}</li>
<li class="text-success">{$data['rarity']}</li>
<li class="blue">{$data['speed']}</li>
<li class="blue">{$data['durability']}</li>
<li class="blue">{$data['gemapplytype']}</li>
<li class="blue">{$data['throwable']}</li>
<li class="blue">{$data['useable']}</li>
<li class="blue">{$data['unique']}</li>
<li class="blue">{$data['stackable']}</li>
<li class="text-info">{$data['Transmogrify']}</li>
<li class="text-secondary">{$data['quest']}</li>
<li class="text-info">{$data['nameable']}</li>
<li class="blue">{$data['spelldesc']}</li>
<li class="blue">{$stats['stat1']} <span class="gold" style="font-size: 1.25em;">{$stats['calc1']}</span></li>
<li class="blue">{$stats['stat2']} <span class="gold" style="font-size: 1.25em;">{$stats['calc2']}</span></li>
<li class="blue">{$stats['stat3']} <span class="gold" style="font-size: 1.25em;">{$stats['calc3']}</span></li>
</ul>
</p>
</td>
</tr>
EOT;
}
echo $htmlFinal . $tr . $tableBottom . $htmlbottom;
ob_flush();
$htmlFinal = $htmltop . $tableTop . $tr . $tableBottom . $htmlbottom;
file_put_contents("$dir/misc.html", $htmlFinal);
header("Location: docs/{$_SESSION['modname']}/misc.html");
}

57
src/tabs/Misc.php Normal file
View File

@ -0,0 +1,57 @@
<?php
/*
Copyright (C) 2021 Hash Borgir
This file is part of D2Modder
Redistribution and use in source and binary forms, with
or without modification, are permitted provided that the
following conditions are met:
* Redistributions of source code must retain the above
copyright notice, this list of conditions and the
following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the
following disclaimer in the documentation and/or other
materials provided with the distribution.
* This software must not be used for commercial purposes
* without my consent. Any sales or commercial use are prohibited
* without my express knowledge and consent.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY!
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
?>
<div style="text-align: center; margin-top: 20px;">
<div class="container">
<div class="form-group row">
<div class="" style="text-align: center; margin: 0 auto;">
<a style="margin-top: 60px; text-align: center;" target="_blank" href="/genDocs.php?cmd=genDocMisc" class="">
<img style="height: 100px;" class="img-fluid" src="/img/items/invbok.png"></a>
<img style="height: 100px;" class="img-fluid" src="/img/items/invkey.png"></a>
</div>
</div>
<!-- <a class="btn btn-warning" target="_blank" href="/genDocs.php?cmd=genDocCube">Generate</a> -->
<p>Misc Items</p>
</div>
</div>

View File

@ -197,6 +197,7 @@ $htmltop = <<<EOT
width: 100%;
}
body {
overflow-x: hidden; /* Hide scrollbars */
}
@ -256,7 +257,10 @@ body {
<li class="nav-item">
<a class="nav-link btn btn-danger" target="_blank" href="uniqueitems.html">Unique Items</a>
</li>
</ul>
<li class="nav-item">
<a class="nav-link btn btn-info" target="_blank" href="misc.html">Misc Items</a>
</li>
</ul>
</div>
</nav>
EOT;