[2.0.7] Memberlist_Hidden_User_MOD

The cleanup is complete. This forum is now read only.

Rating:

Excellent!
1
25%
Very Good
1
25%
Good
1
25%
Fair
1
25%
Poor
0
No votes
 
Total votes: 4

User avatar
3Di
Former Team Member
Posts: 14047
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Post by 3Di » Thu Sep 22, 2005 4:30 pm

Webby wrote: Well i got no errors and calling the page works. Now to see if the mod works.

Alan


I posted crossing yours. ;)
Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
My development's activity ΒΊ PhpStorm's proud user
Extensions, Scripts, MOD porting, Update/Upgrades
πŸ‘¨β€πŸ« | Take a tour to | The Studio | πŸ‘¨β€πŸ«

User avatar
3Di
Former Team Member
Posts: 14047
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Post by 3Di » Thu Sep 22, 2005 4:43 pm

zamba wrote: I have just installed this mod on 2.0.17 and get this error when I click on members while logged in as Site Admin:

Could not query users

DEBUG MODE

SQL Error : 1064 You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '/ Memberlist Hidden User MOD ORDER BY user_regdate ASC LIMIT

SELECT username, user_id, user_viewemail, user_posts, user_regdate, user_from, user_website, user_email, user_icq, user_aim, user_yim, user_msnm, user_avatar, user_avatar_type, user_allowavatar, user_allow_viewmemberlist, user_group_allow_viewmemberlist FROM phpbb_users WHERE user_id <> -1 AND 1 = 1 and show_in_memberlist <> 0 // Memberlist Hidden User MOD ORDER BY user_regdate ASC LIMIT 0, 50

Line : 192
File : memberlist.php

I've corrected the later typo, have I missed something here?

Regards,

Tony Page :?:

probably you should correct

Code: Select all

          and show_in_memberlist <> 0
// Memberlist Hidden User MOD
with

Code: Select all

          and show_in_memberlist <> 0";
// Memberlist Hidden User MOD
Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
My development's activity ΒΊ PhpStorm's proud user
Extensions, Scripts, MOD porting, Update/Upgrades
πŸ‘¨β€πŸ« | Take a tour to | The Studio | πŸ‘¨β€πŸ«

Capmaster
Registered User
Posts: 69
Joined: Tue Jul 05, 2005 1:26 pm

Post by Capmaster » Thu Sep 22, 2005 4:53 pm

Aside from questionable motives, can someone give me a "for instance" when you'd want to hide a member?

I know of a forum that frequently hides members and posts. But their motives aren't honorable.

Am I missing something? :wink:
Image
Some mornings, it's just not worth chewing through the leather straps

User avatar
3Di
Former Team Member
Posts: 14047
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Post by 3Di » Thu Sep 22, 2005 5:03 pm

Capmaster wrote: Aside from questionable motives, can someone give me a "for instance" when you'd want to hide a member?

I know of a forum that frequently hides members and posts. But their motives aren't honorable.

Am I missing something? :wink:


OMG i do not have a good answer on this, one thing it is sure and it is that depends on the points of view, ie. a member of your board does not like to be shown in the memberlist (the reasons can be various depending on the kind of board this MOD will be used)...

greets
Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
My development's activity ΒΊ PhpStorm's proud user
Extensions, Scripts, MOD porting, Update/Upgrades
πŸ‘¨β€πŸ« | Take a tour to | The Studio | πŸ‘¨β€πŸ«

User avatar
bonelifer
Community Team Member
Community Team Member
Posts: 3473
Joined: Wed Oct 27, 2004 11:35 pm
Name: William
Contact:

Post by bonelifer » Thu Sep 22, 2005 7:00 pm

This should have all the fixes. It worked for me.

Code: Select all

############################################################## 
## MOD Title: Memberlist Hidden User MOD
## MOD Author: N3cr0shark <hammerhead@columbus.rr.com> (N/A) N/A 
## MOD Description: Adds the ability to hide users in the Memberslist via ACP 'Manage User'
## MOD Version:  1.0.0
## 
## Installation Level: Intermediate
## Installation Time: 5 Minutes 
## Files To Edit: (4)
##          memberlist.php 
##          language/lang_english/lang_admin.php
##	    admin/admin_users.php 
##	    templates/Solaris/admin/user_edit_body.tpl
## Included Files: n/a
############################################################## 
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the 
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code 
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered 
## in our MOD-Database, located at: http://www.phpbb.com/mods/ 
############################################################## 
## Author Notes: 
## It has been tested successfully on PHPBB Version 2.0.6.
## Feel free to edit and use.
############################################################## 
## MOD History:
##
##     2004-01-07 - version 1.0.0   
##        - First release.
##
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
##############################################################

#
#-----[ SQL ]-------------------------------------------------
#
ALTER TABLE phpbb_users ADD show_in_memberlist TINYINT(1) NULL Default(1); 


#
#-----[ OPEN ]-----------------------------------------
#
memberlist.php

#
#-----[ FIND ]-----------------------------------------
#
$sql = "SELECT username, user_id, user_viewemail, user_posts, user_regdate, user_from, user_website, user_email, user_icq, user_aim, user_yim, user_msnm, user_avatar, user_avatar_type, user_allowavatar
        FROM " . USERS_TABLE . " 
        WHERE user_id <> " . ANONYMOUS . "
#
#-----[ AFTER, ADD ]-----------------------------------------
#
          AND show_in_memberlist <> 0
#
#-----[ FIND ]-----------------------------------------
#
ORDER BY $order_by";
#
#-----[ AFTER, ADD ]-----------------------------------------
#
// Memberlist Hidden User MOD

#
#-----[ FIND ]-----------------------------------------
#
$sql = "SELECT count(*) AS total
FROM " . USERS_TABLE . "
WHERE user_id <> " . ANONYMOUS;

#
#-----[ IN-LINE FIND ]-----------------------------------------
#
WHERE user_id <> " . ANONYMOUS;

#
#-----[ IN-LINE REPLACE WITH ]-----------------------------------------
#
WHERE user_id <> " . ANONYMOUS . "
#
#-----[ AFTER, ADD ]-----------------------------------------
#
and show_in_memberlist <> 0";
// Memberlist Hidden User MOD

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

language/lang_english/lang_admin.php

#
#-----[ FIND ]-----------------------------------------
#
//
// User Management
//

#
#-----[ AFTER, ADD ]-----------------------------------------
#
// Memberlist Hidden User MOD BEGIN
$lang['User_hide_memberlist'] = 'User is viewable in Memberslist';
// Memberlist Hidden User MOD END

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

admin/admin_users.php 

#
#-----[ FIND ]-----------------------------------------
#
                $user_status = ( !empty($HTTP_POST_VARS['user_status']) ) ? intval( $HTTP_POST_VARS['user_status'] ) : 0;

#
#-----[ AFTER, ADD ]-----------------------------------------
#
// Memberlist Hidden User MOD BEGIN
                $user_hide_memberlist = ( !empty($HTTP_POST_VARS['user_hide_memberlist']) ) ? intval( $HTTP_POST_VARS['user_hide_memberlist'] ) : 0;
// Memberlist Hidden User MOD END

#
#-----[ FIND ]-----------------------------------------
#
                                SET " . $username_sql . $passwd_sql . "user_email = '" . str_replace("\'", "''", $email) . "', user_icq = '" . str_replace("\'", "''", $icq) . "', user_website = '" . str_replace("\'", "''", $website) . "', user_occ = '" . str_replace("\'", "''", $occupation) . "', user_from = '" . str_replace("\'", "''", $location) . "', user_interests = '" . str_replace("\'", "''", $interests) . "', user_sig = '" . str_replace("\'", "''", $signature) . "', user_viewemail = $viewemail, user_aim = '" . str_replace("\'", "''", $aim) . "', user_yim = '" . str_replace("\'", "''", $yim) . "', user_msnm = '" . str_replace("\'", "''", $msn) . "', user_attachsig = $attachsig, user_sig_bbcode_uid = '$signature_bbcode_uid', user_allowsmile = $allowsmilies, user_allowhtml = $allowhtml, user_allowavatar = $user_allowavatar, user_allowbbcode = $allowbbcode, user_allow_viewonline = $allowviewonline, user_notify = $notifyreply, user_allow_pm = $user_allowpm, user_notify_pm = $notifypm, user_popup_pm = $popuppm, user_lang = '" . str_replace("\'", "''", $user_lang) . "', user_style = $user_style, user_timezone = $user_timezone, user_dateformat = '" . str_replace("\'", "''", $user_dateformat) . "', user_active = $user_status, user_rank = $user_rank" . $avatar_sql . "

#
#-----[ IN-LINE FIND ]-----------------------------------------
#
user_active = $user_status,

#
#-----[ IN-LINE AFTER, ADD ]-----------------------------------------
#
 show_in_memberlist = $user_hide_memberlist,

#
#-----[ FIND ]-----------------------------------------
#
                $user_status = $this_userdata['user_active'];

#
#-----[ AFTER, ADD ]-----------------------------------------
#
// Memberlist Hidden User MOD BEGIN
                $user_hide_memberlist = $this_userdata['show_in_memberlist'];
// Memberlist Hidden User MOD END

#
#-----[ FIND ]-----------------------------------------
#
                        $s_hidden_fields .= '<input type="hidden" name="user_status" value="' . $user_status . '" />';

#
#-----[ AFTER, ADD ]-----------------------------------------
#
// Memberlist Hidden User MOD BEGIN
                        $s_hidden_fields .= '<input type="hidden" name="user_hide_memberlist" value="' . $user_hide_memberlist . '" />';
// Memberlist Hidden User MOD END

#
#-----[ FIND ]-----------------------------------------
#
                        'USER_ACTIVE_NO' => (!$user_status) ? 'checked="checked"' : '', 

#
#-----[ AFTER, ADD ]-----------------------------------------
#
// Memberlist Hidden User MOD BEGIN
                        'USER_HIDE_MEMBERLIST_YES' => ($user_hide_memberlist) ? 'checked="checked"' : '',
                        'USER_HIDE_MEMBERLIST_NO' => (!$user_hide_memberlist) ? 'checked="checked"' : '', 
// Memberlist Hidden User MOD END

#
#-----[ FIND ]-----------------------------------------
#
                        'L_USER_ACTIVE' => $lang['User_status'],

#
#-----[ AFTER, ADD ]-----------------------------------------
#
// Memberlist Hidden User MOD BEGIN
                        'L_USER_HIDE_MEMBERLIST' => $lang['User_hide_memberlist'],
// Memberlist Hidden User MOD END

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

templates/subSilver/admin/user_edit_body.tpl

#
#-----[ FIND ]-----------------------------------------
#
	<tr> 
	  <td class="row1"><span class="gen">{L_USER_ACTIVE}</span></td>
	  <td class="row2"> 
		<input type="radio" name="user_status" value="1" {USER_ACTIVE_YES} />
		<span class="gen">{L_YES}</span>&nbsp;&nbsp; 
		<input type="radio" name="user_status" value="0" {USER_ACTIVE_NO} />
		<span class="gen">{L_NO}</span></td>
	</tr>

#
#-----[ AFTER, ADD ]-----------------------------------------
#
	<tr> 
	  <td class="row1"><span class="gen">{L_USER_HIDE_MEMBERLIST}</span></td>
	  <td class="row2"> 
		<input type="radio" name="user_hide_memberlist" value="1" {USER_HIDE_MEMBERLIST_YES} />
		<span class="gen">{L_YES}</span>&nbsp;&nbsp; 
		<input type="radio" name="user_hide_memberlist" value="0" {USER_HIDE_MEMBERLIST_NO} />
		<span class="gen">{L_NO}</span></td>
	</tr>

#
#-----[ SAVE/CLOSE ALL FILES ]--------------------------
# 
# EoM
Knowledge Base | phpBB Board Rules | Search Customisation Database
Image
Please don't contact me via PM or email for phpBB support .

Webby
Registered User
Posts: 91
Joined: Tue May 21, 2002 9:28 am
Location: Hannover, Germany
Contact:

Post by Webby » Fri Sep 23, 2005 7:47 am

I got it working now.
there was a problem with the original code or more likly I managed to screw it up myself. I do wish that downloaded mods do not require hair pulling and arent full of typos mind :-/

Here is the bit that got me..

$sql = "SELECT username, user_id, user_viewemail, user_posts, user_regdate, user_from, user_website, user_email, user_icq, user_aim, user_yim, user_msnm, user_avatar, user_avatar_type, user_allowavatar
FROM " . USERS_TABLE . "
WHERE user_id <> " . ANONYMOUS . "
and show_in_memberlist <> 0 ORDER BY $order_by";
// Memberlist Hidden User MOD

Aparently the inverted commas were in the wrong place. anyway, its sorted now and thanks to those who took the time to help.

Alan

Capmaster
Registered User
Posts: 69
Joined: Tue Jul 05, 2005 1:26 pm

Post by Capmaster » Fri Sep 23, 2005 2:19 pm

3Di wrote:
Capmaster wrote:Aside from questionable motives, can someone give me a "for instance" when you'd want to hide a member?

I know of a forum that frequently hides members and posts. But their motives aren't honorable.

Am I missing something? :wink:


OMG i do not have a good answer on this, one thing it is sure and it is that depends on the points of view, ie. a member of your board does not like to be shown in the memberlist (the reasons can be various depending on the kind of board this MOD will be used)...

greets
Perhaps. Maybe dating or very personal boards :?

It's a very useful hack for someone with the need, and kudos to you for making it! :wink:
Image
Some mornings, it's just not worth chewing through the leather straps

User avatar
3Di
Former Team Member
Posts: 14047
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Post by 3Di » Fri Sep 23, 2005 4:01 pm

Capmaster wrote: Perhaps. Maybe dating or very personal boards :?

It's a very useful hack for someone with the need, and kudos to you for making it! :wink:


It is not a MOD of mine, i only tried to help. ;)
Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
My development's activity ΒΊ PhpStorm's proud user
Extensions, Scripts, MOD porting, Update/Upgrades
πŸ‘¨β€πŸ« | Take a tour to | The Studio | πŸ‘¨β€πŸ«

Capmaster
Registered User
Posts: 69
Joined: Tue Jul 05, 2005 1:26 pm

Post by Capmaster » Sun Oct 02, 2005 6:39 pm

3Di wrote:
Capmaster wrote:Perhaps. Maybe dating or very personal boards :?

It's a very useful hack for someone with the need, and kudos to you for making it! :wink:


It is not a MOD of mine, i only tried to help. ;)
Go with it bra! :D

MOD writer: Kudos! :wink:
Image
Some mornings, it's just not worth chewing through the leather straps

rreptile
Registered User
Posts: 166
Joined: Wed Oct 06, 2004 12:51 pm
Location: Canada

Post by rreptile » Wed Oct 12, 2005 1:12 pm

Capmaster wrote: Aside from questionable motives, can someone give me a "for instance" when you'd want to hide a member?


I have some private forums. There are some members of those private forums (those who do not post to the public forums) who wish to remain hidden entirely.

I'm very glad to see that this mod has been written. I've just downloaded it and am just about to install it.

rreptile
Registered User
Posts: 166
Joined: Wed Oct 06, 2004 12:51 pm
Location: Canada

Post by rreptile » Wed Oct 12, 2005 4:35 pm

Snag #1 with SQL

As far as I know, I entered the following in the SQL section of my forum database in phpMyAdmin:

Code: Select all

ALTER TABLE phpbb_users ADD show_in_memberlist TINYINT(1) NULL Default(1);
This is the message that came up:
#1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(1)' at line 1


I have no idea where the manual for MySQL server version might be. edit: MySQL version is 4.0.25-log Please advise.

second edit: okay, I've resolved that part now...

Code: Select all

ALTER TABLE phpbb_users ADD show_in_memberlist TINYINT(1) NULL Default '1';

Now I have brand new syntax error in memberlist.php. I'll see if I can fix it myself.

(As you may have guessed already, I'm almost entirely clueless about SQL)

rreptile
Registered User
Posts: 166
Joined: Wed Oct 06, 2004 12:51 pm
Location: Canada

Post by rreptile » Wed Oct 12, 2005 5:34 pm

my forum memberlist.php wrote: Parse error: parse error, unexpected T_STRING in [...]forum/memberlist.php on line 307



This is what is on line 307:

Code: Select all

WHERE user_id <> " . ANONYMOUS . " and show_in_memberlist <> 0";
Have I misread something on the mod?

(So sorry to bother you guys.... not only do I know little about SQL, but I also know little about php and what an expected or unexpected T_STRING is)
Last edited by rreptile on Wed Oct 12, 2005 6:13 pm, edited 1 time in total.

User avatar
fazaljatoi
I've Been Banned!
Posts: 503
Joined: Wed Aug 31, 2005 8:02 pm

Post by fazaljatoi » Wed Oct 12, 2005 5:47 pm

Good and nice mod working perfect

thx for this MOD

rreptile
Registered User
Posts: 166
Joined: Wed Oct 06, 2004 12:51 pm
Location: Canada

Post by rreptile » Wed Oct 12, 2005 10:40 pm

I'm still struggling with this. And I'm suspecting that I'm having a conflict with a session management mod I already have installed, in which one must login to see the memberlist.

In memberlist.php this is what I have before installing the memberlist hidden user MOD

Code: Select all

	WHERE user_id <> " . ANONYMOUS . " AND user_active = 1 
	ORDER BY $order_by";
and further down the page

Code: Select all

		FROM " . USERS_TABLE . "
		WHERE user_id <> " . ANONYMOUS;
The page appears to be choking when I alter the second section to the following:

Code: Select all

		FROM " . USERS_TABLE . "
// Memberlist Hidden User mod: WHERE user_id <> " . ANONYMOUS;
WHERE user_id <> " . ANONYMOUS AND show_in_memberlist <> 0";
Will one of you php whizzes tell me what needs to be changed in order to stop getting the unexpected T_STRING error message?

edit:
I suspect the first part of the code has to be fixed somehow as well. It was choking when I had

Code: Select all

	WHERE user_id <> " . ANONYMOUS . " AND user_active = 1 
        AND show_in_memberlist <> 0
	ORDER BY $order_by";
in the first section


2nd edit: Is there some sort of "IF" and "ELSE" thing I have to use? (Very sorry that I'm trying to swim in the deep end when I don't even know how to inflate my water wings)
(classic template, phpbb2.0.17)

rreptile
Registered User
Posts: 166
Joined: Wed Oct 06, 2004 12:51 pm
Location: Canada

Post by rreptile » Fri Oct 14, 2005 6:00 am

excuse me for replying to myself.

I have now got it working (I had foolishly put some comments to myself inside the statements instead of outside). It's working beautifully now.

Thanks for this MOD.

Post Reply

Return to β€œ[2.0.x] MOD Database Cleanup”