Skip to content

Commit

Permalink
Make all PATH declarations consistent to project root.
Browse files Browse the repository at this point in the history
  • Loading branch information
beporter committed Oct 24, 2021
1 parent 50798ac commit d4e9b78
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 14 deletions.
8 changes: 5 additions & 3 deletions admin/index.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<?php
define('PATH', dirname(__FILE__));
if(!defined('PATH')) {
define('PATH', dirname(dirname(__FILE__)));
}

include PATH . "/../cgi-bin/db_start.php";
include PATH . "/cgi-bin/db_start.php";
session_start();

$artist_icon_query = $pdo->query("SELECT icon FROM artists ORDER BY icon ASC");
Expand Down Expand Up @@ -435,4 +437,4 @@ function bounceOut(){ header("Location: /admin/"); exit; }
</script>
</body>
</html>
<?php include PATH . "/../cgi-bin/db_end.php"; ?>
<?php include PATH . "/cgi-bin/db_end.php"; ?>
4 changes: 3 additions & 1 deletion contribute.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php
define('PATH', dirname(__FILE__));
if(!defined('PATH')) {
define('PATH', dirname(__FILE__));
}
include PATH . "/cgi-bin/db_start.php";
?>
<!DOCTYPE html>
Expand Down
4 changes: 3 additions & 1 deletion fullmap.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php
define('PATH', dirname(__FILE__));
if(!defined('PATH')) {
define('PATH', dirname(__FILE__));
}

include PATH . "/cgi-bin/db_start.php";

Expand Down
6 changes: 4 additions & 2 deletions includes/magic.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
<div class="downcontainer">
<a class="main" href="/supporters">About Us</a>
<div class="downpanel"><?php
define('PATH', dirname(__FILE__));
if(!defined('PATH')) {
define('PATH', dirname(dirname(__FILE__)));
}

include PATH . "/../cgi-bin/db_start.php";
include PATH . "/cgi-bin/db_start.php";

$navdata = $pdo->query("SELECT url_slug, name FROM dmillar_cartography.artists ORDER BY name ASC");
if ($navdata->rowCount() > 0) {
Expand Down
4 changes: 3 additions & 1 deletion index.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php
define('PATH', dirname(__FILE__));
if(!defined('PATH')) {
define('PATH', dirname(__FILE__));
}

include PATH . "/cgi-bin/db_start.php";

Expand Down
4 changes: 3 additions & 1 deletion profile.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php
define('PATH', dirname(__FILE__));
if(!defined('PATH')) {
define('PATH', dirname(__FILE__));
}
include PATH . "/cgi-bin/db_start.php";

if ($_REQUEST['artist']) {
Expand Down
4 changes: 3 additions & 1 deletion scripts/load_authors.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php
define('PATH', dirname(__FILE__) . '/..');
if(!defined('PATH')) {
define('PATH', dirname(dirname(__FILE__) ));
}

include PATH . "/cgi-bin/db_start.php";

Expand Down
8 changes: 5 additions & 3 deletions scripts/load_morphs.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
<?php
define('PATH', dirname(__FILE__));
if(!defined('PATH')) {
define('PATH', dirname(dirname(__FILE__)));
}
$map_type = intval($_POST['map_kind']);
$map_type = ($map_type > 0) ? $map_type : 1;
$datafile = PATH . "/datacache/" . $map_type . ".json";
if (file_exists($datafile) && (time() - filemtime($datafile) >= 60 * 60 *24 * 5)) {
include($datafile);
} else {
include PATH . "/../cgi-bin/db_start.php";
include PATH . "/cgi-bin/db_start.php";
$map_type_phr = ($map_type == 3) ? "IN (1,2,3)" : "= ". $map_type;

$query = "SELECT id, image, artist_id, tile_type FROM tiles WHERE map_type ".$map_type_phr." AND approved = 1";
Expand All @@ -28,7 +30,7 @@
echo '';
}

include PATH . "/../cgi-bin/db_end.php";
include PATH . "/cgi-bin/db_end.php";
echo $our_json;
}
?>
4 changes: 3 additions & 1 deletion supporters-all.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php
define('PATH', dirname(__FILE__));
if(!defined('PATH')) {
define('PATH', dirname(__FILE__));
}
include PATH . "/cgi-bin/db_start.php";
?>
<!DOCTYPE html>
Expand Down

0 comments on commit d4e9b78

Please sign in to comment.