-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathphotos.php
121 lines (103 loc) · 4.31 KB
/
photos.php
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<?php
session_start();
include("important/db.php");
if (!isset($_SESSION["username"])) {
header("Location: ../user/login.php");
exit();
}
$username = $_GET['username'];
$icon = "photos";
?>
<?php
if (isset($_GET['trump'])) {
echo '<link rel="stylesheet" href="assets/css/trump.css">';
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Loogle Photos</title>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js"></script>
<link rel="stylesheet" href="assets/css/2013isamess.css">
<link rel="stylesheet" href="assets/css/2013indexres.css">
<link rel="stylesheet" href="assets/css/2013notes.css">
<link rel="stylesheet" href="assets/css/univesalcoolstuff.css">
<link rel="stylesheet" href="assets/css/headerfix.css">
<link rel="stylesheet" href="assets/css/2013profile_headerfix.css">
<link rel="stylesheet" href="assets/css/2013photos.css">
</head>
<body>
<?php require_once("inc/topstuffs.php") ?>
<!-- External CSS was not working for some reason on this one -->
<style>
#ronnieisnum1 {
position: relative;
top: 3px;
height: 37px;
right: 0px;
margin: auto;
}
.fromthehousewemadeourhome {
background: url(//web.archive.org/web/20130601001530im_/http://www.google.com/images/nav_logo124.png) no-repeat -36px -110px;
left: 0px;
position: relative;
margin: auto;
}
.sub-header .nav-tabs > li.active > a {
font-weight: bold;
border-bottom: 3px solid #007bff;
padding-bottom: 7px;
color: #000;
}
</style>
<div class="container" id="imagesContainer"></div>
<script>
$(document).ready(function() {
function fetchImages() {
const username = encodeURIComponent("<?php echo $username ?>");
$.getJSON("<?php echo $siteurl ?>/apiv1/fetch_photos.php?username=" + username, function(data) {
if (data && data.length > 0) {
let gallerySection = '<div class="gallery-section">' + '<div class="gallery">';
$.each(data, function(index, image) {
const sanitizedUrl = $('<div>').text(image.url).html();
gallerySection += '<div class="col-md-3">' +
'<div class="thumbnail">' +
'<img src="' + sanitizedUrl + '" alt="Image">' +
'</div>' +
'</div>';
});
gallerySection += '</div></div>';
$("#imagesContainer").html(gallerySection);
} else {
$("#imagesContainer").html('<div class="col-md-12 text-center error-message"><p>No images found.</p></div>');
}
}).fail(function() {
$("#imagesContainer").html('<div class="col-md-12 text-center error-message"><p>Failed to fetch images. Please try again later.</p></div>');
});
}
fetchImages();
});
</script>
<script>
$(document).ready(function() {
const sidebar = $('.sidebar');
const openSidebarButton = $('.photo-p-icon');
let sidebarOpen = false;
openSidebarButton.on('click', function() {
sidebarOpen = !sidebarOpen;
sidebar.css('transform', sidebarOpen ? 'translateX(0)' : 'translateX(-100%)');
});
$(document).on('click', function(event) {
if (sidebarOpen && !$(event.target).closest('.sidebar').length && !$(event.target).is(openSidebarButton)) {
sidebar.css('transform', 'translateX(-100%)');
sidebarOpen = false;
}
});
});
</script>
</body>
</html>