Author |
Topic |
Etymon
Advanced Member
United States
2385 Posts |
Posted - 20 May 2006 : 18:34:04
|
Does anyone have a way that I can set an option in the user's profile that when they log in that the text on the site is converted to ALL CAPS?
I have a member whose eyesight is very poor. I can covert the messages she types and the messages that she reads which were type be others by using lcase and ucase, but for everything besides the messages (like the navigation tree, etc.), I want to find an easier way than putting "if" "then" and "end if" statements everywhere.
Thank you,
Etymon < |
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 20 May 2006 : 18:43:37
|
The user should be able to use the "text size" option in the browser, to make the text larger, you should not need to make it all caps< |
|
|
AnonJr
Moderator
United States
5768 Posts |
Posted - 20 May 2006 : 18:59:19
|
Not to mention the fact that all-caps is harder to read. I'd educate them on the "text size" option.< |
|
|
dayve
Forum Moderator
USA
5820 Posts |
Posted - 20 May 2006 : 20:40:07
|
As already stated, I would not use all caps, it will actually be harder to read.
I recommend adding something like this to your site to make it easier for those visitors that want to increase/decrease their font size dynamically.
http://www.dyn-web.com/dhtml/sizefont/index.php< |
|
|
|
Etymon
Advanced Member
United States
2385 Posts |
Posted - 20 May 2006 : 20:48:00
|
quote: Originally posted by AnonJr
Not to mention the fact that all-caps is harder to read. I'd educate them on the "text size" option.
Thanks guys! That's an easy, cross-site solution for sure for her.
The main problem (I should have mentioned it earlier) is are the spuratic few other members who read her posts who think she is SHOUTING at them.
She can't type like I am typing right here and read her own typing without using all caps, and she gets embarrassed as well as weary telling everyone all of the time that she has a handicap. Those spuratic few members bash her from time to time in the forums about using all caps.
There's not much she can do about it other than to not post. I don't want that. I am sure she doesn't want that either.
I figured if I convert her text into lower case as it is going into the database, then, at least, others might think she was whispering rather than shouting. Then on her side, for her profile, I'll convert the messages to upper case so that she can read everyone's messages without having to struggle.
For her messages going into the database, I'd like to be able to convert the first letter of every word that comes after a . (period) so that it is capitalized and would look moreso grammatically correct. I have to research some on that one. I figure it can be done with a function, just have to figure it out.
Thank you for the quick and thoughtful replies!
Etymon < |
|
|
Etymon
Advanced Member
United States
2385 Posts |
|
AnonJr
Moderator
United States
5768 Posts |
Posted - 21 May 2006 : 01:22:30
|
Nope. But I'd strongly suggest helping her with a screen-magnifier (there's one built into Windows, not good but its there), or educating on how to use the browser's "text-size" functions, or working with dayve's solution. All three won't cost you a bit server-side in terms of performance or potential for error.
Besides, as documented in several areas, all-caps is harder to read. By making everything all-caps you may be making it more visible but not more readable.
If anything, I would put in a function to convert all posts to sentence-case just to stop the people who are really yelling. < |
|
|
dayve
Forum Moderator
USA
5820 Posts |
Posted - 21 May 2006 : 11:39:39
|
quote: Originally posted by Etymon
Ok, I found something that interests me for the upper/lower case delimna. The first post is a function, but the second is in a language that is not familiar to me. The second appears from reading the author's reply to be more along my needs.
1) Thread: Change Case to Title Case?
http://dbforums.com/showpost.php?s=894db062aca65befb1edb2234c0331b5&p=1362916&postcount=2
2) Thread: Converting to Upper Case
http://forums.databasejournal.com/archive/index.php/t-14300.html
Does anyone have any idea how to convert the second one over to work with an Access database?
Thank you,
Etymon
I'm still not quite sure why you would want to do that, but using Proper Case or Title Case is as simple as doing something like this:
<span style="text-transform: capitalize;"><%= LCase(strField) %></span>
I have a PCase function that I have used in ASP but found the above a lot slimmer in coding. It can easily be applied to your forum code as well with some conditional logic if you wanted it to be a feature that can be turned on and off but I still feel compelled to tell you that it is not a good idea. If you need the size of the text changed on the fly for visitors, check out the link to the script I posted earlier in this thread.
UPDATE: The one I posted earlier is not free, but this one is:
http://dhtmlnirvana.com/content/fontsize/fontsize1.html
Demo:
http://dhtmlnirvana.com/content/dhtml/fontsize/fontsizer.html#< |
|
Edited by - dayve on 21 May 2006 11:43:06 |
|
|
dayve
Forum Moderator
USA
5820 Posts |
Posted - 21 May 2006 : 12:36:53
|
If you know for a fact that this person is really good using periods, then you could use a function similar to this:
Function CaseIt(fText)
Dim fTextArray, firstCharacter, lengthSentence, capitalizedSentence
fText = lcase(fText)
fTextArray = split(fText, ". ")
For i = lbound(fTextArray) to ubound(fTextArray)
firstCharacter = ucase(left(fTextArray(i),1))
lengthSentence = len(fTextArray(i))
capitalizedSentence = firstCharacter & mid(fTextArray(i), 2, lengthSentence)
CaseIt = CaseIt & capitalizedSentence
if i < ubound(fTextArray) then CaseIt = CaseIt & ". "
Next
End Function
Mind you that I used long variable names so you can see what is going on. Personally I don't like the way this is handled, but it does work. Here is a demo:
http://www.burningsoulsforum.com/caseit.asp
I also got to thinking that we have a resident RegEx guru around here, -gary, that may be able to throw something together.
Since I mentioned this function earlier, I figured I would share it as well. It is the Proper Case function I use for when I really need every word in a sentence capitalized.
Function PCase(string)
Dim Tmp, Word, Tmp1, Tmp2, firstCt, a, sentence, c, i
If IsNull(string) Then
PCase = Null
Exit Function
Else
string = CStr( string )
End If
a = Split( string, vbCrLf )
c = UBound(a)
i = 0
For each sentence in a
Tmp = Trim( sentence )
Tmp = split( sentence, " " )
For Each Word In Tmp
Word = Trim( Word )
Tmp1 = UCase( Left( Word, 1 ) )
Tmp2 = LCase( Mid( Word, 2 ) )
PCase = PCase & Tmp1 & tmp2 & " "
Next
PCase = Left( PCase, Len(PCase) - 1 )
If i = c then
Else
PCase = PCase & vbCrLf
End If
i = i + 1
Next
End Function
However, since using the method noted earlier combining the LCase() and CSS, I rarely use this function anymore.
< |
|
Edited by - dayve on 21 May 2006 13:04:01 |
|
|
AnonJr
Moderator
United States
5768 Posts |
Posted - 21 May 2006 : 13:10:42
|
I'd forgotten about that particular bit of CSS...< |
|
|
dayve
Forum Moderator
USA
5820 Posts |
Posted - 21 May 2006 : 13:20:45
|
quote: Originally posted by AnonJr
I'd forgotten about that particular bit of CSS...
The other reason I like using the CSS technique over the PCase function is for things like this where special characters encapsulate words that should be capitalized:
nine inch nails - sin (dub)
PCase Result:
Nine Inch Nails - Sin (dub)
CSS Result:
Nine Inch Nails - Sin (Dub)< |
|
Edited by - dayve on 21 May 2006 13:21:30 |
|
|
AnonJr
Moderator
United States
5768 Posts |
Posted - 21 May 2006 : 14:03:18
|
heck of a lot better than the function I wrote.. granted it covered quite a few other cases, but it just wasn't practical. Just so you know, I was using it to strip away the caps lock that the nurses seem to so love.
I may post it just for reference, but it'll have to wait until I get to work tomorrow.< |
|
|
dayve
Forum Moderator
USA
5820 Posts |
Posted - 21 May 2006 : 14:10:11
|
quote: Originally posted by AnonJr
heck of a lot better than the function I wrote.. granted it covered quite a few other cases, but it just wasn't practical. Just so you know, I was using it to strip away the caps lock that the nurses seem to so love.
I may post it just for reference, but it'll have to wait until I get to work tomorrow.
I work with 2 applications that are DOS and UNIX based and for some reason all the text in these applications are in all CAPS. I too have the same problem with users just being accustomed to using all CAPS and it just drives me absolutely insane. I've developed web applications that provide listings for the public and I can't tell you how many times they have updated their request to have me display the information in all CAPS. I ALWAYS refuse and tell them how ridiculous it would be to do that.< |
|
Edited by - dayve on 21 May 2006 14:10:45 |
|
|
Etymon
Advanced Member
United States
2385 Posts |
Posted - 21 May 2006 : 15:24:04
|
The CaseIt function seems to be what I am after.
Reference: This is the conversation I had with her this week: http://www.cricketscreations.com/forum/topic.asp?TOPIC_ID=153
Posting Messages: I need the CaseIt function for her messages that she types that are going from her posts into the database, so that she can still type in ALL CAPS, but the input going into the database will be filtered by the CaseIt function. It will look closer to a normal post than it would if it were all caps.
Reading Messages: The UCase() I need for messages that she reads that have been posted by everyone else that are coming out of the database and are being filtered by the UCase() to make the case larger for only her. This way she will be able to read the messages on the board without getting worn out.
I know it's hard to read in all caps, but this is the only option this lady has. This is just a MOD for one lady who can't read that well. She's a friend from another forum we administered and we got complaints from some members that she was shouting. So, instead of changing from all caps, she tries to dim the brightness of her text as to not offend. I just want her to glide through the posts like everyone else does.
I'm going to put it into profile page as an option for "sight-impaired" members to use.
I'd like to wrap it up as a MOD and put your name in with the credits Dayve, if that is ok with you. Actually, since it will have a dbs_ file, I'll include Huwr into it as well since that was his code originally, I think.
Cheers,
Etymon < |
Edited by - Etymon on 21 May 2006 15:33:54 |
|
|
Etymon
Advanced Member
United States
2385 Posts |
Posted - 21 May 2006 : 17:32:28
|
Hi dayve,
I ran into a snag.
The CaseIt works really nice on the first paragraph, but not on the others that follow it. Those paragraphs are all converted to lowercase completely.
What do I need to do to make the function recognize line breaks?
Thanks again,
Etymon < |
|
|
dayve
Forum Moderator
USA
5820 Posts |
Posted - 21 May 2006 : 18:24:30
|
DOH! ... I know why it is doing it and there is not an easy fix. However, I have some ideas and one of those includes a RegEx technique found here:
http://www.experts-exchange.com/Web/Web_Languages/JavaScript/Q_21780040.html
UPDATE: The RegEx example in the link above fails the same way. The problem being is that a carriage return is an HTML break <br /> so the script things the first character after the last sentence is a <. There will be additional conditional checks needed for this function to work. Should be able to do it but just looking for the cleanest way. < |
|
Edited by - dayve on 21 May 2006 18:38:42 |
|
|
Topic |
|