Advertisement:

Author Topic: TopicRenamer  (Read 22735 times)

Offline BeatsMe

  • Semi-Newbie
  • *
  • Posts: 53
  • Gender: Male
    • mcdracingforum on Facebook
    • MCD Racing Forum
Re: TopicRenamer
« Reply #20 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.

Offline br360

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 2,398
    • GenXcommunity
Re: TopicRenamer
« Reply #21 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.

Offline BeatsMe

  • Semi-Newbie
  • *
  • Posts: 53
  • Gender: Male
    • mcdracingforum on Facebook
    • MCD Racing Forum
Re: TopicRenamer
« Reply #22 on: November 10, 2015, 03:26:21 AM »
Good to know it works on 2.1 too  ;)
Thanks for the reply.

Offline Wellwisher

  • Full Member
  • ***
  • Posts: 448
  • Gender: Male
Re: TopicRenamer
« Reply #23 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.

Offline Steve

  • Freak
  • Support Specialist
  • SMF Hero
  • *
  • Posts: 5,000
  • Gender: Male
  • I have not yet begun to procrastinate.
Re: TopicRenamer
« Reply #24 on: November 16, 2015, 08:27:03 AM »
Does it still do this?

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.
Please do not PM me for support.

Offline Wellwisher

  • Full Member
  • ***
  • Posts: 448
  • Gender: Male
Re: TopicRenamer
« Reply #25 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.

Offline Steve

  • Freak
  • Support Specialist
  • SMF Hero
  • *
  • Posts: 5,000
  • Gender: Male
  • I have not yet begun to procrastinate.
Re: TopicRenamer
« Reply #26 on: November 16, 2015, 05:17:33 PM »
Thanks. :)
Please do not PM me for support.

Offline BeatsMe

  • Semi-Newbie
  • *
  • Posts: 53
  • Gender: Male
    • mcdracingforum on Facebook
    • MCD Racing Forum
Re: TopicRenamer
« Reply #27 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.

Does it still do this?

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.

Offline Shambles

  • SMF Hero
  • ******
  • Posts: 5,667
  • Gender: Male
    • i30 Owners Club
Re: TopicRenamer
« Reply #28 on: May 19, 2017, 03:35:41 AM »
Quote from: ErrorLog
Only 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" => ''));

Offline Shambles

  • SMF Hero
  • ******
  • Posts: 5,667
  • Gender: Male
    • i30 Owners Club
Re: TopicRenamer
« Reply #29 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,
)
);

Offline Steve

  • Freak
  • Support Specialist
  • SMF Hero
  • *
  • Posts: 5,000
  • Gender: Male
  • I have not yet begun to procrastinate.
Re: TopicRenamer
« Reply #30 on: July 11, 2021, 09:08:49 AM »
Nice.
Please do not PM me for support.