Capitalize Username

MODs, Hacks, tips and tricks for memberlist, profiles, group members, and team members.
Custom Profile fields Hacks and MODs are also included

Re: Capitalize Username

Postby Handyman » 20 Apr 2007, 11:33

it means uppercase.
Uppercase Example -> A (capital)
Lowercase Example -> a (not capital)
Please contact me if you have any news to submit to SCOFF News.
SCOFFing at the candidates while you sleep.
My Mods || My Mod Queue
Image
User avatar
Handyman    
Rear Fleet Admiral
Rear Fleet Admiral
 
Posts: 7459
Joined: 08 May 2006, 04:45
Location: Where no man has gone before!
Favorite Team: Seattle Seahawks
Gender: Male




phpBB Academy at StarTrekGuide
Support STG
Using PayPal Donate

Re: Capitalize Username

Postby Semi_Deus » 20 Apr 2007, 18:32

Handyman wrote:it means uppercase.
Uppercase Example -> A (capital)
Lowercase Example -> a (not capital)



ooow yeah, offcourse, ive heard of that..
omg, i should have known that.. :doh:
Thanks both
Former Moderator & Styles team member
Image
User avatar
Semi_Deus
Admiral
Admiral
 
Posts: 2479
Joined: 13 Feb 2007, 13:53
Location: Netherlands
Favorite Team: Ajax
Gender: Male
phpBB Knowledge: 8

Re: Capitalize Username

Postby Midnight Phoenix » 21 Apr 2007, 14:32

I'm not that great at php and I already had the javascript code. I just finished a similar mod for topic titles

Handyman wrote:Hey Midnight, please edit your post to have a poll to make a standard mod release template.

Also a couple things you would want to change, in the install file, it's not a good idea to try and find a block of code this large
Spoiler:
Code: Select all
<!-- IF ._file -->



   /**

   * Play quicktime file by determining it's width/height

   * from the displayed rectangle area

   *

   * Only defined if there is a file block present.

   */

   function play_qt_file(obj)

   {

      var rectangle = obj.GetRectangle();



      if (rectangle)

      {

         rectangle = rectangle.split(',')

         var x1 = parseInt(rectangle[0]);

         var x2 = parseInt(rectangle[2]);

         var y1 = parseInt(rectangle[1]);

         var y2 = parseInt(rectangle[3]);



         var width = (x1 < 0) ? (x1 * -1) + x2 : x2 - x1;

         var height = (y1 < 0) ? (y1 * -1) + y2 : y2 - y1;

      }

      else

      {

         var width = 200;

         var height = 0;

      }



      obj.width = width;

      obj.height = height + 16;



      obj.SetControllerVisible(true);



      obj.Play();

   }

<!-- ENDIF -->



//-->

</script>



it would be better to find something like this
Spoiler:
Code: Select all
obj.Play();

   }

<!-- ENDIF -->



//-->

</script>

that way you have a much greater probability of actually finding it if mods have been added or line endings are different (which usually happens if you create your mod using a Windows Text Editor and somebody opens it on a Linux or Unix Machine? the line endings are usually different unless you made sure to set them to unix line endings)

Also, when posting how to edit multiple templates, instead of:
/styles/xxxx/template/overall_header.html
use
/styles/*/template/overall_header.html

the xxxx will be recognized as a style when easymod comes out, whereas the * is considered a wildcard and will install it for all styles.

and another thing, why did you decide to do this using javascript?
it would be much easier to accomplish using php? then you would only have 1 edit and you wouldn't have to edit every template.
Also, browsers have the ability to turn off javascript, so their username could end up in lowercase? so that defeats the purpose.

Here is how to do it using php
Spoiler:
OPEN
includes/ecp/ecp_register.php

FIND
Code: Select all
'username'            => request_var('username', '', true),


REPLACE WITH
Code: Select all
'username'            => ucwords(request_var('username', '', true)),

This method does exactly what your javascript does and it will change
"highway of life" to "Highway Of Life",

though somebody could still come along and create a usename like this "HIGHWAY OF LIFE", if you want only uppercase on the first characters all the time, you would use this instead
Spoiler:
OPEN
includes/ecp/ecp_register.php

FIND
Code: Select all
'username'            => request_var('username', '', true),


REPLACE WITH
Code: Select all
'username'            => ucwords(strtolower(request_var('username', '', true))),


that will change "highway of life" to "Highway Of Life"
and also 'HIghWay OF LifE" to Highway Of Life"

so just a couple options to consider :)
Midnight Phoenix    
Style Author
Style Author
 
Posts: 73
Joined: 24 Jan 2007, 21:20
Gender: Male
phpBB Knowledge: 10

Re: Capitalize Username

Postby Handyman » 21 Apr 2007, 15:19

see the last spoiler I have in there? that tells you everything you need for this mod? will make it much simpler for everybody :)
Please contact me if you have any news to submit to SCOFF News.
SCOFFing at the candidates while you sleep.
My Mods || My Mod Queue
Image
User avatar
Handyman    
Rear Fleet Admiral
Rear Fleet Admiral
 
Posts: 7459
Joined: 08 May 2006, 04:45
Location: Where no man has gone before!
Favorite Team: Seattle Seahawks
Gender: Male

Re: Capitalize Username

Postby anne » 25 Jan 2008, 19:48

Will any mod developer, make this available for prosilver? Thank you. :blush:
User avatar
anne
Supporter
Supporter
 
Posts: 84
Joined: 07 Nov 2007, 20:41
Gender: Female

Re: Capitalize Username

Postby stitch626 » 26 Jan 2008, 01:18

Hi Anne,

I believe that you can use this mod with Prosilver. Just place the overallheader code within the <head> and </head> tags and you should be ok. The user_register.html file should be pretty much the same as subsilver2. Just make sure you do a back-up of your files before you do this.
User avatar
stitch626    
STG Moderator Leader
STG Moderator Leader
 
Posts: 3185
Joined: 08 Feb 2007, 20:47
Location: Michigan
Favorite Team: Detroit Red Wings
Gender: Male
phpBB Knowledge: 7

Re: Capitalize Username

Postby man2u2uk » 08 Feb 2008, 13:57

Hi, i cannot find the following file anywhere.

includes/ecp/ecp_register.php
man2u2uk
Crewman
Crewman
 
Posts: 1
Joined: 09 Apr 2007, 09:34
Gender: Male

Re: Capitalize Username

Postby eviL3 » 08 Feb 2008, 14:06

ecp = ucp :)
Image
User avatar
eviL3    
MOD Author
MOD Author
 
Posts: 1002
Joined: 05 Nov 2006, 08:14
Location: Cooking in the MODs kitchen
Gender: Male

Re: Capitalize Username

Postby Midnight Phoenix » 08 Feb 2008, 14:40

Sorry I sort of abandoned this mod... lol this was from beta stages of phpBB3.
Midnight Phoenix    
Style Author
Style Author
 
Posts: 73
Joined: 24 Jan 2007, 21:20
Gender: Male
phpBB Knowledge: 10

Re: Capitalize Username

Postby gygasync » 15 May 2010, 12:30

with minor adjustments it worked smoothly to me :)
gygasync    
Cadet I
Cadet I
 
Posts: 12
Joined: 19 Apr 2010, 14:06
Location: Čelinac, RS
Gender: Male
phpBB Knowledge: 3

Previous

Return to Memberlist and Profiles

Who is online

Users browsing this forum: No registered users and 1 guest