Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: D#S on September 08, 2011, 11:07:38 AM

Title: TopicRenamer
Post by: D#S on September 08, 2011, 11:07:38 AM
Link to the mod (https://custom.simplemachines.org/index.php?mod=3167)

[shadow=#888,right]TopicRenamer[/shadow]

Author: D#S (http://simplemachines.org/community/index.php?action=profile;u=189535) (russian support: BIOHAZARD (http://www.simplemachines.ru/index.php?action=profile;u=7149))
Current Version: 2.2
Compatibility: SMF 2.0-2.0.1
Languages:

[shadow=#888,right]Features[/shadow]
This mod allow you to rename all messages in topic by two clicks.

[shadow=#888,right]Installation[/shadow]
Any previous versions of this mod MUST be uninstalled BEFORE installing this version.

Useful Links
Manual Installation Of Mods (http://docs.simplemachines.org/index.php?topic=402)
How Do I Modify Files? (http://www.simplemachines.org/community/index.php?topic=24110.0)

[shadow=#888,right]Support[/shadow]
Please use the modification thread for support with this modification.
(Please don't ask me to do the edits for you)

(https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=CQ7T7YU6MG8E2)



This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License (http://creativecommons.org/licenses/by-nc-nd/3.0/) (applies to all versions past and present).

  • Attribution —  You must attribute the work in the manner specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the work).
  • Noncommercial —  You may not use this work for commercial purposes.
  • No Derivative Works —  You may not alter, transform, or build upon this work.



[shadow=#888,right]Changelog[/shadow]
Legend:
! = Bugfix
- = Removed
+ = New Feature
o = Update
> = New Language
^ = Initial/New Release

2011.09.22 - v. 2.2
> Croatian added.
> Serbian latin and cyrillic added.
o SMF 2.0.1 compatible.
2011.09.10 - v. 2.1
> Italian added.
> Polish added.
2011.08.14 - v. 2.0
o Hooks based installation.
2011.08.13 - v. 1.0
^ Initial release.
Title: Re: TopicRenamer
Post by: MotRude on September 08, 2011, 02:46:43 PM
All your Mods Are Great!
Title: Re: TopicRenamer
Post by: Kimmie on September 08, 2011, 04:10:02 PM
Nice mod. They need to make this a default feature within SMF


EDIT::  This mod does not show whether or not the executions will be "succesful" or if there are any "test failed". Do not know id that is a mod issue or an SMF issue as I have never had that happen before.

Also you might want to put a screenshot or two on your mod page showing how to use the mod. "2 clicks" isnt real descriptive. ;)





The xml file cannot be opened either. I think I will wait until someone else has installed it before I try it ;)
Title: Re: TopicRenamer
Post by: D#S on September 09, 2011, 05:12:34 AM
Quote from: motleyrude on September 08, 2011, 02:46:43 PM
All your Mods Are Great!
tnx

Quote from: Kimmie on September 08, 2011, 04:10:02 PM
EDIT::  This mod does not show whether or not the executions will be "succesful" or if there are any "test failed". Do not know id that is a mod issue or an SMF issue as I have never had that happen before.
not needed
after redirect to a theme you'll see it

Quote from: Kimmie on September 08, 2011, 04:10:02 PM
Also you might want to put a screenshot or two on your mod page showing how to use the mod. "2 clicks" isnt real descriptive. ;)
it is, it is :о)

Quote from: Kimmie on September 08, 2011, 04:10:02 PM
The xml file cannot be opened either. I think I will wait until someone else has installed it before I try it ;)
it is first public release, so mod was tested official smf moderators
Title: Re: TopicRenamer
Post by: bruce86 on September 09, 2011, 07:11:48 PM
Italian Translation..;)
Title: Re: TopicRenamer
Post by: Kimmie on September 09, 2011, 08:35:52 PM
QuoteEDIT::  This mod does not show whether or not the executions will be "succesful" or if there are any "test failed". Do not know id that is a mod issue or an SMF issue as I have never had that happen before. not needed
after redirect to a theme you'll see it


It most certainly is needed  lol. I need to know if the files will be installed successfully or if there are any fails and I need to make any manual edits. This is a given with "any" mod you install. Heavily modded forums need it most of all because chances are they will need to make manual edits to atleast their custom themes and quite possibly the default themes and we need to know what those files are that it is failing on and why.

Standard practice on any mod

QuoteThe xml file cannot be opened either. I think I will wait until someone else has installed it before I try it ;)
it is first public release, so mod was tested official smf moderators

Doesnt matter, its an XML file and I should still be able to open it so I can see the code.
Title: Re: TopicRenamer
Post by: D#S on September 09, 2011, 09:48:00 PM
Quote from: bruce86 on September 09, 2011, 07:11:48 PM
Italian Translation..;)
this is an italian or italian-utf8?
Title: Re: TopicRenamer
Post by: Adrek on September 10, 2011, 04:21:59 AM
and here you have polish and polish-utf8 translations ;)


A jeśli ktoś już zainstalował tą modyfikację tutaj (http://www.smf.pl/index.php/topic,8159.0.html) znajduje się wersja "instalacyjna" spolszczenia ;)
Title: Re: TopicRenamer
Post by: D#S on September 10, 2011, 05:08:32 AM
Quote from: ph4ntom on September 10, 2011, 04:21:59 AM
and here you have polish and polish-utf8 translations ;)
tnx
dziękuję :о)
Title: Re: TopicRenamer
Post by: bruce86 on September 11, 2011, 06:31:50 AM
Quote from: D#S on September 09, 2011, 09:48:00 PM
Quote from: bruce86 on September 09, 2011, 07:11:48 PM
Italian Translation..;)
this is an italian or italian-utf8?
In Italian and Italian-utf8..;)
Title: Re: TopicRenamer
Post by: D#S on September 11, 2011, 10:39:23 AM
Quote from: bruce86 on September 11, 2011, 06:31:50 AM
In Italian and Italian-utf8..;)
tnx
grazie
Title: Re: TopicRenamer
Post by: Branko. on September 11, 2011, 12:07:25 PM
Serbian_latin,Serbian_cyrillic and Croatian, both...ISO/UTF-8
Title: Re: TopicRenamer
Post by: Doburpally on September 20, 2011, 05:27:02 PM
Nice mod ;)

However, the package needs to be updated for 2.0.1
   <install for="2.0 - 2.99.99">

   <uninstall for="2.0 - 2.99.99">

;)
Title: Re: TopicRenamer
Post by: D#S on September 22, 2011, 09:51:43 AM
Quote from: Branko. on September 11, 2011, 12:07:25 PM
Serbian_latin,Serbian_cyrillic and Croatian, both...ISO/UTF-8
tnx
хвала
Title: Re: TopicRenamer
Post by: jsx on January 25, 2014, 11:49:22 AM
TopicRenamer is not only changing the title of the topic, but also removing the Re: (reply) why this is happening? It can't be this way, that this modification remove "Re:" from title of topic from reply. Author by this modification why is happen this way?

Your modification should change title of topic, without remove Re:

Perhaps somebody is able to correct this topicrenamer modification? I think that the author this modification didn't offend for this.
Title: Re: TopicRenamer
Post by: NekoJonez on February 22, 2014, 09:54:37 AM
Quote from: rimh101 on January 25, 2014, 11:49:22 AM
TopicRenamer is not only changing the title of the topic, but also removing the Re: (reply) why this is happening? It can't be this way, that this modification remove "Re:" from title of topic from reply. Author by this modification why is happen this way?

Your modification should change title of topic, without remove Re:

Perhaps somebody is able to correct this topicrenamer modification? I think that the author this modification didn't offend for this.

Yeah, same issue here.
Title: Re: TopicRenamer
Post by: Kimmie on August 25, 2014, 03:35:06 PM
I need to get this mod removed, but I have a question. I installed this mod way back when we had an earlier version of SMF (before it was gold) so I don't have an "uninstall" option. I realize I have to do this all manually which is fine. I parsed the mod and it doesn't have any "find/replace" code. These are the only operations it carried out.






==================






Is it safe to assume all I have to do is delete these 3 files and it will be uninstalled or is there something else I need to do?


Thanks :)



Edit: Nevermind. I emulated the site to 2.0 and when that happened I had an "Install Mod" option there so I just clicked on delete files.

Sorry to bother you.  :P
Title: Re: TopicRenamer
Post by: Mstcool on August 25, 2014, 09:19:49 PM
You should upgrade to 2.0.8 because it fixes a lot of bugs and security issues. :p
Title: Re: TopicRenamer
Post by: Kimmie on August 25, 2014, 10:08:44 PM
Quote from: Mstcool on August 25, 2014, 09:19:49 PM
You should upgrade to 2.0.8 because it fixes a lot of bugs and security issues. :p


I already have 2.0.8. This mod was installed way before 2.0.8 even came out and has never been updated for it. That is why I got rid of it. The mod no longer works.
Title: Re: TopicRenamer
Post by: Mstcool on August 25, 2014, 10:34:30 PM
Oh, ok.
Title: Re: TopicRenamer
Post by: BeatsMe on November 10, 2015, 01:41:34 AM
Just wondering if this mod is still supported by the developer, and if it works under 2.0.11 ???

Failing that is another mod that does the same.
Title: Re: TopicRenamer
Post by: br360 on November 10, 2015, 02:51:01 AM
The mod author may not be around, but this mod works just fine on 2.0.11. It's using hooks so it's even working on my 2.1 test site with no issues as well.
Title: Re: TopicRenamer
Post by: BeatsMe on November 10, 2015, 03:26:21 AM
Good to know it works on 2.1 too  ;)
Thanks for the reply.
Title: Re: TopicRenamer
Post by: Wellwisher on November 16, 2015, 03:00:09 AM
This is a great mod works with 2.0.11 so easy to use, smf should apply this to their main SMF release. I love this mod it was suggested to me by br360. So easy and simple to use, it's sexy man.
Title: Re: TopicRenamer
Post by: Steve on November 16, 2015, 08:27:03 AM
Does it still do this?

Quote from: jsgrom on January 25, 2014, 11:49:22 AM
TopicRenamer is not only changing the title of the topic, but also removing the Re: (reply) why this is happening? It can't be this way, that this modification remove "Re:" from title of topic from reply. Author by this modification why is happen this way?

Your modification should change title of topic, without remove Re:

Perhaps somebody is able to correct this topicrenamer modification? I think that the author this modification didn't offend for this.
Title: Re: TopicRenamer
Post by: Wellwisher on November 16, 2015, 03:25:44 PM
Steve'o works on 2.0.11 beautifully 100%. Tested on local and now running this on production. I also heard it works on 2.1.
Title: Re: TopicRenamer
Post by: Steve on November 16, 2015, 05:17:33 PM
Thanks. :)
Title: Re: TopicRenamer
Post by: BeatsMe on November 26, 2015, 02:49:36 AM
Just installed this mod on my test forum.... strips the "Re:" from all the replies when you do the rename :(

Not the way I would want a rename mod to work.

Quote from: Steve on November 16, 2015, 08:27:03 AM
Does it still do this?

Quote from: jsgrom on January 25, 2014, 11:49:22 AM
TopicRenamer is not only changing the title of the topic, but also removing the Re: (reply) why this is happening? It can't be this way, that this modification remove "Re:" from title of topic from reply. Author by this modification why is happen this way?

Your modification should change title of topic, without remove Re:

Perhaps somebody is able to correct this topicrenamer modification? I think that the author this modification didn't offend for this.
Title: Re: TopicRenamer
Post by: Shambles on May 19, 2017, 03:35:41 AM
Quote from: ErrorLogOnly variables should be passed by reference

To avoid the warning message when using PHP7.1...

Sources/TopicRenamer.php
Code (Find) Select
// Stripslashes and htmlspecialchars
$context['currentSubject'] = strtr(censorText($smcFunc['db_unescape_string']($currentSubject)), array("\r" => '', "\n" => '', "\t" => ''));


Code (Replace with) Select
// Stripslashes and htmlspecialchars
$tempText = $smcFunc['db_unescape_string']($currentSubject);
$context['currentSubject'] = strtr(censorText($tempText), array("\r" => '', "\n" => '', "\t" => ''));
Title: Re: TopicRenamer
Post by: Shambles on July 11, 2021, 08:12:53 AM
To anyone who is annoyed that messages subordinate to the opening message lose the "RE:" prefix, please find a fix below.

Sources/TopicRenamer.php

Code (find) Select


// Do the dew.
$update = $smcFunc['db_query']('', '
UPDATE {db_prefix}messages
SET subject = {string:subject}
WHERE id_topic = {int:topic}',
array(
'subject' => $_POST['subject'],
'topic' => $ID_TOPIC,
)
);


Code (Upgrade to) Select


// Do the dew.
$update = $smcFunc['db_query']('', '
UPDATE {db_prefix}messages
SET subject = {string:subject}
WHERE id_topic = {int:topic}
LIMIT 1',
array(
'subject' => $_POST['subject'],
'topic' => $ID_TOPIC,
)
);

$REsubject = 'RE: ' . $_POST['subject'];

// Update subordinate messages.

$update = $smcFunc['db_query']('', '
UPDATE {db_prefix}messages
SET subject = {string:REsubject}
WHERE id_topic = {int:topic}
AND subject != {string:newsubject}',
array(
'newsubject' => $_POST['subject'],
'REsubject' => $REsubject,
'topic' => $ID_TOPIC,
)
);
Title: Re: TopicRenamer
Post by: Steve on July 11, 2021, 09:08:49 AM
Nice.
Title: Re: TopicRenamer
Post by: Steve on February 12, 2022, 01:32:35 PM
Does anyone else use this on 2.0.19 and get tons of errors?
Title: Re: TopicRenamer
Post by: Diego Andrés on February 12, 2022, 02:16:24 PM
What errors you get?
Title: Re: TopicRenamer
Post by: Steve on February 12, 2022, 04:27:57 PM
I'm getting:

2048: Only variables should be passed by reference (Line 41)
Title: Re: TopicRenamer
Post by: Wellwisher on February 12, 2022, 04:47:58 PM
@Steve 
Quote from: Steve on February 12, 2022, 04:27:57 PM2048: Only variables should be passed by reference (Line 41)

SMF version? Can you add the line 41 here & what's the file location where the error code sits in?

Also what "type" of error is it under aka Critical | General |  Undefined | User?

I am using it on 2.0.19, not seeing errors.
Title: Re: TopicRenamer
Post by: Steve on February 18, 2022, 07:32:39 AM
I haven't forgotten your question Wellwisher. I just haven't had a chance to reinstall it to get your answers. I'll try to do that today. :)
Title: Re: TopicRenamer
Post by: Steve on February 18, 2022, 10:46:32 AM
As I said ... SMF version is 2.0.19

I'm not sure what more error information you want: d30e5ce2f94b8ae7cd613ef9538a8145
Apply Filter: Only show the errors of this type Type of error: General

2048: Only variables should be passed by reference
Apply Filter: Only show the errors from this file
File: /home/steve/public_html/forums/Sources/TopicRenamer.php
Line: 41

Line 41 reads:

$context['currentSubject'] = strtr(censorText($smcFunc['db_unescape_string']($currentSubject)), array("\r" => '', "\n" => '', "\t" => ''));
Title: Re: TopicRenamer
Post by: Arantor on February 18, 2022, 10:56:44 AM
I was going to rewrite the snippet to make the censorText call not be a weird reference mash (because it shouldn't be) but I'm suddenly having doubts about the unescape call in there at the same time.

I'll take a proper look tonight because this feels like the wrong set of things to be doing... and I'm not sure it isn't a security risk.
Title: Re: TopicRenamer
Post by: Steve on February 19, 2022, 11:19:27 AM
Did you get a chance to look at this Arantor?
Title: Re: TopicRenamer
Post by: Arantor on February 19, 2022, 03:42:54 PM
Thanks for reminding me :)

OK so whatever this mod is doing is actually some really weird archaic nonsense; not even SMF core does this directly (or for any reason here). That said, in its present form it's just weird and harmless in practice because the real protection is still handled by SMF's own routines and this is just a weird shuffle around that won't actually hurt anything.

To fix the immediate issue you're having, the line in question was:
$context['currentSubject'] = strtr(censorText($smcFunc['db_unescape_string']($currentSubject)), array("\r" => '', "\n" => '', "\t" => ''));
It looks like it should become:
$context['currentSubject'] = $smcFunc['db_unescape_string']($currentSubject);
censorText($context['currentSubject']);
$context['currentSubject'] = strtr($context['currentSubject'], array("\r" => '', "\n" => '', "\t" => ''));

More time should really be spent on it to unpick exactly which of the unescape/escape statements can go (probably all of them) but its present form should be fine, just largely unnecessary and confusing.

The issue is censorText expects a reference, what this code was giving it is indirect and not a reference.
Title: Re: TopicRenamer
Post by: Steve on February 19, 2022, 04:52:50 PM
Thanks Pe, I mean Arantor. That's done the trick ... no more errors. Appreciate the help.  :)
Title: Re: TopicRenamer
Post by: Steve on April 04, 2022, 06:19:44 PM
I don't suppose anyone wants to take on making this compatible with 2.1.1?

Or even if it's allowed ... the licensing issues always confuse me ...
Title: Re: TopicRenamer
Post by: Diego Andrés on April 04, 2022, 06:32:00 PM
Don't think so, but @digger is still around I believe?
The mod looks updated on github
https://github.com/realdigger/SMF-Topic-Renamer
Title: Re: TopicRenamer
Post by: Steve on April 04, 2022, 07:01:31 PM
Thanks but there seems to be a problem with it. I can't find anywhere to rename the topic and uninstalling the mod gives the following error:

Delete File    themedir/TopicRenamer.template.php    Not found
Title: Re: TopicRenamer
Post by: Doug Heffernan on April 04, 2022, 07:16:16 PM
Quote from: Steve on April 04, 2022, 07:01:31 PMThanks but there seems to be a problem with it. I can't find anywhere to rename the topic and uninstalling the mod gives the following error:

Delete File    themedir/TopicRenamer.template.php    Not found

The Topic Renamer link can be found at the topic moderation buttons area, the very last button. Please see the attached screenshot.

You get that error during the un-installation, because there is a typo at the mod's package-info.xml file. This code:

<remove-file name="themedir/TopicRenamer.template.php" />
should have been:

<remove-file name="$themedir/TopicRenamer.template.php" />
If you want to uninstall the mod, you can go ahead, and then you can delete manually the TopicRenamer.template.php file afterwards.
Title: Re: TopicRenamer
Post by: Steve on April 04, 2022, 08:13:39 PM
I know where the rename button should be but I'm not getting it from the github version. But thanks Doug. :)
Title: Re: TopicRenamer
Post by: jsx on September 28, 2022, 06:54:34 AM
I also downloaded the version from github, in the package I replaced the files with those from github, I packed the package and installed the mod.



But the button is not displayed correctly:



But now I made the package like this, the mod works, the button displays correctly.



Content in the Install folder:



This is the correct creation of this modification package?
Title: Re: TopicRenamer
Post by: Michael Vail on February 21, 2023, 01:54:10 PM
I installed version 2.2 that I downloaded from this mods page here on the forum. It has the updated XML file and installed without a hitch. I tested it on a thread that had been merged multiple times and had different subjects for several of the posts and it perfectly renamed the subject lines of all the posts in the thread I tested it on. Just wanted anyone stubling upon this to know that Version 2.2 works great on SMF 2.1.3.

Thanks for the mod and the support efforts to keep it going!
Title: Re: TopicRenamer
Post by: digger on February 21, 2023, 02:13:46 PM
Quote from: Michael Vail on February 21, 2023, 01:54:10 PMI installed version 2.2 that I downloaded from this mods page here on the forum. It has the updated XML file and installed without a hitch. I tested it on a thread that had been merged multiple times and had different subjects for several of the posts and it perfectly renamed the subject lines of all the posts in the thread I tested it on. Just wanted anyone stubling upon this to know that Version 2.2 works great on SMF 2.1.3.

Thanks for the mod and the support efforts to keep it going!

Use 3.0.1 version for SMF 2.1
https://github.com/realdigger/SMF-Topic-Renamer
Title: Re: TopicRenamer
Post by: Diego Andrés on February 21, 2023, 02:32:45 PM
Btw @digger as additional author for this mod, you should be able to update the mod in the customization site as well. Let us know if you have issues with that.
Title: Re: TopicRenamer
Post by: Michael Vail on February 21, 2023, 03:40:17 PM
Thanks Diego and Digger. I downloaded the latest 3.0.1 version from the github link provided and installed it after removing the 2.2 version I previously installed.

I was wrong about the v2.2 package containing the corrected XML file. The v2.2 package available for download on the mod page still has the xml file missing the "$" Doug posted about above. I edited the xml file with Doug's corrections and rezipped it. I then pushed to my server with an FTP transfer to test it and the uninstall went as expected. I've attached the corrected v2.2 package package here if someone needs it or if Digger wants to replace the package on the Mod page with the working version.

Thanks again for the great mod!
Title: Re: TopicRenamer
Post by: Diego Andrés on February 21, 2023, 06:01:17 PM
Sorry but Digger will have to do that because he is the only one with explicit permission from the original author to do so.
I removed the package you attached because it didn't have license, which is odd because the repository already has a license.
Title: Re: TopicRenamer
Post by: Michael Vail on February 21, 2023, 10:05:02 PM
Thanks Diego. Take care.
Title: Re: TopicRenamer
Post by: jsx on February 22, 2023, 09:53:58 AM
Packing this mod as I wrote in the previous post makes the mod work properly on SMF 2.1, but I think this mod should be updated on the customization page.