minor fixes
This commit is contained in:
parent
daace699a6
commit
2ce4424db7
20 changed files with 674 additions and 621 deletions
123
docs/meta.php
123
docs/meta.php
|
@ -1,61 +1,63 @@
|
|||
<?php
|
||||
require(__DIR__ . "/../libs/page.php");
|
||||
require(__DIR__ . "/../libs/form.php");
|
||||
require(__DIR__ . "/../libs/comment.php");
|
||||
|
||||
$roles = array();
|
||||
|
||||
page_header();
|
||||
|
||||
// this is a mess
|
||||
function get_handler() {
|
||||
global $db;
|
||||
global $username;
|
||||
global $user;
|
||||
global $bio;
|
||||
global $followers;
|
||||
global $following;
|
||||
global $roles;
|
||||
|
||||
// there is 100% a better way to do this but i need to test
|
||||
if (!array_key_exists('id',$_GET)) {
|
||||
die();
|
||||
}
|
||||
|
||||
$user = $_GET['id'];
|
||||
|
||||
if (array_key_exists('type',$_GET)) {
|
||||
$type = $_GET['type'];
|
||||
if ($type == 'follow') {
|
||||
follow();
|
||||
} else if ($type == 'settings') {
|
||||
settings();
|
||||
}
|
||||
}
|
||||
|
||||
$stmt = $db->prepare("SELECT * FROM main.user WHERE UPPER(username) LIKE UPPER(?)"); //weirdly, this requires a schema name
|
||||
$stmt->execute([$user]);
|
||||
|
||||
$result = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
$stmt = $db->prepare("SELECT * FROM main.follow WHERE target = ?");
|
||||
$stmt->execute([$user]);
|
||||
|
||||
$following = $stmt->fetchAll(PDO::FETCH_DEFAULT);
|
||||
|
||||
$stmt = $db->prepare("SELECT * FROM main.follow WHERE username = ?");
|
||||
$stmt->execute([$user]);
|
||||
|
||||
$followers = $stmt->fetchAll(PDO::FETCH_DEFAULT);
|
||||
require(__DIR__ . "/../libs/page.php");
|
||||
require(__DIR__ . "/../libs/form.php");
|
||||
require(__DIR__ . "/../libs/comment.php");
|
||||
|
||||
$roles = array();
|
||||
|
||||
page_header();
|
||||
|
||||
// this is a mess
|
||||
function get_handler()
|
||||
{
|
||||
global $db;
|
||||
global $username;
|
||||
global $user;
|
||||
global $bio;
|
||||
global $followers;
|
||||
global $following;
|
||||
global $roles;
|
||||
|
||||
// there is 100% a better way to do this but i need to test
|
||||
if (!array_key_exists('id', $_GET)) {
|
||||
die();
|
||||
}
|
||||
get_handler();
|
||||
//todo: rewrite
|
||||
|
||||
$user = $_GET['id'];
|
||||
|
||||
if (array_key_exists('type', $_GET)) {
|
||||
$type = $_GET['type'];
|
||||
if ($type == 'follow') {
|
||||
follow();
|
||||
} elseif ($type == 'settings') {
|
||||
settings();
|
||||
}
|
||||
}
|
||||
|
||||
$stmt = $db->prepare("SELECT * FROM main.user WHERE UPPER(username) LIKE UPPER(?)"); //weirdly, this requires a schema name
|
||||
$stmt->execute([$user]);
|
||||
|
||||
$result = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
$stmt = $db->prepare("SELECT * FROM main.follow WHERE target = ?");
|
||||
$stmt->execute([$user]);
|
||||
|
||||
$following = $stmt->fetchAll(PDO::FETCH_DEFAULT);
|
||||
|
||||
$stmt = $db->prepare("SELECT * FROM main.follow WHERE username = ?");
|
||||
$stmt->execute([$user]);
|
||||
|
||||
$followers = $stmt->fetchAll(PDO::FETCH_DEFAULT);
|
||||
}
|
||||
get_handler();
|
||||
//todo: rewrite
|
||||
?>
|
||||
|
||||
<h2>Following</h2>
|
||||
|
||||
<?php
|
||||
foreach ($following as $user) { $usern = $user['username']; ?>
|
||||
<?php
|
||||
foreach ($following as $user) {
|
||||
$usern = $user['username']; ?>
|
||||
<div class='comment'>
|
||||
<div class="avatar">
|
||||
<img src="/pfp/<?php echo $usern ?>.png" class="avatar-img">
|
||||
|
@ -69,14 +71,15 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
<h2>Followers</h2>
|
||||
|
||||
<?php
|
||||
foreach ($followers as $user) { $usern = $user['target']; ?>
|
||||
<?php
|
||||
foreach ($followers as $user) {
|
||||
$usern = $user['target']; ?>
|
||||
<div class='comment'>
|
||||
<div class="avatar">
|
||||
<img src="/pfp/<?php echo $usern ?>.png" class="avatar-img">
|
||||
|
@ -90,9 +93,9 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
page_footer();
|
||||
<?php
|
||||
page_footer();
|
||||
?>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue