[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

Comy
Registered User
Posts: 164
Joined: Fri Jan 16, 2004 4:51 pm

Post by Comy »

Novagallia wrote: I'm using this mod along with the log ip on registration one. I edited this one to have a new column with the ip address of the user

Image

is this what you'd like to do? If so i'll share my code with you.


Can you post us the lines of codes you modified or if you have a complete file to download ? I already installed 205b mod (of milkboy)
Novagallia
Registered User
Posts: 28
Joined: Mon Dec 05, 2005 9:58 pm

Post by Novagallia »

i think i only edited the admin_userlist.php and userlist_body.tpl files. I'm far from a programming expert so i basically went in a trial and error way with lot's of testing. Therefore i don't have the specific list of all changes i've done. Here are my admin_userlist.php file as well at my userlist_body.tpl file so you can take a look at. Specifically check out for the "regip" word and you'll be all set. I also made some changes in the colspan value for modifying the tables. If you have problem i'll try to write a mod for these changes when i have more time.[/url]
User avatar
milkboy31
Registered User
Posts: 422
Joined: Tue Aug 09, 2005 2:44 pm

Post by milkboy31 »

Ok all... Sorry for the long delay, but after much waiting, here is the next upgrade! It is currently in submission status to the mod team awaiting approval.

Admin Userlist 2.0.5c

http://www.deathmonkeighs.com/files/adm ... t_205c.zip

Improvements in this version:
## 2006-01-18 - version 2.0.5c
## - Cleaned up some code to be more uniform
## - Fixed the sql error readout bug
## - Added Email, Post, and Website columns
## - Added ability to sort by Website
## - Added "upgrades" folder to hold optional files


Previous to this release, there were sort features for email and post counts... but the only way you could see these values was by "opening" each user. (a valid complaint of "beggers" on page 73 of this thread) Now those fields are included in the layout to see clearly once you sort.

Due to popular demand I've also added the website field and the corresponding sort option for it as well. Also, if you followed MikeTums' code on how to do this previously, he left out a part that you need to change in order to make users look normal when you "open" them to see their extended info. If you fail to change the colspan value (it is correct in this release) it will cram everyone's info to the far left of the screen. :-?

If you previously DID install his website field... no worries. Just run the 205b to 205c upgrade mod in the "upgrades" folder of this version and it will fix that issue as well as add the posts and email fields. ;-)

I decided to NOT implement a few changes that users had suggested... I'll give a brief explanation as to why on each thing here.

1) IP Address field. - I would estimate it at around 70% of my users that visit my site have IPs that change over time. Most of them quite frequently. Giving you the IP in this form is rather misleading as it may not be accurate at all... rather it may just be the IP they had at the time of registration. This also requires a secondary mod to capture the IP they used at registration, which is not a feature of this mod. If you still wish to add that field, by all means... but it won't be an official feature here. And lastly, I'm just plain out of room for another field!

2) Button graphics that were removed from the 1.6 version - I didn't add these back in for two reasons, and I think wGEric may have removed them for the same reasons. First, if you have any different style of template other than subsilver, the buttons don't match. Second, if you use any language other than english, the buttons don't read in that language.... Which is why I think this was removed to begin with. The text that is there without the buttons WILL change if you use a different lang file. ;-)
User avatar
igorw
Former Team Member
Posts: 8024
Joined: Fri Dec 16, 2005 12:23 pm
Location: {postrow.POSTER_FROM}
Name: Igor Wiedler

Post by igorw »

Thanks! Very nice! I like the Images, and even made some to match my style :D I used those images for something else too:

Image
Image
Porutchik
I've Been Banned!
Posts: 275
Joined: Sat Dec 31, 2005 11:11 am
Location: Russia, Orenburg (Россия, Оренбург)
Name: Sergey O
Contact:

Post by Porutchik »

Very well, but there are lacks from the last versions:
- To close access the user it is possible, to open it is impossible;
- It is not visible anywhere, whether the access the user is closed;

Other wishes:
For columns with dates it is necessary to make nowrap;
Date of last visiting in the format by default;
User avatar
stevemagruder
Registered User
Posts: 210
Joined: Wed Jul 02, 2003 2:05 pm
Location: Louisville, KY
Contact:

Post by stevemagruder »

2) Button graphics that were removed from the 1.6 version - I didn't add these back in for two reasons, and I think wGEric may have removed them for the same reasons. First, if you have any different style of template other than subsilver, the buttons don't match. Second, if you use any language other than english, the buttons don't read in that language.... Which is why I think this was removed to begin with. The text that is there without the buttons WILL change if you use a different lang file. :wink:


Yes, this makes it an easier template to install for most users. However, it is not invalid to have a button-based version... it just means that people will just have to make their own buttons for their other templates and/or languages. There are plenty of other mods that require this kind of work as well. Modding isn't meant to be for the faint of heart anyway.

Anyway, that isn't a gripe. Thanks for all your continued great work on this mod.
Steve Magruder - WebCommons :: Media
Administrator for the Louisville History & Issues discussion board
User avatar
stevemagruder
Registered User
Posts: 210
Joined: Wed Jul 02, 2003 2:05 pm
Location: Louisville, KY
Contact:

Post by stevemagruder »

Also, here's another mod that will be useful to those who are using a current version of PHP (I believe v2.0.18 or newer):

In the "delete user" section of admin/admin_userlist.php, you will need to execute the following two deletes in addition to other deletes already there:

Code: Select all

				$sql = "DELETE FROM " . SESSIONS_TABLE . "
					WHERE session_user_id = $user_id";
				if ( !$db->sql_query($sql) )
				{
					message_die(GENERAL_ERROR, 'Could not delete sessions for this user', '', __LINE__, __FILE__, $sql);
				}

				$sql = "DELETE FROM " . SESSIONS_KEYS_TABLE . "
					WHERE user_id = $user_id";
				if ( !$db->sql_query($sql) )
				{
					message_die(GENERAL_ERROR, 'Could not delete auto-login keys for this user', '', __LINE__, __FILE__, $sql);
				}
Steve Magruder - WebCommons :: Media
Administrator for the Louisville History & Issues discussion board
Porutchik
I've Been Banned!
Posts: 275
Joined: Sat Dec 31, 2005 11:11 am
Location: Russia, Orenburg (Россия, Оренбург)
Name: Sergey O
Contact:

Post by Porutchik »

So it will be better and understandably by all. :D

Code: Select all

# 
#-----[ OPEN ]------------------------------------------ 
#
admin/admin_userlist.php

# 
#-----[ FIND ]------------------------------------------ 
#
					message_die(GENERAL_ERROR, 'Could not delete user from banlist table', '', __LINE__, __FILE__, $sql);
				}
# 
#-----[ AFTER, ADD ]------------------------------------------ 
#
	            $sql = "DELETE FROM " . SESSIONS_TABLE . " 
    	           WHERE session_user_id = $user_id"; 
        	    if ( !$db->sql_query($sql) ) 
	            { 
    	           message_die(GENERAL_ERROR, 'Could not delete sessions for this user', '', __LINE__, __FILE__, $sql); 
        	    } 

	            $sql = "DELETE FROM " . SESSIONS_KEYS_TABLE . " 
    	           WHERE user_id = $user_id"; 
        	    if ( !$db->sql_query($sql) ) 
	            { 
    	           message_die(GENERAL_ERROR, 'Could not delete auto-login keys for this user', '', __LINE__, __FILE__, $sql); 
        	    }


Porutchik
I've Been Banned!
Posts: 275
Joined: Sat Dec 31, 2005 11:11 am
Location: Russia, Orenburg (Россия, Оренбург)
Name: Sergey O
Contact:

Post by Porutchik »

error post :oops:
User avatar
milkboy31
Registered User
Posts: 422
Joined: Tue Aug 09, 2005 2:44 pm

Post by milkboy31 »

Porutchik wrote: Very well, but there are lacks from the last versions:
- To close access the user it is possible, to open it is impossible;
- It is not visible anywhere, whether the access the user is closed;


I'm not sure what you mean by this... Are you saying if you click on "open" it will do nothing? It works on my end... :-?


Stevemagruder, I totally understand your point on the buttons and I'm not saying you shouldn't use them... I just don't want to make them part of the basic install. ;-) Thanks for the input though and for giving the users those files which were removed. I honestly never even knew about them until you posted them here! :lol:
Porutchik
I've Been Banned!
Posts: 275
Joined: Sat Dec 31, 2005 11:11 am
Location: Russia, Orenburg (Россия, Оренбург)
Name: Sergey O
Contact:

Post by Porutchik »

milkboy31 wrote: I'm not sure what you mean by this...

excuse me, i mean ban the user
User avatar
stevemagruder
Registered User
Posts: 210
Joined: Wed Jul 02, 2003 2:05 pm
Location: Louisville, KY
Contact:

Post by stevemagruder »

Porutchik wrote: So it will be better and understandably by all.


Thanks!
Steve Magruder - WebCommons :: Media
Administrator for the Louisville History & Issues discussion board
User avatar
stevemagruder
Registered User
Posts: 210
Joined: Wed Jul 02, 2003 2:05 pm
Location: Louisville, KY
Contact:

Post by stevemagruder »

milkboy31 wrote: Stevemagruder, I totally understand your point on the buttons and I'm not saying you shouldn't use them... I just don't want to make them part of the basic install. ;-) Thanks for the input though and for giving the users those files which were removed. I honestly never even knew about them until you posted them here! :lol:


My pleasure.
Steve Magruder - WebCommons :: Media
Administrator for the Louisville History & Issues discussion board
User avatar
milkboy31
Registered User
Posts: 422
Joined: Tue Aug 09, 2005 2:44 pm

Post by milkboy31 »

Porutchik wrote:
milkboy31 wrote: I'm not sure what you mean by this...

excuse me, i mean ban the user


Ok... so I think you're saying that when you select the check next to a person and hit "ban" from the bottom drop down menu, it doesn't show that user as banned anywhere and there is no way to un-ban them.

If I am correct in my interpretation of your statement, then I direct your attention to the "Ban Control" link on the left side of the ACP screen. On there, anyone who you "ban" with the admin userlist mod will appear in the "Banned Usernames" section. To remove a ban on that person, highlight their name and hit submit on that page.

Hope that helps... Was that the issue at hand or did I misunderstand you?
Other wishes:
For columns with dates it is necessary to make nowrap;
Date of last visiting in the format by default;


The default view when you first pull up the admin userlist is to sort by the newest accounts first... so those who just registered their accounts are at the top of the list, ready to be assigned to groups and/or activated. You can change the default sort by messing in the admin_userlist.php file though I'm not sure of where off-hand... I'd have to look.

The dates are long enough that if we made them not wrap, the screen would need to be scrolled to the side to see all the data. It was a toss up of whether we wanted to keep all records on one line or whether we wanted to have email, posts, website columns as well. The demand for those seems to have overtaken the demand for a single line of data. :-?

Thus the decisions that were made. ;-)
Porutchik
I've Been Banned!
Posts: 275
Joined: Sat Dec 31, 2005 11:11 am
Location: Russia, Orenburg (Россия, Оренбург)
Name: Sergey O
Contact:

Post by Porutchik »

Thank you for the detailed response. :)
Look please my replacements and additions in it MODs and you will understand.
It works on our forum. Just has tested.

Code: Select all

##################################################
## MOD Title: Admin Userlist 2.0.5c Fixing and additions 
## MOD Author: Porutchik < garnitur356 [at] mail15.com > (Sergey) http://forum.aeroion.ru 
## MOD Description:		This MOD adds possibility of deleting (unban) of the user from banlist.
##
## MOD Version: 		1.0.0
## 
## Installation Level: 	Easy 
## Installation Time: 	~10 Minutes 
## Files To Edit:		(3)
##						admin/admin_userlist.php 
##						language/lang_english/lang_admin.php 
##						templates/subSilver/admin/userlist_body.tpl 
## 
## Included Files: 		N/A
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2 
##################################################
## For security purposes, please check: http://www.phpbb.com/mods/ 
## for the latest version of this MOD. Although MODs are checked 
## before being allowed in the MODs Database there is no guarantee 
## that there are no security problems within the MOD. No support 
## will be given for MODs not found within the MODs Database which 
## can be found at http://www.phpbb.com/mods/
##################################################
## Author Notes: 
##
##	You must have version Admin Userlist 2.0.5c by Milkboy31 installed in order for this MOD to work.
##	http://www.phpbb.com/phpBB/viewtopic.php?t=117359
##
##################################################
## MOD History: 
##
##	2006-01-19 	- Version 1.0.0
##				- Initial Release
##################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
##################################################

# 
#-----[ OPEN ]--------------------------------------------- 
# 
admin/admin_userlist.php

# 
#-----[ FIND ]--------------------------------------------- 
# 
					message_die(GENERAL_ERROR, 'Could not obtain ban user', '', __LINE__, __FILE__, $sql);
				}

# 
#-----[ AFTER, ADD ]--------------------------------------- 
# 
				$sql = "DELETE FROM " . SESSIONS_TABLE . " 
					WHERE session_user_id = $user_id"; 
				if ( !$db->sql_query($sql) ) 
				{ 
					message_die(GENERAL_ERROR, 'Could not delete sessions for this user', '', __LINE__, __FILE__, $sql); 
				} 

				$sql = "DELETE FROM " . SESSIONS_KEYS_TABLE . " 
					WHERE user_id = $user_id"; 
				if ( !$db->sql_query($sql) ) 
				{ 
					message_die(GENERAL_ERROR, 'Could not delete auto-login keys for this user', '', __LINE__, __FILE__, $sql); 
				}

# 
#-----[ FIND ]--------------------------------------------- 
# 
					message_die(GENERAL_ERROR, 'Could not delete user from banlist table', '', __LINE__, __FILE__, $sql);
				}

# 
#-----[ AFTER, ADD ]--------------------------------------- 
# 
				$sql = "DELETE FROM " . SESSIONS_TABLE . " 
					WHERE session_user_id = $user_id"; 
				if ( !$db->sql_query($sql) ) 
				{ 
					message_die(GENERAL_ERROR, 'Could not delete sessions for this user', '', __LINE__, __FILE__, $sql); 
				} 

				$sql = "DELETE FROM " . SESSIONS_KEYS_TABLE . " 
					WHERE user_id = $user_id"; 
				if ( !$db->sql_query($sql) ) 
				{ 
					message_die(GENERAL_ERROR, 'Could not delete auto-login keys for this user', '', __LINE__, __FILE__, $sql); 
				}

# 
#-----[ FIND ]--------------------------------------------- 
# 
			$message = $lang['User_banned_successfully'] . "<br /><br />" . sprintf($lang['Click_return_userlist'], "<a href=\"" . append_sid("admin_userlist.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>");

			message_die(GENERAL_MESSAGE, $message);
		}
		break;


# 
#-----[ AFTER, ADD ]--------------------------------------- 
# 
	case 'unban':

		//
		// see if cancel has been hit and redirect if it has
		// shouldn't get to this point if it has been hit but
		// do this just in case
		//
		if ( $cancel )
		{
			redirect($phpbb_root_path . 'admin/admin_userlist.'.$phpEx);
		}

		//
		// check confirm and either ban or show confirm message
		//
		if ( !$confirm )
		{
			$i = 0;
			$hidden_fields = '';
			while( $i < count($user_ids) )
			{
				$user_id = intval($user_ids[$i]);
				$hidden_fields .= '<input type="hidden" name="' . POST_USERS_URL . '[]" value="' . $user_id . '">';

				unset($user_id);
				$i++;
			}

			$template->set_filenames(array(
				'body' => 'confirm_body.tpl')
			);
			$template->assign_vars(array(
				'MESSAGE_TITLE' => $lang['UnBan'],
				'MESSAGE_TEXT' => $lang['Confirm_user_un_ban'],
				
				'U_INDEX' => '',
				'L_INDEX' => '',
				
				'L_YES' => $lang['Yes'],
				'L_NO' => $lang['No'],
				
				'S_CONFIRM_ACTION' => append_sid('admin_userlist.'.$phpEx.'?mode=unban'),
				'S_HIDDEN_FIELDS' => $hidden_fields)
			);	
		}
		else
		{
			// unban users
			$i = 0;
			while( $i < count($user_ids) )
			{
				$user_id = intval($user_ids[$i]);
	
				$sql = "DELETE FROM " . BANLIST_TABLE . "
					WHERE ban_userid = $user_id";
				if ( !$db->sql_query($sql) )
				{
					message_die(GENERAL_ERROR, 'Could not delete user from banlist table', '', __LINE__, __FILE__, $sql);
				}

				unset($user_id);
				$i++;
			}

			$message = $lang['User_un_banned_successfully'] . "<br /><br />" . sprintf($lang['Click_return_userlist'], "<a href=\"" . append_sid("admin_userlist.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>");

			message_die(GENERAL_MESSAGE, $message);
		}
		break;

# 
#-----[ FIND ]--------------------------------------------- 
# 
			'L_BAN' => $lang['Ban'],

# 
#-----[ AFTER, ADD ]--------------------------------------- 
# 
			'L_UNBAN' => $lang['UnBan'],

#
#-----[ FIND ]--------------------------------------------- 
# 
            'S_HIDDEN_FIELDS' => $hidden_fields) 
	); 

	$order_by = "ORDER BY $sort $sort_order "; 

# 
#-----[ AFTER, ADD ]--------------------------------------- 
# 
		// Get ban data
		//
		$sql = 'SELECT ban_userid
			FROM ' . BANLIST_TABLE;
		if ( !($result = $db->sql_query($sql)) )
		{
			message_die(GENERAL_ERROR, "Couldn't obtain banlist information", "", __LINE__, __FILE__, $sql);
		}
		while ( $row = $db->sql_fetchrow($result) )
		{
			$banned[$row['ban_userid']] = true;
		}
		$db->sql_freeresult($result);

		//
		// users rank
		//
		$rank_sql = "SELECT *
			FROM " . RANKS_TABLE . "
			ORDER BY rank_special, rank_min";
		if ( !($rank_result = $db->sql_query($rank_sql)) )
		{
			message_die(GENERAL_ERROR, 'Could not obtain ranks information', '', __LINE__, __FILE__, $sql);
		}

		while ( $rank_row = $db->sql_fetchrow($rank_result) )
		{
			$ranksrow[] = $rank_row;
		}
		$db->sql_freeresult($rank_result);

#
#-----[ FIND ]--------------------------------------------- 
# 
			//
			// users rank
			//
			$rank_sql = "SELECT *
				FROM " . RANKS_TABLE . "
				ORDER BY rank_special, rank_min";
			if ( !($rank_result = $db->sql_query($rank_sql)) )
			{
				message_die(GENERAL_ERROR, 'Could not obtain ranks information', '', __LINE__, __FILE__, $sql);
			}

			while ( $rank_row = $db->sql_fetchrow($rank_result) )
			{
				$ranksrow[] = $rank_row;
			}
			$db->sql_freeresult($rank_result);

#
#-----[ REPLACE WITH ]--------------------------------------------- 
# Remove these lines (actually move them elsewhere)
#


#
#-----[ FIND ]--------------------------------------------- 
# 
				'USERNAME' => $row['username'],

#
#-----[ REPLACE WITH ]--------------------------------------------- 
# 
				'USERNAME' => ( ($banned[$row['user_id']]) ? '<b>'. $lang['Is_Banned'] .'</b> ': '' ) . $row['username'],

# 
#-----[ OPEN ]--------------------------------------------- 
# 
language/lang_english/lang_admin.php 

# 
#-----[ FIND ]--------------------------------------------- 
# 
$lang['Ban'] = 'Ban';

# 
#-----[ AFTER, ADD ]--------------------------------------- 
# 
$lang['Is_Banned'] = 'banned!';
$lang['UnBan'] = 'Un-ban';

# 
#-----[ FIND ]--------------------------------------------- 
# 
$lang['Confirm_user_ban'] = 'Are you sure you want to ban the selected user(s)?';

# 
#-----[ AFTER, ADD ]--------------------------------------- 
# 
$lang['Confirm_user_un_ban'] = 'Are you sure you want to unban the selected user(s)?';

# 
#-----[ FIND ]--------------------------------------------- 
# 
$lang['User_banned_successfully'] = 'User(s) banned successfully!';

# 
#-----[ AFTER, ADD ]--------------------------------------- 
# 
$lang['User_un_banned_successfully'] = 'User(s) unbanned successfully!'; 

# 
#-----[ OPEN ]--------------------------------------------- 
# 
templates/subSilver/admin/userlist_body.tpl

# 
#-----[ FIND ]--------------------------------------------- 
# 
				<option value="ban">{L_BAN}</option>

# 
#-----[ AFTER, ADD ]--------------------------------------------- 
# 
				<option value="unban">{L_UNBAN}</option>

# 
#-----[ SAVE/CLOSE ALL FILES ]---------------------------- 
# 
# EoM
Last edited by Porutchik on Thu Jan 26, 2006 2:57 pm, edited 2 times in total.
My forum | Advanced Similar Topics
Excuse me please for my awful English. Thanks!. Please do not P.M., ICQ or email me for support help - you won't get any reply. If you have a question or issue, post it in the appropriate forum/topic.
Post Reply

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