Browse Source

Move image directories into images/ subdirectory

k4be 4 days ago
parent
commit
eaf142d6ae
4 changed files with 10 additions and 8 deletions
  1. 6 4
      .gitignore
  2. 1 1
      admin.php
  3. 2 2
      include/config-example.php
  4. 1 1
      simg.php

+ 6 - 4
.gitignore

@@ -1,6 +1,8 @@
-*/*.jpg
-*/*.JPG
-*/*.png
-*/*.gif
+images/*/*.jpg
+images/*/*.JPG
+images/*/*.jpeg
+images/*/*.JPEG
+images/*/*.png
+images/*/*.gif
 miniatury/
 miniatury/
 include/config.php
 include/config.php

+ 1 - 1
admin.php

@@ -28,7 +28,7 @@ function admin_dir_fill() {
 	$dirlist = [];
 	$dirlist = [];
 	while ($file = readdir($dir_handle)) {
 	while ($file = readdir($dir_handle)) {
 		if(!is_dir($path.$file)) continue;
 		if(!is_dir($path.$file)) continue;
-		if (in_array($file, array('miniatury', 'include', '.git', '.', '..')))
+		if ($file[0] === '.')
 			continue;
 			continue;
 		$dirlist[] = array('name' => $file, 'date' => filemtime($path.$file));
 		$dirlist[] = array('name' => $file, 'date' => filemtime($path.$file));
 	}
 	}

+ 2 - 2
include/config-example.php

@@ -9,9 +9,9 @@ $config = [
 	'passwd' => 'password',	// mysql password
 	'passwd' => 'password',	// mysql password
 	'db' => 'database',	// database name
 	'db' => 'database',	// database name
 	'port' => '3306',	// mysql port
 	'port' => '3306',	// mysql port
-	'basedir' => '/home/user/public_html/obrazki/',	// filesystem path (keep the trailing /)
+	'basedir' => '/home/user/public_html/obrazki/images/',	// filesystem path to image dirs subdir (keep the trailing /)
 	'basepath' => '/obrazki/',	// webroot path for scripts (keep the trailing /)
 	'basepath' => '/obrazki/',	// webroot path for scripts (keep the trailing /)
-	'imagepath' => '/obrazki/',	// webroot path for image dirs (keep the trailing /)
+	'imagepath' => '/obrazki/images/',	// webroot path for image dirs (keep the trailing /)
 	'thumbnailpath' => '/obrazki/miniatury/',	// webroot path for thumbnails (keep the trailing / and do not change for now)
 	'thumbnailpath' => '/obrazki/miniatury/',	// webroot path for thumbnails (keep the trailing / and do not change for now)
 	'thumbnailsize' => 70,		// thumbnail width in pixels, do not change for now)
 	'thumbnailsize' => 70,		// thumbnail width in pixels, do not change for now)
 	'timezone' => 'Europe/Warsaw',	// timezone for date display
 	'timezone' => 'Europe/Warsaw',	// timezone for date display

+ 1 - 1
simg.php

@@ -2,7 +2,7 @@
 // The file
 // The file
 $dir = @$_GET['dir'];
 $dir = @$_GET['dir'];
 $file = @$_GET['file'];
 $file = @$_GET['file'];
-$filename = $dir . '/'. $file;
+$filename = 'images/' . $dir . '/'. $file;
 if(@$_GET['w']==0) {
 if(@$_GET['w']==0) {
 	$new_width=70;
 	$new_width=70;
 } else {
 } else {