-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathview.php
More file actions
79 lines (66 loc) · 2.11 KB
/
view.php
File metadata and controls
79 lines (66 loc) · 2.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<?php
session_start();
if (!isset($_SESSION['id'])) {
echo "<script>location.href='login.php';</script>";
exit;
}
// Berapa yang di load per halaman?
$load = 15;
require_once 'resize.php'; // Sertakan file resize.php
$dir = "E:/USER/Pictures/Wallpaper/";
$thumbDir = "thumbnails/"; // Direktori untuk menyimpan gambar thumbnail
// Mencari semua file dengan ekstensi tertentu (misalnya .jpg)
$files = glob($dir . "*.{jpg,png,jpeg}", GLOB_BRACE);
// Membuat tabel virtual dalam memori
$fileTable = [];
// Memasukkan setiap nama file ke dalam tabel virtual
foreach ($files as $file) {
$fileTable[] = basename($file);
}
// Membuat thumbnail jika belum ada
foreach ($fileTable as $file) {
$source = $dir . $file;
$destination = $thumbDir . $file;
if (!file_exists($destination)) {
resizeImage($source, $destination, 720, 720); // Mengubah ukuran gambar ke 200x200
// atau menggunakan cropImage
// cropImage($source, $destination, 200, 200); // Membuat thumbnail ukuran 200x200
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style.css">
<title>PC File</title>
<link rel="icon" type="image/x-icon" href="img/favicon.ico">
</head>
<body>
<div class="wrapper">
<nav>
<div class="logo"><img src="img/logo.png" alt="logo"></div>
<div class="file">
<span class="kategori">Wallpaper</span>
<!-- <span class="kategori">Video</span> -->
</div>
</nav>
<main>
<?php
require_once "conten.php";
?>
</main>
<footer>
<div class="media">
<div class="instagram"></div>
<div class="whatsapp"></div>
<div class="github"></div>
</div>
<div class="coppy">
<span>Copyright© 2024 Joko Purnomo</span> <a href="https://www.freepik.com">Icon by Freepik</a>
</div>
</footer>
</div>
</body>
</html>