Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 01-23-2006, 01:17 AM
xlguy's Avatar
xlguy xlguy is offline
 
Join Date: Feb 2004
Location: UK
Posts: 168
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Auto capitalizing first letter of topic title?

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.

PHP Code:
$lowsubject =& $vbulletin->GPC['subject'];
$upsubject strtoupper($lowsubject{0}).substr($lowsubject1strlen($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
Reply With Quote
  #2  
Old 01-23-2006, 01:26 AM
calorie calorie is offline
 
Join Date: May 2003
Posts: 2,804
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No file edit needed. Make a plugin that hooks to 'newthread_post_start' with the following content:
Code:
$vbulletin->GPC['subject'] = ucfirst($vbulletin->GPC['subject']);
Reply With Quote
  #3  
Old 01-23-2006, 06:51 PM
xlguy's Avatar
xlguy xlguy is offline
 
Join Date: Feb 2004
Location: UK
Posts: 168
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #4  
Old 01-24-2006, 12:11 AM
rlamego rlamego is offline
 
Join Date: Nov 2004
Posts: 79
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You can also do this with CSS
Reply With Quote
  #5  
Old 01-24-2006, 12:43 AM
LBSources LBSources is offline
 
Join Date: Nov 2005
Location: New York
Posts: 329
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

can anyone share the right way to do this? or is the OP's way just fine? id appreciate it..

Lenny
Reply With Quote
  #6  
Old 01-24-2006, 05:33 AM
SnickersTK SnickersTK is offline
 
Join Date: Apr 2005
Location: Denmark
Posts: 82
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by calorie
No file edit needed. Make a plugin that hooks to 'newthread_post_start' with the following content:
Code:
$vbulletin->GPC['subject'] = ucfirst($vbulletin->GPC['subject']);
doesn't work. (Running 3.5.2)

Any other suggestions people?
Reply With Quote
  #7  
Old 01-25-2006, 08:37 AM
SnickersTK SnickersTK is offline
 
Join Date: Apr 2005
Location: Denmark
Posts: 82
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

people?
Reply With Quote
  #8  
Old 01-25-2006, 10:52 AM
criscokid criscokid is offline
 
Join Date: Nov 2003
Location: London, UK
Posts: 380
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by calorie
No file edit needed. Make a plugin that hooks to 'newthread_post_start' with the following content:
Code:
$vbulletin->GPC['subject'] = ucfirst($vbulletin->GPC['subject']);
Please can you explain the steps taken to do this. I'm new to creating vB Plugins.
Reply With Quote
  #9  
Old 01-25-2006, 10:56 AM
calorie calorie is offline
 
Join Date: May 2003
Posts: 2,804
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

<a href="http://www.vbulletin.com/docs/html/add_plugin" target="_blank">http://www.vbulletin.com/docs/html/add_plugin</a>
Reply With Quote
  #10  
Old 01-25-2006, 03:25 PM
Guest210212002
Guest
 
Posts: n/a
Default

This definitely works, thanks Calorie.

Here's the plugin.
Attached Files
File Type: xml calorie_capitalize.xml (335 Bytes, 54 views)
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:51 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.15329 seconds
  • Memory Usage 2,271KB
  • Queries Executed 12 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_code
  • (1)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (1)postbit_attachment
  • (9)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • postbit_attachment
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete