php forum
php mysql forum
php mysql smarty
 
Topic Options
#51322 - 12/08/01 08:17 PM "6 member" to "6th" member?
Synotic Offline
Junior Member

Registered: 12/01/01
Posts: 3
Hi all, I think this is my first post on this boards. I recently got UBB for my currently unreleased site. I wanted to merge the total registered members and the welcome new user message into one sentence. I managed to turn it into this:

"Please welcome our newest member #6, Synotic"

However, I want to make it say:

"Please welcome our 6th and newest member, Synotic" instead.

But $TotalMembers only provides "6" and I have no idea how to make "6" into "6th" and "23" into "23rd" and so on.

If anyone could make this hack for me, I would be eternally greatful.

Thanks in advance.

Top
#51323 - 12/08/01 08:32 PM Re: "6 member" to "6th" member?
CopyCat Offline
Member

Registered: 12/01/00
Posts: 760
Loc: nowhere
this is a nice idea

you (or someone on this forums) would have to write a function that would add "rd"s and "th"s based on the number sent to it. im not american so i dont really know the grammatical rules for it, but i think someone here can help you out.

Top
#51324 - 12/08/01 09:33 PM Re: "6 member" to "6th" member?
Synotic Offline
Junior Member

Registered: 12/01/01
Posts: 3
Quote:
quote:
The function should take the last digit.. and then..

if it is '1' append 'st'
if it is '2' append 'nd'
if it is '3' append 'rd'
if it is '4' append 'th'
if it is '5' append 'th'
if it is '6' append 'th'
if it is '7' append 'th'
if it is '8' append 'th'
if it is '9' append 'th'
if it is '0' append 'th'

edit: I only want the function to perform if the number is less than or equal to 999.

<font color="#000000" size="1">[ 12-08-2001 09:40 PM: Message edited by: Synotic ]</font>

Top
#51325 - 12/11/01 08:54 PM Re: "6 member" to "6th" member?
Synotic Offline
Junior Member

Registered: 12/01/01
Posts: 3
Anyone? I can't imagine that this is very hard..

Top


Moderator:  Gizmo 
Who's Online
0 registered (), 27 Guests and 11 Spiders online.
Key: Admin, Global Mod, Mod
Shout Box

Latest Posts
How to hide sub forums from summary page
by Ruben Rocha
Today at 02:58 PM
Spell Check [beta]
by Bill B
Yesterday at 09:16 PM
PhotoPost BB Code Popup
by AllenAyres
Yesterday at 09:41 AM
Problems reading a lot of old posts here
by AllenAyres
Yesterday at 09:35 AM
Forum 'Trader Ratings'.
by AllenAyres
Yesterday at 09:33 AM
Customization needed
by Gizmo
11/12/08 12:28 PM
Team UBBDev Rides Again!
by AllenAyres
11/11/08 02:16 PM
New Mods
User Authentication Class
by
01/19/07 02:59 PM
Multiple Identity Detector
by
12/30/06 06:39 PM
PhotoPost BB Code Popup
by
11/06/06 05:43 PM
Spell Check [beta]
by
10/17/06 09:24 PM
Newest Members
David DelMonte, nick1, Begbie, cenk, MATTO
13363 Registered Users
Top Posters
AllenAyres 25452
JoshPet 11330
Rick 8372
LK 7396
Lord Dexter 6503
Greg Hard 5533
Charles Capps 5438

 

 

 
fusionbb message board php hacks