PDA

View Full Version : Help with some php code


elmcitizen
08-13-2002, 05:16 PM
i know it sounds funny but im setting up a companies forum and do to formatting in their industry, they would like all the post/thread subjects (the title of the post) to appear in capitol letters. Heres the big problem, some of the titles will be combinations of numbers and letters. Is there some php code that can be added to the newthread.php file to do this? Any help would be greatly appriciated.

mr e
08-13-2002, 06:57 PM
well strtoupper($string) will make $string uppercase

elmcitizen
08-14-2002, 01:25 PM
ok but im having trouble finding it in the newthread.php file do i look in this file or is this something that can be handles in the templates? Also, having numbers and letters mixed (exaple:GJHJ76N88) wont screw up the strtoupper function?

mr e
08-14-2002, 05:51 PM
ok i haven't tried this but see if this works, find this in newthread.php

$subject=censortext($subject);
$message=censortext($message);

// remove all caps subjects
if ($stopshouting and $subject==strtoupper($subject)) {
$subject=ucwords(strtolower($subject));
}

and below it add

$subject=strtoupper($subject);

hope this helps

elmcitizen
08-14-2002, 11:14 PM
ok so this will turn everthing capital? thats what i want want. Im just confused reading the code, it turns everything to lower, then to upper?

mr e
08-14-2002, 11:45 PM
no the first one is just saying if you have the "stop shouting" option on, to just capitilize the first letter of everything, after that i just made it capitilize EVERYTHING...just try it, you'll see

elmcitizen
08-15-2002, 12:40 AM
thanks for all your help ill give it a go in the morning

mr e
08-15-2002, 12:44 AM
your welcome :D