![]() |
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 |
Anyone?
|
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 |
Create a plugin hooked at "threaddata_presave" with the code:
PHP Code:
|
Quote:
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? |
Are you sure you used the correct thread id?
Before you saved the plugin, did you make it active? |
Quote:
|
Odd...it worked for me.
|
Quote:
Is that the only thing to change? |
Quote:
|
|
Quote:
PHP Code:
|
I have that, but if you look at all the titles after that they don't update.
|
Well, like I said that query works for me...don't know what issue there is at your site preventing it from running.
|
1 Attachment(s)
Quote:
Thanks for the help. I will see if I can figure this out as I do have a PHP error. Attachment 156945 |
Just turned off all the plugins to see if it would update and nothing.
So strange... |
If you turned off all plugins (disabled hooks), then this new plugin won't run.
|
Quote:
|
I would first try turning off any plugins hooked at the same location.
|
Quote:
Thank you, sir. --------------- Added [DATE]1519051345[/DATE] at [TIME]1519051345[/TIME] --------------- So just tried and it didn't work. We are talking about the RE: Title correct? |
I'm talking about all plugins whose hook location is "threaddata_presave."
|
Quote:
So let me walk through this one more time. First I create a plugin hooked at "threaddata_presave" with the 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 "); } Using my ID number which is 10573 in the XXX Next, I go to the thread and update the title and hit save. The title changes, but only the main one which is my issue, not all the rest of the posts. Is that correct sir? |
For whatever reason that plugin is not executing...have no idea why...it works perfectly for me.
|
I have an idea, brb.
--------------- Added [DATE]1519059557[/DATE] at [TIME]1519059557[/TIME] --------------- GOT IT! ;) Thank you!!! |
Quote:
Anyway, what was causing the plugin not to execute? |
Our server was on fast CGI and we kept hitting limits which cause errors and issues.
Once I changed us back to just regular CGI my errors went away and everything worked. ;) Thanks, friend, JJ |
I tested this plugin in my dev site, to work I disabled the "fast CGI"
Is there a way Mark... to the second post title and so on until last post to have the word "Re" before the title or what else we use? Thanks |
Just change the query to this:
PHP Code:
|
Ok thanks Mark , some times i get an error
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; modpm_checker has a deprecated constructor... |
Quote:
|
Ok, i will see, actually i tested in my dev site, thanks for another time.
|
All times are GMT. The time now is 04:15 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|