vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Update Thread Title Global (https://vborg.vbsupport.ru/showthread.php?t=326051)

I.G.O.T.A. 02-02-2018 09:55 AM

Update Thread Title Global
 
We have a pretty big thread and the title needs to be changed for each post. Instead of doing it manually if you change the first post how do you update it globally?

Thank you,
JJ

I.G.O.T.A. 02-15-2018 06:04 PM

Anyone?

Inna 02-16-2018 07:52 AM

If no one else in that thread has chosen manual title (for example thread title is "how to", but my post which is the 3rd one in that thread titles "how not to", then either you should
1) do it manually
2) run a query in phpmyadmin to change all titles of posts of this specific thread

MarkFL 02-16-2018 10:36 AM

Create a plugin hooked at "threaddata_presave" with the code:

PHP Code:

global $vbulletin;

if (
$vbulletin->GPC['threadid'] == XXX)
{
    
$vbulletin->db->query_write("
        UPDATE " 
TABLE_PREFIX "post
        SET title = '" 
$vbulletin->db->escape_string($vbulletin->GPC['title']) . "'
        WHERE threadid = " 
$vbulletin->GPC['threadid'] . "
        AND parentid != 0
    "
);


Replace "XXX" with the threadid of the thread you want affected.

I.G.O.T.A. 02-18-2018 02:44 PM

Quote:

Originally Posted by MarkFL (Post 2592940)
Create a plugin hooked at "threaddata_presave" with the code:

PHP Code:

global $vbulletin;

if (
$vbulletin->GPC['threadid'] == XXX)
{
    
$vbulletin->db->query_write("
        UPDATE " 
TABLE_PREFIX "post
        SET title = '" 
$vbulletin->db->escape_string($vbulletin->GPC['title']) . "'
        WHERE threadid = " 
$vbulletin->GPC['threadid'] . "
        AND parentid != 0
    "
);


Replace "XXX" with the threadid of the thread you want affected.

Thanks!

Going to do this now.

--------------- Added [DATE]1518972702[/DATE] at [TIME]1518972702[/TIME] ---------------

Tried it and didn't work. Any idea what I did wrong?

MarkFL 02-18-2018 02:54 PM

Are you sure you used the correct thread id?

Before you saved the plugin, did you make it active?

I.G.O.T.A. 02-18-2018 02:58 PM

Quote:

Originally Posted by MarkFL (Post 2592974)
Are you sure you used the correct thread id?

Before you saved the plugin, did you make it active?

Yes, then I went and changed the title and it didn't update the other posts.

MarkFL 02-18-2018 03:00 PM

Odd...it worked for me.

I.G.O.T.A. 02-18-2018 03:01 PM

Quote:

Originally Posted by MarkFL (Post 2592976)
Odd...it worked for me.

It the thread ID just the number?

Is that the only thing to change?

MarkFL 02-18-2018 03:05 PM

Quote:

Originally Posted by I.G.O.T.A. (Post 2592977)
It the thread ID just the number?

Is that the only thing to change?

Can you post a link to the thread?


All times are GMT. The time now is 08:34 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.01047 seconds
  • Memory Usage 1,746KB
  • 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
  • (2)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)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