-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexplore.php
More file actions
44 lines (41 loc) · 1.47 KB
/
explore.php
File metadata and controls
44 lines (41 loc) · 1.47 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
<?php
require_once 'includes/database.php';
require_once 'includes/repository.php';
// Initialize database if needed
initDatabase();
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>GitPlace</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<?php include 'includes/header.php'; ?>
<div class="repository-list">
<h1>Public Repositories</h1>
<?php
$publicRepos = listPublicRepositories();
if (empty($publicRepos)): ?>
<p>No public repositories available.</p>
<?php else: ?>
<div class="grid-container">
<?php foreach ($publicRepos as $repo): ?>
<div class="repo-card">
<a href="files.php?user=<?php echo urlencode($repo['username']); ?>&repo=<?php echo urlencode($repo['name']); ?>">
<?php echo htmlspecialchars($repo['username'] . '/' . $repo['name']); ?>
</a>
<?php if ($repo['description']): ?>
<p class="repo-description">
<?php echo htmlspecialchars($repo['description']); ?>
</p>
<?php endif; ?>
</div>
<?php endforeach; ?>
</div>
<?php endif; ?>
</div>
<?php include 'includes/footer.php'; ?>
</body>
</html>