Skip to content

Commit

Permalink
fix some db includes
Browse files Browse the repository at this point in the history
  • Loading branch information
sunehs committed Aug 21, 2022
1 parent 50d7e32 commit 8522b67
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 7 deletions.
27 changes: 27 additions & 0 deletions inc/dl_all_recs.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php
include("../kopasitedb.php");
include("../functions.php");


// Prepare Tmp File for Zip archive
$file = tempnam("tmp", "zip");
$zip = new ZipArchive();
$zip->open($file, ZipArchive::OVERWRITE);

// Add contents
$result = mysql_query("SELECT time.RecData, level.LevelName, kuski.Kuski, time.Time FROM time, level, kuski WHERE time.LevelIndex = level.LevelIndex AND time.KuskiIndex = kuski.KuskiIndex AND time.TimeIndex > 41590 AND time.RecData != '' LIMIT 16000,1000");
while($row = mysql_fetch_array($result)){
$len = strlen($row['LevelName']) + strlen($row['Time']);
$remaining = min(15 - $len, 4);
$name = $row['LevelName'].substr($row['Kuski'], 0, $remaining).$row['Time'].'.rec';
$zip->addFromString($name, $row['RecData']);
}

// Close and send to users
$zip->close();
header('Content-Type: application/zip');
header('Content-Length: ' . filesize($file));
header('Content-Disposition: attachment; filename="recs.zip"');
readfile($file);
unlink($file);
?>
2 changes: 1 addition & 1 deletion inc/dl_lev.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
include("../../kopasitedb.php");
include("../kopasitedb.php");
include("../functions.php");
$levid = hax($_GET["lev"]);
$result = mysql_query("SELECT LevelIndex, LevelData, LevelName FROM level WHERE LevelIndex = '$levid'") or die(mysql_error());
Expand Down
2 changes: 1 addition & 1 deletion inc/dl_rec.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
include("../../kopasitedb.php");
include("../kopasitedb.php");
include("../functions.php");
include("../login.php");
$recid = hax($_GET["rec"]);
Expand Down
2 changes: 1 addition & 1 deletion inc/dl_secret_rec.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
include("../../kopasitedb.php");
include("../kopasitedb.php");
include("../functions.php");
include("../login.php");
include("vars.php");
Expand Down
2 changes: 1 addition & 1 deletion inc/dlfile.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
include("../../kopasitedb.php");
include("../kopasitedb.php");
include("../functions.php");
include("../login.php");

Expand Down
2 changes: 1 addition & 1 deletion inc/domimap.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
include("../../kopasitedb.php");
include("../kopasitedb.php");
include("../functions.php");
$lev = hax($_GET['lev']);

Expand Down
2 changes: 1 addition & 1 deletion inc/recalc.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
include("/home/kopaka/kopasitedb.php");
include("../kopasitedb.php");

$points = array(1 => 40, 2 => 30, 3 => 25, 4 => 22, 5 => 20, 6 => 18, 7 => 16, 8 => 14, 9 => 12, 10 => 11, 11 => 10, 12 => 9, 13 => 8, 14 => 7, 15 => 6, 16 => 5, 17 => 4, 18 => 3, 19 => 2, 20 => 1);
//$result = mysql_query("SELECT * FROM updateschedule");
Expand Down
2 changes: 1 addition & 1 deletion inc/updateschedule.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
include("/home/kopaka/kopasitedb.php");
include("../kopasitedb.php");

$points = array(1 => 40, 2 => 30, 3 => 25, 4 => 22, 5 => 20, 6 => 18, 7 => 16, 8 => 14, 9 => 12, 10 => 11, 11 => 10, 12 => 9, 13 => 8, 14 => 7, 15 => 6, 16 => 5, 17 => 4, 18 => 3, 19 => 2, 20 => 1);
$result = mysql_query("SELECT updateschedule.LevelIndex, level.LevelIndex, levelpack.LevelPackCategory, level.LevelPackIndex FROM updateschedule, level, levelpack WHERE updateschedule.LevelIndex = level.LevelIndex AND level.LevelPackIndex = levelpack.LevelPackIndex");
Expand Down

0 comments on commit 8522b67

Please sign in to comment.