[20/01/07] Admin Userlist

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in here. No new MODs will be accepted into the MOD Database for phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.

Rating:

Excellent!
398
72%
Very Good
98
18%
Good
38
7%
Fair
11
2%
Poor
11
2%
 
Total votes: 556

EWT
Registered User
Posts: 21
Joined: Thu Jul 24, 2003 5:25 pm
Location: USA

Post by EWT »

I added the following changes in red to Eric's excellent mod for use on my own message board. My changes fix the outdated instruction text at the beginning of his mod, and places a link directly to the "Admin Userlist" screen at the bottom of the main index page, which is seen only by admins. One note, my changes still need a way to get back to main index from the Admin Userlist screen...
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_admin.php

#
#-----[ FIND ]------------------------------------------
#
//
// That's all Folks!
#
#-----[ BEFORE, ADD ]------------------------------------------
#
//
// start Admin Userlist 1.6.0
//
//title stuff
$lang['Show'] = 'Display No. of Users';
$lang['User_list_title'] = 'Userlist';
$lang['User_list_description'] = 'Here you can see a list of every user on your board and perform the following administrative tasks by clicking on:<ul>Action icons on the left.<br />Username to see their Profile.<br />Group name to modify Group settings.<br />Posts number to see all of their posts.<br />Alphabet Letters to list Usernames that start with that letter.<br />Check Boxes allow multiple users to be Activated/De-activated, Banned, or Deleted using the drop-down box at the bottom.</ul><b>Deleting can\'t be undone!';
$lang['Action'] = 'Action';
$lang['Edit_Profile'] = 'Profile';
$lang['Edit_Permission'] = 'Permissions';
$lang['Active'] = 'Active?';
$lang['PM'] = 'PM User';
$lang['User_group'] = 'Group';
$lang['Ban'] = 'Ban';
$lang['Check_all'] = 'Check All';
$lang['Uncheck_all'] = 'Un-Check All';
$lang['Activate'] = 'Activate/De-activate';
$lang['Click_return_userlist'] = 'Click %shere%s to return to the Admin Userlist';
$lang['User_status_updated'] = 'Users Status Updated Successfully!';
$lang['Last_visit'] = 'Last Visit';

$lang['Pending'] = 'Pending';
$lang['Group_moderator'] = 'Group Mod';
$lang['Member'] = 'Member';

//confirm delete user
$lang['Confirm_user_delete'] = 'Do you really want to delete these users?';
$lang['Yes_delete_user'] = '%sYes, Delete User%s';
$lang['No_delete_user'] = '%sNo, do not delete user%s';

//confirm ban user
$lang['Confirm_user_ban'] = 'Do you really want to Ban these users?';
$lang['Yes_ban_user'] = '%sYes, Ban User%s';
$lang['No_ban_user'] = '%sNo, do not Ban user%s';
$lang['User_banned'] = 'User banned';

//message box
$lang['Click_return_userslist'] = 'Click %sHere%s to return to the User List';
//
// end Admin Userlist 1.6.0
//

#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/subSilver.cfg
#
#-----[ FIND ]------------------------------------------
#
?>
#
#-----[ BEFORE, ADD ]------------------------------------------
#
//
// start Admin Userlist 1.6.0
//
$images['icon_delete'] = "$current_template_images/{LANG}/icon_delete.gif";
$images['icon_mangmt'] = "$current_template_images/{LANG}/icon_mangmt.gif";
$images['icon_perm'] = "$current_template_images/{LANG}/icon_perm.gif";
//
// end Admin Userlist 1.6.0
//


#
#-----[ OPEN ]------------------------------------------
#

language/lang_english/lang_main.php

#
#-----[ FIND ]------------------------------------------
#

$lang['Admin_panel'] = 'Go to Administration Panel';

#
#-----[ AFTER, ADD ]------------------------------------------
#

//
// start EWTs changes
//
$lang['Admin_Userlist_Link'] = 'Go to Admin Userlist';
//
// End of EWTs changes
//

#
#-----[ OPEN ]------------------------------------------
#

includes/page_tail.php

#
#-----[ FIND ]------------------------------------------
#

$admin_link = ( $userdata['user_level'] == ADMIN ) ? '<a href="' . append_sid("admin/index.$phpEx") . '">' . $lang['Admin_panel'] . '</a><br /><br />' : '';

#
#-----[ REPLACE WITH ]------------------------------------------
#

//
// Start EWTs changes
// next line replaced with one following
//$admin_link = ( $userdata['user_level'] == ADMIN ) ? '<a href="' . append_sid("admin/index.$phpEx") . '">' . $lang['Admin_panel'] . '</a><br /><br />' : '';

$admin_link = ( $userdata['user_level'] == ADMIN ) ? '<a href="' . append_sid("admin/index.$phpEx") . '">' . $lang['Admin_panel'] . '</a><br /><a href="' . append_sid("admin/admin_userlist.$phpEx") . '">' . $lang['Admin_Userlist_Link'] . '</a><br /><br />' : '';

//
// End of EWTs changes
//


#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
Last edited by EWT on Sat Aug 09, 2003 10:24 pm, edited 1 time in total.
EWT

Squiranha
Registered User
Posts: 42
Joined: Fri Jun 20, 2003 10:18 am

Post by Squiranha »

EWT,
I just checked all my members. For 15 (out of 112) the last visit date is earlier than the last post. The differences are

1 day - 6 members
2 - 3 - 5 - 8 - 10 - 12 - 28(!!) days - 1 member each
6 days - 2 members

Since the last post date is correct, the question is what happens when the last visit is stored in the database.

wGEric
Former Team Member
Posts: 8805
Joined: Sun Oct 13, 2002 3:01 am
Location: Friday
Name: Eric Faerber
Contact:

Post by wGEric »

EWT wrote: I added the following changes in red to Eric's excellent mod for use on my own message board. My changes fix the outdated instruction text at the beginning of his mod, and places a link directly to the "Admin Userlist" screen at the bottom of the main index page, which is seen only by admins. One note, my changes still need a way to get back to main index from the Admin Userlist screen...


Thank you.

Looking at the session functions it looks like it only sets the users lastvisit time when they log in. Also looking at it, it doesn't update it if the user is using the auto login feature. I haven't tested this but this will make it so it will update the session time everytime the user goes to a new page on your board.

Open: includes/sessions.php
Find:

Code: Select all

						$sql = "UPDATE " . USERS_TABLE . " 
							SET user_session_time = $current_time, user_session_page = $thispage_id 
							WHERE user_id = " . $userdata['user_id'];
Repalce With:

Code: Select all

						$sql = "UPDATE " . USERS_TABLE . " 
							SET user_session_time = $current_time, user_session_page = $thispage_id, user_lastvisit = " . time() . "
							WHERE user_id = " . $userdata['user_id'];
Tell me if it works.
Eric

TangyPeach
Registered User
Posts: 59
Joined: Tue Aug 27, 2002 3:39 pm
Contact:

Post by TangyPeach »

Jon Reid wrote:
wGEric wrote:I'm pretty sure it will. I haven't tested it yet.


works fine with 2.0.6 as far as I can see.


Great news then.. thx..
www.thepeachpit.com

dont laugh, im new at this... *smiles*

MattGreer
Registered User
Posts: 97
Joined: Mon Jan 27, 2003 7:10 pm
Contact:

Post by MattGreer »

Squiranha wrote:
MattGreer wrote:I have no idea what the box with the 50 in it is for

That's the number of users to be displayed. Just add this

Code: Select all

$lang['Show'] = "Display no. of registered users:"
(or any other text) in language/lang_english/lang_admin.php. The 50 will still be there, but you'll have the text reminding you of what it is for :D


It appears that this information was not in the installation instructions.

But it worked like a charm, and I completely don't understand why! :D

Thanks for the quick response!
Onwards,

Matt

wGEric
Former Team Member
Posts: 8805
Joined: Sun Oct 13, 2002 3:01 am
Location: Friday
Name: Eric Faerber
Contact:

Post by wGEric »

@MattGreer: I forgot to put that in the instructions. Sorry


The code changes that I posted above will mess up the new post notification that phpBB has built in. Since it takes your last visit date a sees what posts have been posted since then. Since my change will make it so it will update your last visit time on every page you goto it won't mark any posts as new since your last visit date is after any posts were made.
Eric

Lord B
Registered User
Posts: 22
Joined: Sat Aug 02, 2003 8:07 pm

Post by Lord B »

Everything seems to work...but only one thing I don't know how to get around.

Code: Select all

Template->make_filename(): Error - file does not exist
I get this error on the Log Actions MOD too...anybody have any ideas?

wGEric
Former Team Member
Posts: 8805
Joined: Sun Oct 13, 2002 3:01 am
Location: Friday
Name: Eric Faerber
Contact:

Post by wGEric »

Lord B wrote: Everything seems to work...but only one thing I don't know how to get around.

Code: Select all

Template->make_filename(): Error - file does not exist
I get this error on the Log Actions MOD too...anybody have any ideas?


Looks like you didn't upload the .tpl file to the correct spot. Make sure you put the included .tpl file in all of the templates that you are using. Also make sure it is in the admin folder inside of the template.
Eric

MattGreer
Registered User
Posts: 97
Joined: Mon Jan 27, 2003 7:10 pm
Contact:

Post by MattGreer »

wGEric wrote: @MattGreer: I forgot to put that in the instructions. Sorry


The code changes that I posted above will mess up the new post notification that phpBB has built in. Since it takes your last visit date a sees what posts have been posted since then. Since my change will make it so it will update your last visit time on every page you goto it won't mark any posts as new since your last visit date is after any posts were made.


Wait wait... Does that mean it is your MOD that has disabled my 'new post notification' function? Right now it's broken, and after 16 MODs I don't know where to start...

I have v160 installed.

How do I re-enable it?
Onwards,

Matt

IA-IceyBlast
Registered User
Posts: 8
Joined: Thu Apr 10, 2003 10:12 pm
Contact:

Post by IA-IceyBlast »

Parse error: parse error in /home/clania/public_html/forum/language/lang_english/lang_admin.php on line 810

Warning: Cannot modify header information - headers already sent by (output started at /home/clania/public_html/forum/language/lang_english/lang_admin.php:810) in /home/clania/public_html/forum/admin/index.php on line 582

Warning: Cannot modify header information - headers already sent by (output started at /home/clania/public_html/forum/language/lang_english/lang_admin.php:810) in /home/clania/public_html/forum/admin/index.php on line 583


... This is why im not allowed to modify code.
What?

IA-IceyBlast
Registered User
Posts: 8
Joined: Thu Apr 10, 2003 10:12 pm
Contact:

Post by IA-IceyBlast »

NVM
What?

EWT
Registered User
Posts: 21
Joined: Thu Jul 24, 2003 5:25 pm
Location: USA

Post by EWT »

MattGreer wrote: Wait wait... Does that mean it is your MOD that has disabled my 'new post notification' function? Right now it's broken, and after 16 MODs I don't know where to start...

I have v160 installed.

How do I re-enable it?


What Eric meant is that he was trying to find the reaso for the "last visit" error in the date that several of us have noticed (yours does it to but you probably just haven't spotted it yet). So Eric posted this:
Open: includes/sessions.php
Find:
Code:
$sql = "UPDATE " . USERS_TABLE . "
SET user_session_time = $current_time, user_session_page = $thispage_id
WHERE user_id = " . $userdata['user_id'];

Repalce With:
Code:
$sql = "UPDATE " . USERS_TABLE . "
SET user_session_time = $current_time, user_session_page = $thispage_id, user_lastvisit = " . time() . "
WHERE user_id = " . $userdata['user_id'];


Tell me if it works.


So if you implemented that change, then just put it back the way it was where he says,
Find:
Code:

If that doesn't fix your notification problem, then I doubt Eric's Mod is the cause because I also have his Mod installed and my notifications are working fine. Its good to keep a history log of what Mods you installed in chronological order, and then try to correlate that with when you first spot something not working right. Since even the Mod finals are really sort of a beta (as with all software really) its also good to only install one Mod at a time and see how things go for a week or two (or you probably already do this).

Hope you don't mind me trying to help,

Good luck!
EWT

EWT
Registered User
Posts: 21
Joined: Thu Jul 24, 2003 5:25 pm
Location: USA

Post by EWT »

IA-IceyBlast wrote: Parse error: parse error in /home/clania/public_html/forum/language/lang_english/lang_admin.php on line 810

Warning: Cannot modify header information - headers already sent by (output started at /home/clania/public_html/forum/language/lang_english/lang_admin.php:810) in /home/clania/public_html/forum/admin/index.php on line 582

Warning: Cannot modify header information - headers already sent by (output started at /home/clania/public_html/forum/language/lang_english/lang_admin.php:810) in /home/clania/public_html/forum/admin/index.php on line 583

... This is why im not allowed to modify code.



I had this problem too, and it turned out to be a pilot's error. What I mean is, I forgot to upload something to the right place. but I carefully went back over the install text and after rechecking and reuploading, it worked perfect.
Last edited by EWT on Fri Aug 15, 2003 7:52 pm, edited 1 time in total.
EWT

MattGreer
Registered User
Posts: 97
Joined: Mon Jan 27, 2003 7:10 pm
Contact:

Post by MattGreer »

You kidding? I love it when people help!

Well, I didn't really notice this until after I'd installed 16 MODs last night. However, after each MOD I backed up the MySQL DB and the entire phpbb directory, so I'm good to go as far as figuring out when it happened. But man, it's gonna be a pain in the buttttttt.

I did not implement that code change. After reviewing Eric's code I agree that it's probably not his MOD causing the problem. I really really don't understand a lot of what I see in these PHP files, but I pick up a thing or two now and again.

So, to understand it correctly, Eric's MOD causes one or more problems in the 'last visit' date? Truthfully, I could deal with not having last visited information. I just like having everyone in one big list so I can get to their settings...
Onwards,

Matt

EWT
Registered User
Posts: 21
Joined: Thu Jul 24, 2003 5:25 pm
Location: USA

Post by EWT »

Well actually, the error is not in Eric's code. According to Eric, phpbb does not record the last visit date if a user has the "auto login" feature checked when they first visit the page (aparently the last visit date is tied to the manual login function). The reason why this probably hasn't been discovered is that phpbb generally doesn't use the last visit date in any visible place, that is until Eric's Mod. phpbb only displays last post date, but not last visit date (anywhere that I am aware of). I think the auto login is really silly, but perhaps Eric would use the Last Post date in his table instead of the Last Visit date. That would probably be a good alternative. Thing is, I really do like to see when people come to the board, even if they don't make a post.
EWT

Post Reply

Return to “[2.0.x] MOD Database Releases”