<?php
//Send HTML-Header Information
header("Content-Type: application/xhtml+xml; charset=utf-8");
//Connect to MyBB db and get Users
define("IN_MYBB", 1);
require_once "./inc/config.php";
mysql_connect($config['hostname'], $config['username'], $config['password']) or die("Verbindung fehlgeschlagen");
mysql_select_db($config['database']) or die("Verbindung fehlgeschlagen");
if(!isset($_GET['page']))
{
$page = 1;
}
else
{
$page = $_GET['page'];
}
$count = 30;
$start = $count*($page-1);
$end = $count*$page;
$query = mysql_query("SELECT u.username, u.uid, u.avatar, f.fid4 FROM mybb_users u LEFT JOIN mybb_userfields f ON (u.uid=f.ufid) ORDER BY f.fid4 ASC LIMIT $start,$end");
//HTML Code Part Top
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
echo "\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"de\" lang=\"de\">\n<head>\n<title>New Page</title>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\n</head>\n<body>\n<table>\n<tr>\n<td>Name</td>\n<td>Avatar</td>\n</tr>\n";
//Userlist
while($user = mysql_fetch_array($query))
{
$newest_member = "<tr>\n<td><a href=\"/member.php?action=profile&uid={$user['uid']}\">{$user['fid4']}</a><br />{$user['username']}</td>\n";
//Make IE not display the X icon if user has no avatar
if($user['avatar'] == '')
{
$avatar = "<td></td>\n</tr>"; //Dass da nix steht is Absicht! Wenn das ausgegeben wir is nämlich kein Avatar vorhanden!
}
else
{
$avatar = "<td><a href=\"/member.php?action=profile&uid={$user['uid']}\"><img src=\"{$user['avatar']}\" width=\"75\" height=\"75\" border =\"1\" alt=\"\" /></a></td>\n</tr>\n";
}
//Output User
echo $newest_member;
echo $avatar;
}
$query = mysql_query("SELECT COUNT(uid) AS count FROM mybb_users");
$output = mysql_fetch_array($query);
$pages = ceil($output['count']/$count);
echo "Seiten: ";
for ($i = 1; $i <= $pages; $i++)
{
echo "<a href=\"custom_memberlist.php?page=$i\">$i</a> ";
}
//HTML Code Bottom
echo "</table>\n</body>\n</html>";
?>