This repository has been archived on 2023-09-19. You can view files and clone it, but cannot push or open issues or pull requests.
AcmlmboardZero/memberlist.php

53 lines
2.1 KiB
PHP

<?php
require("function.php");
require("layout.php");
print $header;
print "$smallfont"."Sort by: <a href=memberlist.php?sort=posts>Total posts</a> | <a href=memberlist.php?sort=name>User name</a> | <a href=memberlist.php?sort=registration>Registration date</a>
<table border=0 bgcolor=$tableborder width=$tablewidth align=center cellpadding=0 cellspacing=0>
<td>
<table border=0 cellpadding=2 cellspacing=1 width=100% bgcolor=$tableborder>
";
echo "<font color=black>";
$tccellha="<td bgcolor=$tableheadbg";
$tccellhb="><center>$fonthead";
$tccell2a="<td bgcolor=$tablebg2";
$tccell2b="><center>$fonttag";
$userlist="$tccellha width=20$tccellhb"."#</td>";
$userlist.="$tccellha width=60$tccellhb"."Picture</font></td>";
$userlist.="$tccellh"."Username</td>";
$userlist.="$tccellha width=150$tccellhb"."Registered on</td>";
$userlist.="$tccellha width=60$tccellhb"."Posts</td><tr>";
if ($_GET['sort']=="posts" or $_GET['sort']=="") {
$user=mysqli_query($con,"SELECT * FROM users ORDER BY posts DESC");
}
if ($_GET['sort']=="name") {
$user=mysqli_query($con,"SELECT * FROM users ORDER BY name");
}
if ($_GET['sort']=="registration") {
$user=mysqli_query($con,"SELECT * FROM users ORDER BY regdate DESC");
}
$i=1;
while ($users=mysqli_fetch_array($user)) {
$userlist.="<tr>";
$userpicture="<img width=60 height=60 src=\"$users[picture]\">";
if (!$users['picture']) { $userpicture=""; }
if ($users['sex']==0) { $namecolor="color=$malecolor"; }
if ($users['sex']==1) { $namecolor="color=$femalecolor"; }
if ($users['sex']==2) { $namecolor="face=$font size=-1"; }
$userlist.="$tccell2$i.</td>";
$userlist.="$tccell2"."</center>$userpicture</td>";
$userlist.="$tccell2"."</center><a href=profile.php?id=$users[id]><font $namecolor>$users[name]</font></a></td>";
$userlist.="$tccell2".date("m-d-y h:i A",$users['regdate']+$tzoff)."</td>";
$userlist.="$tccell2a width=60 nowrap$tccell2b$users[posts]</td>";
$i++;
}
print "$userlist
</table>
</td>
</table>
";
print $footer;
?>