Is there a way to convert to lowercase

Looking for a MOD? Have a MOD request? Post here for help. (Note: This forum is community supported; phpBB does not have official MOD authors)
Anti-Spam Guide
Locked
jaylam13
Registered User
Posts: 194
Joined: Wed Sep 29, 2010 5:58 pm
Contact:

Is there a way to convert to lowercase

Post by jaylam13 »

Hi,

Is there a mod or tweak I can do so when someone posts a topic title in caps it converts it to lower case?

Thanks

Jay
Last edited by JimA on Fri Aug 26, 2011 8:47 pm, edited 1 time in total.
Reason: No discussion value, so moved this one from General Discussion to MOD Requests. :)
User avatar
Arty
Former Team Member
Posts: 16654
Joined: Wed Mar 06, 2002 2:36 pm
Name: Vjacheslav Trushkin
Contact:

Re: Is there a way to convert to lowercase

Post by Arty »

In posting.php find

Code: Select all

if ($submit || $preview || $refresh)
{
	$post_data['topic_cur_post_id']	= request_var('topic_cur_post_id', 0);
	$post_data['post_subject']		= utf8_normalize_nfc(request_var('subject', '', true));
and add after it:

Code: Select all

	if(strtoupper($post_data['post_subject']) == $post_data['post_subject']) $post_data['post_subject'] = strtolower($post_data['post_subject']);
I haven't tested it, but I think it should work.
Vjacheslav Trushkin / Arty.
Free phpBB 3.1 styles | New project: Iconify - modern SVG framework
User avatar
AmigoJack
Registered User
Posts: 5795
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン
Contact:

Re: Is there a way to convert to lowercase

Post by AmigoJack »

Code: Select all

    if( utf8_strtoupper( $post_data['post_subject'] )== $post_data['post_subject'] ) $post_data['post_subject']= utf8_strtolower( $post_data['post_subject'] ); 
will also work beyond ASCII.
  • The worst thing about censorship is ███████████
  • "The problem is probably not my English but you do not want to understand correctly. ... We will not come anybody anyway, nevertheless, it's best to shit this." Affin, 2018-11-20
  • "But this shit is not here for you. You can follow with your. Maybe the question, instead, was for you, who know, so you shoved us how you are." axe70, 2020-10-10
jaylam13
Registered User
Posts: 194
Joined: Wed Sep 29, 2010 5:58 pm
Contact:

Re: Is there a way to convert to lowercase

Post by jaylam13 »

Worked perfectly, thanks a lot.

Jay
merfed
Registered User
Posts: 25
Joined: Sat Jul 10, 2010 12:05 pm

Re: Is there a way to convert to lowercase

Post by merfed »

This is a little much when adding the property:

Code: Select all

text-transform: lowercase;
To the css for the topic titles, it would be easier to upgrade. As much as Iike phpbb, I'm a firm believer that modifications should be kept away from the code that way it's easier to update for important things like security holes.
User avatar
AmigoJack
Registered User
Posts: 5795
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン
Contact:

Re: Is there a way to convert to lowercase

Post by AmigoJack »

Yeah but that's only a display. The text itself will stay in uppercase and copying that as selection to the clipboard will do the very same.
  • The worst thing about censorship is ███████████
  • "The problem is probably not my English but you do not want to understand correctly. ... We will not come anybody anyway, nevertheless, it's best to shit this." Affin, 2018-11-20
  • "But this shit is not here for you. You can follow with your. Maybe the question, instead, was for you, who know, so you shoved us how you are." axe70, 2020-10-10
Locked

Return to “[3.0.x] MOD Requests”