Capitalize Username

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

Capitalize Username

Postby Midnight Phoenix » 17 Apr 2007, 19:11

MOD Name: Capitalize Username
MOD Version: 1.0.1
Author: Midnight Phoenix
MOD Description:
Converts username to capital letters upon registration. Keep the forum looking clean and professional.

Works with:
phpBB 3.0 BETA5

Language: English

Licence: GNU General Public License v2

Screenshots:
Included in Package

Installation Level: Easy
Installation Time: 7 Minutes
Download File:
Attachments
capitalize_username_v3_1.0.1.zip
(21.82 KiB) Downloaded 249 times
Midnight Phoenix    
Style Author
Style Author
 
Posts: 73
Joined: 24 Jan 2007, 21:20
Gender: Male
phpBB Knowledge: 10


Re: Capitalize Username

Postby Handyman » 17 Apr 2007, 20:19

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 :)
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 Midnight Phoenix » 18 Apr 2007, 15:58

What kind of poll options?
Midnight Phoenix    
Style Author
Style Author
 
Posts: 73
Joined: 24 Jan 2007, 21:20
Gender: Male
phpBB Knowledge: 10

Re: Capitalize Username

Postby Sniper_E » 18 Apr 2007, 16:05

Handyman likes the poll option in a mod's thread like you see here: viewtopic.php?f=85&t=1511
No is NEVER an Option and NEVER is the only Option when it comes to Giving Up!
User avatar
Sniper_E    
STG Jedi Master
STG Jedi Master
 
Posts: 7004
Joined: 31 May 2006, 06:29
Location: Shreveport, LA
Favorite Team: The STG Team
Gender: Male
phpBB Knowledge: 6

Re: Capitalize Username

Postby Badal » 19 Apr 2007, 15:51

hey. this script is not working properly. i just eidit script . and register new nick..but not working
User avatar
Badal
Lt. Jr Grade
Lt. Jr Grade
 
Posts: 175
Joined: 14 Apr 2007, 15:39
Gender: Male

Re: Capitalize Username

Postby zachpl » 19 Apr 2007, 15:52

It worked for me.
Sniper_E wrote:I speak French.... wee wee
zachpl
Beta Tester
Beta Tester
 
Posts: 195
Joined: 13 Apr 2007, 14:57
Favorite Team: Gaints
Gender: Male

Re: Capitalize Username

Postby Midnight Phoenix » 19 Apr 2007, 16:31

This is functional, you must have screwed up on installation. Because others have used this MOD and it works for them. See here http://www.clanhk.net/forum/index.php Either you put the code in the wrong part in ucp_register or you put the other part in simple_header.
Midnight Phoenix    
Style Author
Style Author
 
Posts: 73
Joined: 24 Jan 2007, 21:20
Gender: Male
phpBB Knowledge: 10

Re: Capitalize Username

Postby zachpl » 19 Apr 2007, 18:33

Midnight Phoenix wrote:This is functional, you must have screwed up on installation. Because others have used this MOD and it works for them. See here http://www.clanhk.net/forum/index.php Either you put the code in the wrong part in ucp_register or you put the other part in simple_header.


Yeah I installed it on my forum ^^ It works Perfectly.
Sniper_E wrote:I speak French.... wee wee
zachpl
Beta Tester
Beta Tester
 
Posts: 195
Joined: 13 Apr 2007, 14:57
Favorite Team: Gaints
Gender: Male

Re: Capitalize Username

Postby Semi_Deus » 20 Apr 2007, 02:19

im sorry im Dutch, could you explain what 'capitalize' means?
is it like an Italic font?
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 zachpl » 20 Apr 2007, 05:26

No it meens the first letter in a name is like this Index or George even if they put george
Sniper_E wrote:I speak French.... wee wee
zachpl
Beta Tester
Beta Tester
 
Posts: 195
Joined: 13 Apr 2007, 14:57
Favorite Team: Gaints
Gender: Male

Next

Return to Memberlist and Profiles

Who is online

Users browsing this forum: No registered users and 1 guest