+ Reply to Thread
Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16

Thread: How can i stop people using caps in the title ?

  1. #11
    Flynax developer Rudi's Avatar
    Join Date
    Dec 2014
    Location
    Planet Earth
    Posts
    3,174
    You don't need to use 'if' statement, you should use only my code line

    I forgot to mention: you need to edit this file: includes/classes/rlListings.class.php > find public function create

    replace:
    PHP Code:
    Only registered members can view the code
    with:
    PHP Code:
    Only registered members can view the code
    then in public function edit

    replace:
    PHP Code:
    Only registered members can view the code
    with:
    PHP Code:
    Only registered members can view the code
    Last edited by Rudi; January 3, 2024 at 10:04 AM.

  2. #12
    Senior Member
    Join Date
    Dec 2023
    Posts
    161
    Thanks! Now it is working; however it does need a conditional, at least for my use case (and I think many)

    I want to transform
    ITEM SOMETHING to Item something

    However I do not want to transform
    Item Something to Item something

    (I only want to override what someone enters in terms of Capitalization if they have their CAPS LOCK on, especially when applying to a text area where I don't want to lose all the capitalization, just override if the person has typed the whole paragraph in ALL CAPS)
    Last edited by Horizon; January 3, 2024 at 10:26 AM.

  3. #13
    Flynax developer Rudi's Avatar
    Join Date
    Dec 2014
    Location
    Planet Earth
    Posts
    3,174
    In this case, it will require a customization to check every text word for ALLCAPS

  4. #14
    Senior Member
    Join Date
    Dec 2023
    Posts
    161
    Was just about to post after playing with this all night. I'm wondering about combining your instruction with the example if statement in post 3. Something like:

    Code:
    Only registered members can view the code.

  5. #15
    Senior Member
    Join Date
    Dec 2023
    Posts
    161
    It seems to work in practice but I'm not sure if the
    Code:
    Only registered members can view the code.
    is safe/correct to use in that context.

    In limited testing so far,
    ALL CAPS changes to All caps
    no caps stays no caps
    Some Caps stays Some Caps

    (I only have one language on my site so I didn't apply to the multilingual section)

    P.S. thanks again for taking all the time tonight to look at this!
    Last edited by Horizon; January 3, 2024 at 11:47 AM.

  6. #16
    Senior Member
    Join Date
    Dec 2023
    Posts
    161
    I think the above post 14 works for text and textarea if it's safe to use.

    The above does seem to work to prevent 100% ALL CAPS in a field, but it won't do anything if it's 99% all caps.

    Reading again what you posted, I see your point too now. The ideal would probably be a more complex customization that calculates the percentage of all caps in a field and forces lower case if it's over 90% all caps if it's over x-number of characters to allow a few cases where a field will be all caps like a three letter all caps model name, but prevent cases where someone is typing a whole sentence unnecessarily in ALL CAPS.

    The above seems to at least have limited functionality for me though so I like that. I have a number of more important customizations that I'm going to have you do first, so I'll use this for now and then come back to it once I have everything rolling and request a customization with more functions probably!

    Thanks again for all your time tonight and taking the time to look at this!

+ Reply to Thread