vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Thread title first character uppercase (https://vborg.vbsupport.ru/showthread.php?t=92271)

Andy 07-15-2005 06:07 PM

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. :)

Christine 07-15-2005 10:24 PM

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.

Andreas 07-16-2005 01:05 AM

*** 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.

Christine 07-16-2005 01:36 AM

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. :p

Andy 07-16-2005 01:43 AM

Thank you Christine for your time. :)

Kirby your awesome, that worked perfect. :) :up:

Christine 07-16-2005 01:52 AM

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.

Andy 07-16-2005 02:12 AM

Hi Christine,

The Automerged Doublepost hack had me all confused. What PITA that is, people should be able to post twice in a row.

Andreas 07-16-2005 02:13 AM

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.

Andy 07-16-2005 02:15 AM

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".

Andreas 07-16-2005 02:23 AM

Great that I labeled it untested :D

Hookname: threaddata_presave
PHP Code:

if ($this->thread['title'])
{
    
$this->thread['title'] = ucfirst($this->thread['title']);




All times are GMT. The time now is 05:14 AM.

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.01025 seconds
  • Memory Usage 1,754KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (8)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete