MyBB-Plugins Forums

Full Version: Some PHP issue
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm building my own PHP page via Page Manager. Page is intended to show all the users in a specific usergroup (8), but the thing is that it shows only one member of the group.

This is the code:
PHP Code:
<?php

global $headerinclude$header$theme$footer$lang$myadvertisements$theme;

if(!
$mybb->user['uid']) error_no_permission();

$starsquery $db->query("SELECT * FROM mybb_users WHERE usergroup = '8'");

while(
$star $db->fetch_array($starsquery)) {
        
$starlist "<tr>
        <td class='trow2' align='center'><img src='" 
$star['avatar'] . "' alt='" $star['username'] . "' class='avatar' height='50px' width='50px' /></td>
        <td class='trow2'><a href='
{$mybb->settings['bburl']}member.php?action=profile&uid=" $star['uid'] . "'>" $star['username'] . "</a><br/><span class='smalltext'>" $star['usertitle'] . "</span></td>
        <td class='trow1'>" 
$star['postnum'] . "</td>
        <td class='trow2'>" 
$star['reputation'] . "</td>
        <td class='trow1'>" 
$star['newpoints'] . "</td>
        <td class='trow2'><a href='" 
$star['website'] . "'>" $star['website'] . "</a></td>
        </tr>"
;
}

$starlistpage "<html>
<head>
<title>
{$mybb->settings['bbname']} - " $pages['name'] . "</title>
{$headerinclude}
</head>
{$header}
<body>
<table border='0' cellpadding='4' cellspacing='0' class='tborder'>
<thead>
<tr>
<td class='thead' colspan='6'><div><strong>Star List</strong></div></td>
</tr>
</thead>
<tbody>
<tr>
<td class='tcat' width='30%' colspan='2'>Username</td>
<td class='tcat' width='10%'>Post Count</td>
<td class='tcat' width='10%'>Reputation</td>
<td class='tcat' width='10%'>Points</td>
<td class='tcat' width='20%'>Website</td>
</tr>
{$starlist}
</tbody>
</table>
{$footer}
</body>
</html>"
;

add_breadcrumb($pages['name']);
$starlistpage str_replace("\'""'"addslashes($starlistpage));
eval(
"\$page=\""$starlistpage ."\";");
output_page($page);
?>

All help is appreciated Smile

No Permission

Unfortunately you do not have sufficient rights to view replies in this thread.