mirror of
https://gitlab.com/hashborgir/d2tools.git
synced 2025-10-13 16:34:23 -05:00
DC6 to PNG item conversion. Read in order from docpath,d2modder img path
This commit is contained in:
@@ -57,7 +57,7 @@ if (!empty($_POST)) {
|
||||
$path = rtrim($_POST['path'], "\\");
|
||||
$path = str_replace("\\", "\\\\", $path);
|
||||
$modpath = $path;
|
||||
$savePath = $path . '\\\\save\\\\';
|
||||
$savePath = $path . '\\\\save\\\\';
|
||||
$tbl = $path.'\\\\data\\\\local\\\\lng\\\\eng\\\\';
|
||||
|
||||
$path .= '\\\\data\\\\global\\\\excel\\\\';
|
||||
@@ -87,7 +87,9 @@ ERROR: INVALID PATH</h1></center>';
|
||||
// set this mod to active mod in session
|
||||
$_SESSION['path'] = $path;
|
||||
$_SESSION['tbl'] = $tbl;
|
||||
$_SESSION['savepath'] = $savePath;
|
||||
$_SESSION['savepath'] = $savePath;
|
||||
$_SESSION['docpath'] = 'docs/'.$_SESSION['modname'];
|
||||
$_SESSION['modpath'] = $modpath;
|
||||
// Don't yell at me, security is the least of my considerations atm
|
||||
// check modname in db
|
||||
$sql = "SELECT * FROM D2Modder WHERE modname=?";
|
||||
|
@@ -150,4 +150,43 @@ function print_mem()
|
||||
|
||||
echo 'The script is now using: <strong>' . round($mem_usage / 1024) . 'KB</strong> of memory.<br>';
|
||||
echo 'Peak usage: <strong>' . round($mem_peak / 1024) . 'KB</strong> of memory.<br><br>';
|
||||
}
|
||||
|
||||
|
||||
function rcopy($src, $dst) {
|
||||
// open the source directory
|
||||
$dir = opendir($src);
|
||||
// Make the destination directory if not exist
|
||||
@mkdir($dst);
|
||||
// Loop through the files in source directory
|
||||
while( $file = readdir($dir) ) {
|
||||
if (( $file != '.' ) && ( $file != '..' )) {
|
||||
if ( is_dir($src . '/' . $file) )
|
||||
{
|
||||
rcopy($src . '/' . $file, $dst . '/' . $file);
|
||||
}
|
||||
else {
|
||||
copy($src . '/' . $file, $dst . '/' . $file);
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir($dir);
|
||||
}
|
||||
|
||||
|
||||
function rrmdir($src) {
|
||||
$dir = opendir($src);
|
||||
while(false !== ( $file = readdir($dir)) ) {
|
||||
if (( $file != '.' ) && ( $file != '..' )) {
|
||||
$full = $src . '/' . $file;
|
||||
if ( is_dir($full) ) {
|
||||
rrmdir($full);
|
||||
}
|
||||
else {
|
||||
unlink($full);
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir($dir);
|
||||
rmdir($src);
|
||||
}
|
@@ -62,6 +62,12 @@
|
||||
</style>
|
||||
<script src="/res/jquery-3.6.0.min.js"></script>
|
||||
<script src="/res/bootstrap.bundle.min.js"></script>
|
||||
<script>
|
||||
modpath = "<?php echo $_SESSION['modpath']; ?>";
|
||||
modname = "<?php echo $_SESSION['modname']; ?>";
|
||||
docpath = "<?php echo $_SESSION['docpath']; ?>";
|
||||
</script>
|
||||
|
||||
<script src="/res/app.js"></script>
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user