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 07-15-2005, 06:07 PM
Andy Andy is offline
 
Join Date: Sep 2003
Location: San Francisco
Posts: 138
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Thread title first character uppercase

I like to see the thread title always start with an uppercase. I was able to figure out how to do this in newthread.php

In v3.5.0 beta 4 I added to line 133 this code...

Code:
$newpost['title'] = strtoupper($newpost['title']{0}).substr($newpost['title'], 1);
However I also need to add a similar code to the editpost.php file. I tried many things but was not able to do it.

Can someone who understands editpost.php better take a look and see where I can add code to make edited thread titles always start with an uppercase character.

Thank you.
Reply With Quote
  #2  
Old 07-15-2005, 10:24 PM
Christine's Avatar
Christine Christine is offline
 
Join Date: Oct 2001
Location: PA
Posts: 472
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just at a quick glance, but take a look around line 387
PHP Code:
$threadman->set('title'unhtmlspecialchars($edit['title'])); 
If I am reading that right, that routine should edit the title of the thread if the post being edited is the first post.
Reply With Quote
  #3  
Old 07-16-2005, 01:05 AM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

*** Untested ***

Hookname: threadfpdata_presave
PHP Code:
$this->thread['title'] = ucfirst($this->thread['title']);
$this->post['title'] = ucfirst($this->post['title']); 
Hookname: postdata_presave
PHP Code:
if ($this->existing['postid'] == $this->info['thread']['firstpostid'])
{
    
$this->post['title'] = ucfirst($this->post['title']);

Hookname: threaddata_presave
PHP Code:
$this->thread['title'] = ucfirst($this->thread['title']); 
This should take care of Thread Titles, no matter where they are being set/edited.
Reply With Quote
  #4  
Old 07-16-2005, 01:36 AM
Christine's Avatar
Christine Christine is offline
 
Join Date: Oct 2001
Location: PA
Posts: 472
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi Andy,

You may want to remove the code edits and try Kirby's suggestions. If what he is thinking will work, then it will be 2 less files that you have to fiddle with on upgrades.

Personally, I can't wait until I have a handle on the new plugin system. I am still in find-code-modify-code mode.
Reply With Quote
  #5  
Old 07-16-2005, 01:43 AM
Andy Andy is offline
 
Join Date: Sep 2003
Location: San Francisco
Posts: 138
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you Christine for your time.

Kirby your awesome, that worked perfect. :up:
Reply With Quote
  #6  
Old 07-16-2005, 01:52 AM
Christine's Avatar
Christine Christine is offline
 
Join Date: Oct 2001
Location: PA
Posts: 472
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Andy,

No problem. Don't know why you deleted your post, but don't forget to take out the code edits you made. That would be a Christine move. Heh.
Reply With Quote
  #7  
Old 07-16-2005, 02:12 AM
Andy Andy is offline
 
Join Date: Sep 2003
Location: San Francisco
Posts: 138
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi Christine,

The Automerged Doublepost hack had me all confused. What PITA that is, people should be able to post twice in a row.
Reply With Quote
  #8  
Old 07-16-2005, 02:13 AM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Andy
What PITA that is, people should be able to post twice in a row.
Sorry, but I have to disagree strongly
People posting several times in a row are a PITA!

Prevent Doubleposting is one of the best Hacks ever.
Reply With Quote
  #9  
Old 07-16-2005, 02:15 AM
Andy Andy is offline
 
Join Date: Sep 2003
Location: San Francisco
Posts: 138
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by KirbyDE
*** Untested ***

Hookname: threadfpdata_presave
PHP Code:
$this->thread['title'] = ucfirst($this->thread['title']);
$this->post['title'] = ucfirst($this->post['title']); 
Hookname: postdata_presave
PHP Code:
if ($this->existing['postid'] == $this->info['thread']['firstpostid'])
{
    
$this->post['title'] = ucfirst($this->post['title']);

Hookname: threaddata_presave
PHP Code:
$this->thread['title'] = ucfirst($this->thread['title']); 
This should take care of Thread Titles, no matter where they are being set/edited.
There is a bug in this code. If a users posts a new posts to the thread, the thread title changes to a "0".
Reply With Quote
  #10  
Old 07-16-2005, 02:23 AM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great that I labeled it untested

Hookname: threaddata_presave
PHP Code:
if ($this->thread['title'])
{
    
$this->thread['title'] = ucfirst($this->thread['title']);

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 10:19 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03917 seconds
  • Memory Usage 2,270KB
  • Queries Executed 11 (?)
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
  • (1)bbcode_code
  • (8)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
  • (10)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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete