PDA

View Full Version : Auto capitalizing first letter of topic title?


xlguy
01-23-2006, 01:17 AM
I want my board to automatically capitalize topic titles. For example if a user starts a new thread with the title "hello this is me" the software will automatically convert it to "Hello this is me", i.e. a capital 'H'.

I came up with a solution myself, which is to edit the newthread.php file.


$lowsubject =& $vbulletin->GPC['subject'];
$upsubject = strtoupper($lowsubject{0}).substr($lowsubject, 1, strlen($lowsubject) - 1);
$newpost['title'] =& $upsubject;

Is this ok? I'm not really up to date on how 3.5 works, but this solution seems to work for me. My questions are a) is there a neater/better way to do this? b) will I create any problems using that solution? and c) what is this difference betwen =& and plain old =?

Thanks

calorie
01-23-2006, 01:26 AM
No file edit needed. Make a plugin that hooks to 'newthread_post_start' with the following content:

$vbulletin->GPC['subject'] = ucfirst($vbulletin->GPC['subject']);

xlguy
01-23-2006, 06:51 PM
Great suggestion, thanks a lot calorie.

For those of you who see this thread and implement the idea (which I personally feel would be a 'neat' option in vB options) don't forget to enable the plugin system otherwise it won't work - obvious I know but it's off by default.

rlamego
01-24-2006, 12:11 AM
You can also do this with CSS

LBSources
01-24-2006, 12:43 AM
can anyone share the right way to do this? or is the OP's way just fine? id appreciate it..

Lenny :)

SnickersTK
01-24-2006, 05:33 AM
No file edit needed. Make a plugin that hooks to 'newthread_post_start' with the following content:

$vbulletin->GPC['subject'] = ucfirst($vbulletin->GPC['subject']);


doesn't work. (Running 3.5.2)

Any other suggestions people?

SnickersTK
01-25-2006, 08:37 AM
people?

criscokid
01-25-2006, 10:52 AM
No file edit needed. Make a plugin that hooks to 'newthread_post_start' with the following content:

$vbulletin->GPC['subject'] = ucfirst($vbulletin->GPC['subject']);

Please can you explain the steps taken to do this. I'm new to creating vB Plugins.

calorie
01-25-2006, 10:56 AM
<a href="http://www.vbulletin.com/docs/html/add_plugin" target="_blank">http://www.vbulletin.com/docs/html/add_plugin</a>

Guest210212002
01-25-2006, 03:25 PM
This definitely works, thanks Calorie.

Here's the plugin.

SBlueman
11-03-2007, 12:31 PM
This plugin still work for 3.6.8. If you want it to capitalize each word in the title, simply download the plugin above and change "ucfirst" to "ucwords":

<?xml version="1.0" encoding="ISO-8859-1"?>

<plugins>
<plugin active="1" product="vbulletin">
<title>Auto Capitalize The First Letter Of Every Thread Title</title>
<hookname>newthread_post_start</hookname>
<phpcode><![CDATA[$vbulletin->GPC['subject'] = ucwords($vbulletin->GPC['subject']);]]></phpcode>
</plugin>
</plugins>


Is there a way to make it so you can choose which forum(s) to activate this in?

webmastersitesi
02-16-2011, 11:16 AM
is there any plugin which is UTF-8 and capitilize each title entered and it's for 3.8.6