Archived
1
0
Disbranĉigi 0
Ĉi tiu deponejo arĥiviĝis je 2024-01-28. Vi povas vidi kaj elŝuti dosierojn, sed ne povas puŝi nek raporti problemojn nek tirpeti.
blagoblag/u/index.php

62 lines
1.8 KiB
PHP
Raw Normal View History

2019-02-11 10:44:20 -06:00
<?php
2019-02-13 20:43:32 -06:00
/* This file is free software: you can redistribute it and/or modify
it under the terms of version 3 of the GNU Affero General Public
License as published by the Free Software Foundation.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details. */
2019-02-15 08:32:58 -06:00
2019-02-20 08:04:55 -06:00
$depth = "../";
$mark = "u_index";
2019-02-18 23:24:07 -06:00
$title = "Death";
2019-02-20 08:04:55 -06:00
include "../res/lib/load.php";
2019-02-11 10:44:20 -06:00
2019-02-15 08:32:58 -06:00
// -------------------------------------
$id = $_GET['id'] ?? user_name_to_id($_GET['name']);
$name = user_name($id);
// -------------------------------------
2019-02-20 08:04:55 -06:00
if (empty($_GET['id']) && empty($_GET['name'])) {
root_redirect('u/list/');
} else if (!is_user_id($id) && empty($name)) {
2019-02-15 08:32:58 -06:00
general_error("It looks like that isn't a real user.");
}
2019-02-18 23:24:07 -06:00
// -------------------------------------
global $user_posts; $user_posts = user_posts($id);
global $user_post; $user_post = array();
// this is used to make associative array for a user's posts, based on
// both post ID and post title
$push_post_data = function($post_id) {
$title = post_title($post_id);
$GLOBALS['user_post'][$post_id] = post_data($post_id);
$GLOBALS['user_post'][$title] = post_data($post_id);
};
array_map($push_post_data, $user_posts);
// -----------------
2019-02-13 20:43:32 -06:00
2019-02-20 08:04:55 -06:00
$local_exports = array('user_id' => $id,
'user_full_name' => unscrub(user_full_name($id)),
'user_name' => $name,
2019-02-23 01:15:14 -06:00
'user_bio' => unscrub(user_biography($id)),
2019-02-20 08:04:55 -06:00
'user_email' => user_email($id),
'user_website' => user_website($id),
2019-03-05 08:33:32 -06:00
'user_class' => user_class($id),
2019-02-18 23:24:07 -06:00
'user_posts' => $user_posts,
'user_post' => $user_post);
2019-02-13 20:43:32 -06:00
2019-02-15 08:32:58 -06:00
// -------------------------------------
2019-02-13 20:43:32 -06:00
2019-02-18 23:24:07 -06:00
display_page($mark, $depth, $title, $local_exports);
2019-02-11 10:44:20 -06:00
?>