Move the original PHP site into legacy/

The PHP sources, templates and old jQuery-based scripts move unchanged into
legacy/ for reference. Shared assets (media/, images/, favicon.ico, the
default avatar) stay at the repository root.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-17 02:15:05 +02:00
co-authored by Claude Opus 5.5
parent 4bc486fd92
commit 664d8c6117
87 changed files with 0 additions and 0 deletions
+57
View File
@@ -0,0 +1,57 @@
<?php
/*
The UserList class loads a number of users from the database, specified by a page
*/
require_once( 'lib/config.php' );
require_once( 'lib/db.php' );
class UserList {
protected $page = 0;
protected $usersPerPage = 0;
protected $totalResults = 0;
public $users = array();
public $pages = array();
public function __construct( $usersPerPage ) {
$this->usersPerPage = abs(intval($usersPerPage));
}
public function setPage( $page ) {
$page = intval($page);
$this->page = $page > 0 ? $page - 1 : 0;
}
public function load() {
$this->users = DB::query(
'SELECT SQL_CALC_FOUND_ROWS
UNIX_TIMESTAMP( u.registered ) as registered,
u.name, u.score, u.images, u.avatar, u.website
FROM '.TABLE_USERS.' u
WHERE valid = 1
GROUP BY u.id
ORDER BY u.id ASC
LIMIT :1, :2',
$this->page * $this->usersPerPage,
$this->usersPerPage
);
$this->totalResults = DB::foundRows();
// compute previoues, current and next page
if( $this->totalResults > 0 ) {
$this->pages['current'] = $this->page+1;
$this->pages['total'] = ceil($this->totalResults / $this->usersPerPage);
if( $this->page > 0 ) {
$this->pages['prev'] = $this->page;
}
if( $this->totalResults > $this->usersPerPage * $this->page + $this->usersPerPage ) {
$this->pages['next'] = $this->page + 2;
}
}
}
}
?>