Page 1 of 1

Is there a way to convert to lowercase

Posted: Fri Aug 26, 2011 7:02 pm
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

Re: Is there a way to convert to lowercase

Posted: Fri Aug 26, 2011 7:12 pm
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.

Re: Is there a way to convert to lowercase

Posted: Sat Aug 27, 2011 10:59 am
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.

Re: Is there a way to convert to lowercase

Posted: Sat Aug 27, 2011 11:43 am
by jaylam13
Worked perfectly, thanks a lot.

Jay

Re: Is there a way to convert to lowercase

Posted: Mon Aug 29, 2011 12:40 am
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.

Re: Is there a way to convert to lowercase

Posted: Mon Aug 29, 2011 9:37 am
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.