News:

Wondering if this will always be free?  See why free is better.

Main Menu

TopicRenamer

Started by D#S, September 08, 2011, 11:07:38 AM

Previous topic - Next topic

D#S

Link to the mod

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

Author: D#S (russian support: BIOHAZARD)
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
How Do I Modify Files?

[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)





This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License (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.
ai dont spik inglish
@ ol

MotRude


Kimmie

#2
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 ;)

D#S

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
ai dont spik inglish
@ ol

bruce86

#4
Italian Translation..;)

Kimmie

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.

D#S

ai dont spik inglish
@ ol

Adrek

#7
and here you have polish and polish-utf8 translations ;)


A jeśli ktoś już zainstalował tą modyfikację tutaj znajduje się wersja "instalacyjna" spolszczenia ;)
Polskie wsparcie SMF na simplemachines.org

the simplest solution is most likely the right one

D#S

Quote from: ph4ntom on September 10, 2011, 04:21:59 AM
and here you have polish and polish-utf8 translations ;)
tnx
dziękuję :о)
ai dont spik inglish
@ ol

bruce86


D#S

ai dont spik inglish
@ ol

Branko.

Serbian_latin,Serbian_cyrillic and Croatian, both...ISO/UTF-8
Strong people don't put others down, they lift them up.
A clever person solves a problem. A wise person avoids it.

Doburpally

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

;)

D#S

Quote from: Branko. on September 11, 2011, 12:07:25 PM
Serbian_latin,Serbian_cyrillic and Croatian, both...ISO/UTF-8
tnx
хвала
ai dont spik inglish
@ ol

jsx

#14
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.

NekoJonez

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.
Retro video game blogger, writer, actor, podcaster and general amazing dude.

Twitter
My Blog

Kimmie

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

Mstcool

You should upgrade to 2.0.8 because it fixes a lot of bugs and security issues. :p

Kimmie

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.

Mstcool


BeatsMe

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.

br360

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.

BeatsMe

Good to know it works on 2.1 too  ;)
Thanks for the reply.

Wellwisher

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.

Steve

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.
DO NOT pm me for support!

Wellwisher

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.

Steve

DO NOT pm me for support!

BeatsMe

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.

Shambles

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" => ''));

Shambles

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,
)
);

Steve

DO NOT pm me for support!

Steve

Does anyone else use this on 2.0.19 and get tons of errors?
DO NOT pm me for support!

Diego Andrés


SMF Tricks - Free & Premium Responsive Themes for SMF.

Steve

I'm getting:

2048: Only variables should be passed by reference (Line 41)
DO NOT pm me for support!

Wellwisher

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

Steve

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. :)
DO NOT pm me for support!

Steve

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" => ''));
DO NOT pm me for support!

Arantor

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.

Steve

Did you get a chance to look at this Arantor?
DO NOT pm me for support!

Arantor

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.

Steve

Thanks Pe, I mean Arantor. That's done the trick ... no more errors. Appreciate the help.  :)
DO NOT pm me for support!

Steve

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 ...
DO NOT pm me for support!

Diego Andrés

Don't think so, but @digger is still around I believe?
The mod looks updated on github
https://github.com/realdigger/SMF-Topic-Renamer

SMF Tricks - Free & Premium Responsive Themes for SMF.

Steve

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
DO NOT pm me for support!

Doug Heffernan

#44
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.

Steve

I know where the rename button should be but I'm not getting it from the github version. But thanks Doug. :)
DO NOT pm me for support!

jsx

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?

Michael Vail

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!

digger

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

Diego Andrés

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.

SMF Tricks - Free & Premium Responsive Themes for SMF.

Michael Vail

#50
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!

Diego Andrés

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.

SMF Tricks - Free & Premium Responsive Themes for SMF.

Michael Vail

Thanks Diego. Take care.

jsx

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.

Advertisement: