User Vs ...

Do not post support requests, bug reports or feature requests. Discuss phpBB here. Non-phpBB related discussion goes in General Discussion!
Ideas Centre
RexMundi412
Registered User
Posts: 41
Joined: Fri Nov 15, 2013 1:04 am

User Vs ...

Post by RexMundi412 » Sun Sep 14, 2014 1:06 pm

1st I want to thank everyone who has contributed to phpBB!
___
I was bores so I thought I'd try getting a discussion started...

The term "user" has always bugged me a little, since it has a bit of a negative connotation. I'm sure it can be done, but haven't check out how complicated it might be. I'm guessing it might be tough since "user" is probably so woven into the code by now? And for that reason, probably wouldn't want to do it if it wasn't an official phpBB update. But anyway I thought I'd throw it out as a discussion topic.

I was thinking of posting possible terms to use to see how much support for this there might be...

"Member" is my suggestion. Seems logical since it is all ready used in places to describe everyone on a board including Mods and Admins in some places.

~ Rex

User avatar
Lumpy Burgertushie
Registered User
Posts: 66929
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: User Vs ...

Post by Lumpy Burgertushie » Sun Sep 14, 2014 1:33 pm

bored is right :lol:
I can't see any value in doing this at all. as you said, it would take changing many many many things in the code and all for no valid reason.

why on earth do you think there is a negative connotation to the use of the word "user"?

a user is someone who uses something. in the case the user is using the bulletin board.

no different than member.

a member is someone who is a member of something, in this case a bulletin board.

when a member is accessing the bulletin board they are not membering the bulletin board, they are using it.
therefore they are a user of the bulletin board

sorry, just don't see any point to this one.
no offense.


robert
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

If a tree falls in the forest and nobody is there, does it make a sound?

User avatar
AdamR
Former Team Member
Posts: 9731
Joined: Tue Mar 02, 2004 5:40 pm
Location: Tampa, Florida
Name: Adam Reyher
Contact:

Re: User Vs ...

Post by AdamR » Sun Sep 14, 2014 3:24 pm

The only "code" that would need to be changed for this to happen would be the strings in the language files. There are a lot of them that you'd have to go through, but it wouldn't break much in terms of forward compatibility. The best way to accomplish it would be to duplicate the English language pack and rename it to something like "en_member" and just use that on your board. That way you leave the original en files intact and would just need to track future changes to the language files and manually update your version.

A bit too much work for something so minor, in my opinion, but it's not an obscene amount of work. Certainly nothing on the order of changing actual phpBB code.
phpBB Support: Welcome | Userguide | Knowledge Base | Search
Honored supporter of the phpBB Group!
"If I have seen a little further it is by standing on the shoulders of Giants." - Isaac Newton

cleverwise
Registered User
Posts: 37
Joined: Fri Feb 28, 2014 10:55 pm
Location: Atlanta, GA
Name: Jeremy

Re: User Vs ...

Post by cleverwise » Sun Sep 14, 2014 8:05 pm

***** OLD CODE! ****** SEE UPDATED CODE BELOW!

Okay I have a code solution, although I haven't checked every situation to verify I got 100% of the user references in English. This code is only replacing user on the visitor/user side of the board and not in the admin panel.

Please read the whole post before attempting to apply this code!

1) Save a backup copy of the index.php file in your main phpBB directory.

2) Using your favorite text editor (don't use Word or OpenOffice) open index.php for editing.

3) Locate the code block:

Code: Select all

// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup('viewforum');
After the last line hit enter twice and paste the following code:

Code: Select all

//	Load the user language array
foreach ($user->lang as $langitem => $langvalue) {
	//	Verify language text isn't held in an array
	if (!is_array($langvalue)) {
		//	Verify the text contains a form of user and if so replace it
		if (preg_match('/user/i',$langvalue)) {
			$langvalue=preg_replace('/user/','member',$langvalue);
			$langvalue=preg_replace('/User/','Member',$langvalue);
			$user->lang[$langitem]=$langvalue;
		}
	}
}
So finished it would look like:

Code: Select all

// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup('viewforum');

//	Load the user language array
foreach ($user->lang as $langitem => $langvalue) {
	//	Verify language text isn't held in an array
	if (!is_array($langvalue)) {
		//	Verify the text contains a form of user and if so replace it
		if (preg_match('/user/i',$langvalue)) {
			$langvalue=preg_replace('/user/','member',$langvalue);
			$langvalue=preg_replace('/User/','Member',$langvalue);
			$user->lang[$langitem]=$langvalue;
		}
	}
}
4) Save this file and upload to your phpBB board allowing for overwrites.

5) Visit your board. If there is an error upload your backed up copy (or the one from the phpBB zip/tar file).

Notes:

There are no warranties with this code. I tested it but not for to long. If you have a test board I highly recommend trying this code on it before your live/production one(s). Also be ready to quickly restore a backed up/original index.php file in case your board errors out. If you have a busy board I would suggest making this change during an off peak time. However it is your board.

This code will automatically replace the references to user and change them to member on all languages. This is the easy method as you don't have to recode all the language files. This saves work and allows for easier upgrading since you won't have to reapply your word changes manually. However this comes at the cost of forcing the server to do a find and replace each time your board is loaded. So that is the trade off. At present there is no logic to check for language (like English) so it will perform this search on all languages. That could be added, however I am guessing very few people run multiple language boards.
Last edited by cleverwise on Tue Sep 16, 2014 4:35 pm, edited 1 time in total.
Respectfully,
Jeremy

DevOPs - Linux Admin, PHP Developer, Oracle DBA OCP Training
Display phpBB statistics on WordPress (Read more...)

User avatar
david63
Registered User
Posts: 16842
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood
Contact:

Re: User Vs ...

Post by david63 » Sun Sep 14, 2014 8:10 pm

But that would only work on index - what about all the other pages where there may be a reference to "user".

Oh and you forgot about "users", and probably other permutations.

For me life is too short to worry about this
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored

cleverwise
Registered User
Posts: 37
Joined: Fri Feb 28, 2014 10:55 pm
Location: Atlanta, GA
Name: Jeremy

Re: User Vs ...

Post by cleverwise » Sun Sep 14, 2014 8:17 pm

You do raise a valid point as phpBB doesn't run everything through the main index.php like Wordpress, for example, but it should work in all the main files.

For example search.php that code would go below:

Code: Select all

// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup('search');
The code will replace:

User, Users, user, and users

It just looks for the root word user either all lower or initial capital.
Respectfully,
Jeremy

DevOPs - Linux Admin, PHP Developer, Oracle DBA OCP Training
Display phpBB statistics on WordPress (Read more...)

RexMundi412
Registered User
Posts: 41
Joined: Fri Nov 15, 2013 1:04 am

Re: User Vs ...

Post by RexMundi412 » Sun Sep 14, 2014 10:15 pm

cleverwise, you must of been extra bored! Good, stuff though. I may try it this week.

cleverwise
Registered User
Posts: 37
Joined: Fri Feb 28, 2014 10:55 pm
Location: Atlanta, GA
Name: Jeremy

Re: User Vs ...

Post by cleverwise » Sun Sep 14, 2014 10:43 pm

Well I like coding and code all kinds of things. I have written hundreds of small scripts, plugins for projects like Wordpress, huge multi-user database driven systems, even full custom content management systems. So I thought what the heck I can invest 30 minutes or so just for fun.

I admit I didn't spend a lot of time to super polish the end result. For example that code would really be best in a central functions file. However I am not up to speed on the layout of phpBB. I know Wordpress a lot better, for example. Anyway I did look briefly but couldn't find the general language assembly code (for all the files).

So I just tossed the code in the index.php. Then, as pointed out, I forgot phpBB doesn't always run index.php (like Wordpress for example), so that edit would need to be done in all the main files. Or another way would be create a file like user.replace.php and put the code in that file. Then just place

Code: Select all

include_once('user.replace.php');
in each file.

There are multiple ways to do this and I didn't mind giving it a go. I am a programmer, database, and server admin and enjoy little and big challenges. :-) It was fun.
Respectfully,
Jeremy

DevOPs - Linux Admin, PHP Developer, Oracle DBA OCP Training
Display phpBB statistics on WordPress (Read more...)

Pond Life
Registered User
Posts: 388
Joined: Sat Jan 20, 2007 1:55 am

Re: User Vs ...

Post by Pond Life » Mon Sep 15, 2014 9:18 am

You do know that 'member' can have another meaning too don't you? :lol:

All members are users but not all users are members. What about guests? They are using the board but they're not members.
Never argue with idiots, they will drag you down to their level and beat you with experience.

RexMundi412
Registered User
Posts: 41
Joined: Fri Nov 15, 2013 1:04 am

Re: User Vs ...

Post by RexMundi412 » Mon Sep 15, 2014 2:18 pm

I really like how you are ready to throw in and help cleverwise. And how you jumped in on something I was just musing at really impressed me. I'm glad we have you as a "user" here!
___
Pond Life wrote:You do know that 'member' can have another meaning too don't you? :lol:

All members are users but not all users are members. What about guests? They are using the board but they're not members.
Yea, but "member" is a good connotation, especially for the ladies.

But that double meaning does show the side you take on all this goes toward personal perspective. For example Lumpy Burgertushie doesn't appear to see the negative in the term "user". However when I hear "user" the 1st thing that jumps to mind is someone who uses or takes advantage of another person. When in reality these(member, user and the like) terms are neutral.

I dunno, I think "guest(s)" would the most proper people to use the term "user(s)" for? To me where "user"(registered peeps) is currently used I think of them as "contributer(s)". At least the one's who post, lest ye be a "lurker". But even lurkers contribute to membership stats.
___
It's all semantics, but that is what make this a fun topic. We can go on and on in circles debating this. And who don't like debating things they love doing with others who enjoy the same. :D

Pond Life
Registered User
Posts: 388
Joined: Sat Jan 20, 2007 1:55 am

Re: User Vs ...

Post by Pond Life » Mon Sep 15, 2014 2:27 pm

RexMundi412 wrote:However when I hear "user" the 1st thing that jumps to mind is someone who uses or takes advantage of another person.
I think it's quite sad that that's the meaning that jumps to your mind. That very specific meaning hadn't even occurred to me. :(
Never argue with idiots, they will drag you down to their level and beat you with experience.

cleverwise
Registered User
Posts: 37
Joined: Fri Feb 28, 2014 10:55 pm
Location: Atlanta, GA
Name: Jeremy

Re: User Vs ...

Post by cleverwise » Mon Sep 15, 2014 3:07 pm

Pond Life wrote:You do know that 'member' can have another meaning too don't you?

All members are users but not all users are members. What about guests? They are using the board but they're not members.
Well any word can just about have multiple meanings. ;-) However member is pretty common. When you join a gym you get a membership not a usership. When you get a grocery rewards program you are usually referred to as a member. There are many websites that say members or memberships for their login areas both free and paid. It is all word play but like most things in life there are multiple ways to do something and it often doesn't mean one is right and another is wrong. It is just different.

As for your comment about "all users are members. What about guests?". I am not 100% sure what you are referring too. Yes I understand individuals browsing that aren't logged in are "guests". However are you referring to the code change I presented or the word itself? If you are referring to the code above it will only replace the word user (even if user is part of the word like username) while the word guest still remains.
RexMundi412 wrote:I really like how you are ready to throw in and help cleverwise. And how you jumped in on something I was just musing at really impressed me. I'm glad we have you as a "user" here!
No problem. As I said the code would be best in a general functions file where the $user->lang is assembled but as stated I didn't find the specific code base. I need more time to learn the phpbb layout better.

One could use the code above to modify user to anything. For example if you ran a board about pets you could change user to "pet owner". That would modify user -> pet owner, users -> pet owners, username -> pet ownername, etc.
Respectfully,
Jeremy

DevOPs - Linux Admin, PHP Developer, Oracle DBA OCP Training
Display phpBB statistics on WordPress (Read more...)

cleverwise
Registered User
Posts: 37
Joined: Fri Feb 28, 2014 10:55 pm
Location: Atlanta, GA
Name: Jeremy

Re: User Vs ...

Post by cleverwise » Tue Sep 16, 2014 4:33 pm

This post contains updated code!

I have found the general language call to update all pages. This means it only requires one file edit to alter all the visitors files. As always backup your original file and be ready to restore it. I highly recommend trying this edit on a test board install.

Read through all steps before attempting edit.

1) In your preferred text editor (I like Notepad++) open the file session.php in the includes directory/folder.

2) Run a search (or look for) function set_lang, line 2065 on my editor.

3) Now scroll down until you see:

Code: Select all

		else if ($use_db)
		{
			// Get Database Language Strings
			// Put them into $lang if nothing is prefixed, put them into $help if help: is prefixed
			// For example: help:faq, posting
		}
4) Just after the } hit enter twice so you have a double line break. Now paste in the following code - make sure you copy all the code as it scrolls down!

Code: Select all

	//	Replace all user text with member text
		//	Load the language array and loop through entries
		foreach ($lang as $langitem => $langvalue) {
			//	Verify text isn't held in an array
			if (!is_array($langvalue)) {
				//	Verify text contains a form of user and if so replace it
				if (preg_match('/user/i',$langvalue)) {
					//	All lower case
					$langvalue=preg_replace('/user/','member',$langvalue);
					//	Initial caps
					$langvalue=preg_replace('/User/','Member',$langvalue);
					//	Update text with changes
					$lang[$langitem]=$langvalue;
				}
			}
		}
		//	Release unneeded resources
		unset($langitem);
		unset($langvalue);
The end edit should look like:

Code: Select all

		else if ($use_db)
		{
			// Get Database Language Strings
			// Put them into $lang if nothing is prefixed, put them into $help if help: is prefixed
			// For example: help:faq, posting
		}
		
		//	Replace all user text with member text
		//	Load the language array and loop through entries
		foreach ($lang as $langitem => $langvalue) {
			//	Verify text isn't held in an array
			if (!is_array($langvalue)) {
				//	Verify text contains a form of user and if so replace it
				if (preg_match('/user/i',$langvalue)) {
					//	All lower case
					$langvalue=preg_replace('/user/','member',$langvalue);
					//	Initial caps
					$langvalue=preg_replace('/User/','Member',$langvalue);
					//	Update text with changes
					$lang[$langitem]=$langvalue;
				}
			}
		}
		//	Release unneeded resources
		unset($langitem);
		unset($langvalue);
	}
5) Save and upload the file. Then check your board. If all was edited correctly user (all references as this is searching for user in any part of any word) will be replaced. If your board errors out (goes white screen) then restore the backed up/original session.php file.
Respectfully,
Jeremy

DevOPs - Linux Admin, PHP Developer, Oracle DBA OCP Training
Display phpBB statistics on WordPress (Read more...)

User avatar
Lumpy Burgertushie
Registered User
Posts: 66929
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: User Vs ...

Post by Lumpy Burgertushie » Tue Sep 16, 2014 7:31 pm

will that have any effect on the word user when used in a post?


robert
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

If a tree falls in the forest and nobody is there, does it make a sound?

cleverwise
Registered User
Posts: 37
Joined: Fri Feb 28, 2014 10:55 pm
Location: Atlanta, GA
Name: Jeremy

Re: User Vs ...

Post by cleverwise » Tue Sep 16, 2014 11:07 pm

Lumpy Burgertushie wrote:will that have any effect on the word user when used in a post?


robert
Nope. It only effects the word user found in the language files. It won't change user in posts or anywhere else in the code. Plus as I have stated it isn't just user but in any part of a word user appears like username, users, usergroup, etc. :)
Respectfully,
Jeremy

DevOPs - Linux Admin, PHP Developer, Oracle DBA OCP Training
Display phpBB statistics on WordPress (Read more...)

Post Reply

Return to “phpBB Discussion”