-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain-thumbnail-4.php
More file actions
29 lines (29 loc) · 1.02 KB
/
main-thumbnail-4.php
File metadata and controls
29 lines (29 loc) · 1.02 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
<?php
include("config.php");
$q = $_GET['q'];
function directory_name_from_title($title) {
$title = preg_replace('/[^a-zA-Z0-9\s]/', '', $title);
$title = preg_replace('/\s+/', '-', $title);
$title = strtolower($title);
return $title;
}
function generate_thumbnail($q) {
include("config.php");
$q = "SELECT * FROM entry ORDER BY upload_date DESC LIMIT " . $q;
function thumbnail_lookup($h, $u, $p, $d, $q) {
$entry_thumbnail = [];
$c = mysqli_connect($h, $u, $p, $d);
if (!$c) {exit("Something went not right: " . mysqli_connect_error());}
$q = mysqli_query($c, $q);
while($row = mysqli_fetch_assoc($q)) {
$title = $row["title"].
$desc = $row["description"];
$url = directory_name_from_title($title);
include("entry-thumbnail-template.php");
}
mysqli_close($c);
}
thumbnail_lookup($h, $u, $p, $d, $q);
}
generate_thumbnail($q);
?>