minetest-extensions/user.php

52 lines
1.3 KiB
PHP
Raw Normal View History

2012-09-07 10:20:39 -07:00
<?php
include "scripts/setup.php";
2013-02-10 06:27:56 -08:00
2012-09-07 10:20:39 -07:00
$page_title="Users";
2012-09-07 12:28:19 -07:00
2012-09-09 07:36:01 -07:00
$id=$_GET['id'];
if ($id==""){
2013-02-10 06:27:56 -08:00
include "scripts/pageheader.php";
2012-09-09 07:36:01 -07:00
echo "<table width=\"100%\"><tr><th colspan=2>Username</th></tr>\n";
2013-02-20 11:05:59 -08:00
$res = mysql_query("SELECT * FROM users",$handle) or SQLerror("MySQL Query Error","Error on getting database.users");
2012-10-09 12:09:55 -07:00
$alternate=1;
// Get projects loop
while ($hash = mysql_fetch_assoc($res)){
if ($alternate==0){
$bgcolor="#FFFFFF";
}else{
$bgcolor="#FFFFBD";
}
echo "<tr bgcolor=\"$bgcolor\"><td width=16><img width=16 height=16 src=\"images/topicicon_read.jpg\" /></td><td><a href=\"user.php?id={$hash['id']}\">{$hash['name']}</a></td></tr>\n";
$alternate=1-$alternate;
}
2012-09-09 07:36:01 -07:00
echo "</table>";
}else{
2013-02-10 06:27:56 -08:00
2012-10-09 12:09:55 -07:00
if (is_numeric($id)==false){
die("Id is not a number!");
}
$res = mysql_query("SELECT * FROM users WHERE id=$id",$handle) or SQLerror("MySQL Query Error","Error on getting database.users");
$hash = mysql_fetch_assoc($res);
2013-02-20 11:05:59 -08:00
2013-02-10 06:27:56 -08:00
$page_title="{$hash['name']} - Users";
include "scripts/pageheader.php";
2012-10-09 12:09:55 -07:00
echo "<h1>{$hash['name']}</h1>";
echo "<br /><p><a href=\"user.php\">Back to User List</a></p><br />";
$query=$id;
$mode="sb";
if ($mode=="")
$mode="tags";
include "scripts/loadmods.php";
2012-09-09 07:36:01 -07:00
}
2012-09-07 12:28:19 -07:00
include "scripts/pagefooter.php";
2012-09-07 10:20:39 -07:00
?>