phpBB2Refugees.com Logo
Not affiliated with or endorsed by the phpBB Group

Register •  Login 

Continue the legacy...

Welcome to all phpBB2 Refugees!Wave Smilie

This site is intended to continue support for the legacy 2.x line of the phpBB2 bulletin board package. If you are a fan of phpBB2, please, by all means register, post, and help us out by offering your suggestions. We are primarily a community and support network. Our secondary goal is to provide a phpBB2 MOD Author and Styles area.

How to change order in Advance Admin Index Stats?


 
Search this topic... | Search MOD Requests... | Search Box
Register or Login to Post    Index » MOD Requests  Previous TopicPrint TopicNext Topic
Author Message
Sylver Cheetah 53
Board Member



Joined: 17 Dec 2008

Posts: 426
Location: Milky Way


flag
PostPosted: Tue Feb 17, 2009 9:53 pm 
Post subject: How to change order in Advance Admin Index Stats?

Hy!

I wish to put Advance Admin Index Stats MOD on my board, but I want to change something.

Image link

I don't like the fact that the admins and moderators are shown in alphabetyc oreder, and I wish to be in registration order, like moderators are in forum index. icon_wink.gif

This is the code:
Code:
  <tr>
        <td class="row3" width="10">&nbsp;</td>
        <td class="row1">{L_NAME_ADMINISTRATORS}:</td>
        <td class="row2"><b>{NAMES_OF_ADMINISTRATORS}</b></td>
  </tr>
  <tr>
    <td class="row1" colspan="2" width="33%">{L_NUMBER_MODERATORS}:</td>
    <td class="row2" width="67%"><b>{NUMBER_OF_MODERATORS}</b></td>
  </tr>


Thanks!

_________________
Image link
My Forum || My Blog

phpBB2 forever! icon_smile.gif
Back to top
~Cowboy~
Board Member



Joined: 08 Dec 2008

Posts: 297
Location: Chicago


flag
PostPosted: Tue Feb 17, 2009 11:23 pm 
Post subject: Re: How to change order in Advance Admin Index Stats?

I would rather see them by hierarchy.. or seniority.
_________________
Image link
We are not refugees we are trail blazers. icon_wink.gif
Back to top
Sylver Cheetah 53
Board Member



Joined: 17 Dec 2008

Posts: 426
Location: Milky Way


flag
PostPosted: Wed Feb 18, 2009 7:47 pm 
Post subject: Re: How to change order in Advance Admin Index Stats?

I've looked into forum index file, to see how moderators are sort. I've found this line:
Code:
   $sql = "SELECT aa.forum_id, u.user_id, u.username
      FROM " . AUTH_ACCESS_TABLE . " aa, " . USER_GROUP_TABLE . " ug, " . GROUPS_TABLE . " g, " . USERS_TABLE . " u
      WHERE aa.auth_mod = " . TRUE . "
         AND g.group_single_user = 1
         AND ug.group_id = aa.group_id
         AND g.group_id = aa.group_id
         AND u.user_id = ug.user_id
      GROUP BY u.user_id, u.username, aa.forum_id
      ORDER BY aa.forum_id, u.user_id";

It seems that they are sort by ID, not by registration date, wich is just as good. Also, it seems that it's a SQL querry, wich I'm not very good at. icon_sad.gif

_________________
Image link
My Forum || My Blog

phpBB2 forever! icon_smile.gif
Back to top
drathbun
Board Member



Joined: 24 Jul 2008

Posts: 653
Location: Texas


flag
PostPosted: Wed Feb 18, 2009 8:31 pm 
Post subject: Re: How to change order in Advance Admin Index Stats?

The code sample you posted from the MOD does not help. To reorder the users would require either a SQL or a PHP change. The template does not have anything to do with ordering of the output.
_________________
phpBBDoctor Blog
Back to top
Sylver Cheetah 53
Board Member



Joined: 17 Dec 2008

Posts: 426
Location: Milky Way


flag
PostPosted: Wed Feb 18, 2009 9:05 pm 
Post subject: Re: How to change order in Advance Admin Index Stats?

Thanks, Dave. I got it now. I just have to replace one line in admin/index.php.
Code:
$administrator_names = '';
$sql = "SELECT username
               FROM " . USERS_TABLE . "
               WHERE user_level = " . ADMIN . "
                  AND user_id <> " . ANONYMOUS . "
               ORDER BY username";

With this:
Code:
$administrator_names = '';
$sql = "SELECT username
               FROM " . USERS_TABLE . "
               WHERE user_level = " . ADMIN . "
                  AND user_id <> " . ANONYMOUS . "
               ORDER BY user_id";

It's user_id instead of username. icon_razz.gif

Since I like things to be perfect, I want to make the names on click go to edit profile, like the once in view online users in Admin Panel. I need them to go to admin/admin_users.php?mode=edit&u=ID. I've tryed to replace this line (in index_body.tpl):
Code:
<td class="row2"><b>{NAMES_OF_ADMINISTRATORS}</b></td>

With this:
Code:
<td class="{reg_user_row.ROW_CLASS}"><b><a href="{reg_user_row.U_USER_PROFILE}" class="name">{NAMES_OF_ADMINISTRATORS}</a></b></td>

It looks like a link, but it takes me nowhere. icon_confused.gif Probably, once again, I should do the edits in admin/index.php, but not sure what to do. For who is online registered users I have this:
Code:
   $sql = "SELECT session_page, session_logged_in, session_time, session_ip, session_start   
      FROM " . SESSIONS_TABLE . "
      WHERE session_logged_in = 0
         AND session_time >= " . ( time() - $whoisonlinetime ) . "
      ORDER BY session_time DESC";

But not very sure what I should get from here. icon_sad.gif
And probably this is the line where I have to do the changes:
Code:
$administrator_names .= (($administrator_names == '') ? '' : ', ') . $row['username'];

If anyone wants to take a look at my admin/index.php file, here it is. icon_mrgreen.gif

_________________
Image link
My Forum || My Blog

phpBB2 forever! icon_smile.gif
Back to top
Display posts from previous:   
Register or Login to Post    Index » MOD Requests  Previous TopicPrint TopicNext Topic
Page 1 of 1 All times are GMT
 
Jump to:  

Index • About • FAQ • Rules • Privacy • Search •  Register •  Login 
Not affiliated with or endorsed by the phpBB Group
Powered by phpBB2 © phpBB Group
Generated in 0.0187 seconds using 15 queries. (SQL 0.0013 Parse 0.0005 Other 0.0169)
phpBB Customizations by the phpBBDoctor.com
Template Design by DeLFlo and MomentsOfLight.com Moments of Light Logo