MyBB Community Forums

Full Version: Help! custom php file to show staff
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey guys im having trouble adding usergroup bars and username styles to this page http://vexforums.net/showstaff.php and heres the code note im a novice and this was the best i could get also i cant get it to show more than 1 usergroup.

<?php

define("IN_MYBB", 1);
require_once "global.php"; 

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

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

$lang->load('modcp');

$userquery = $db->simple_select("users", "uid, usertitle, username, usergroup, avatar, displaygroup", "usergroup=4" , array("order_by" => 'uid', "order_dir" => 'ASC'));


if ($db->num_rows($userquery) > 0)
{
    $usertablerows = "";
    while ($users = $db->fetch_array($userquery))
    {
                            $staffuser = array(get_user($users['uid']));
                            $regdate = my_date($mybb->settings['dateformat'], $users['regdate']);
 $userbar = $displaygroup['image'];
                            $usertablerows .= ' <tr>
 <td class="trow1">
 

<div style="width: 48%; min-height: 120px;float: left; border: 1px #101010 solid; margin: 4px; padding: 2px;">
 <table border="0" cellpadding="5" cellspacing="0" width="100%">
 <tbody><tr>
 <td class="trow1" width="75%">
 <span><strong>'. build_profile_link($users['username'], $users['uid']). '</strong></span></a></strong></span><br>
 <span class="smalltext">
 '.$users['usertitle']. '<br>
 <img src='.$users['groupimage'].'></img><br>
 <span class="smalltext">
 <a href="private.php?action=send&uid='.$users['uid'].'" title="Send this user a private message" class="postbit_pm">PM</a></span><br></span>
 </td>
 <td align="right" valign="middle" width="25%">
 <img height="100" src='.$users['avatar'].'></img>
 <td align="left" valign="middle" width="25%">
 <img height="100" src='.$displaygroup['image'].'></img>
 </td>
 
 
 </td>
                                          </tr>
 </tbody></table>
 </div>';
    }
}
else
{
    $usertablerows = '<tr><td class="trow1" colspan="2" align="center">'. "Returned nothing. Something went wrong." .'</td></tr>';
}

$template='<html>
<head>
<title>'.$pages['name'].'</title>
{$headerinclude}
</head>
<body>
{$header}
<table border="0" cellspacing="1" cellpadding="2" class="tborder">
<tr><td class="thead" colspan="4"><strong>The Staff</strong></td></tr>
<tr>

</tr>
{$usertablerows}
</table>
{$footer}
</body>
</html>';

$template=str_replace("\'", "'", addslashes($template));

add_breadcrumb($pages['name']);

eval("\$page=\"".$template."\";");

output_page($page);

?>
Why dont you just edit showteam php to have avatars?
Because i want it to be just 1 .php file alone and this design looks better also i cant get them to be next to each other for some reason/

(01-06-2015, 01:40 AM)Leefish Wrote: [ -> ]Why dont you just edit showteam php to have avatars?

That and i want staff t show up no matter what displaygroup they are in