Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: JayBachatero on July 12, 2006, 12:32:17 AM

Title: RenameTopic
Post by: JayBachatero on July 12, 2006, 12:32:17 AM
Link to Mod (http://mods.simplemachines.org/index.php?mod=384)
Review this Mod (http://mods.simplemachines.org/index.php?action=review;sa=add;mod=384)

This mod will give the option to rename a topic and all of it's posts.  So if you have a 100 page topic and want to change the subject for all of the posts, you can use this.

Features
* Permission to who can rename topic.  Own | Any.

Ver. 1.0.2
! RenameTopic tab was not checking permission correctly (Display.template.php)
! Language string for error was missing (Errors.english.php)
! Permissions were not being picked up correctly for rename_topic_own and rename_topic_any (RenameTopic.php)

Ver. 1.0.1
! I made a mistake with the "Re:" thinking it was going to be dynamic on RC3 but it's not.  Now I added this feature and all posts after the first one will have the "Re:" on it.
Title: Re: RenameTopic
Post by: PrizeLive.com on July 12, 2006, 12:38:24 AM
Great mod and thanks a lot!!

I'll install the update you made for "Re:".. thanks again!!
Title: Re: RenameTopic
Post by: JayBachatero on July 12, 2006, 01:12:14 AM
Surf try this package.  It will upgrade the file needed to upgrade and you wont need to uninstall the other one.

EDIT:  Download it from the mod's page.
Title: Re: RenameTopic
Post by: littleone on July 12, 2006, 01:47:57 PM
Awesome.  This will be fanastic!
Title: Re: RenameTopic
Post by: tapirul on July 12, 2006, 03:17:17 PM
that's a great idea for a mod
One question, what should I do to have the "rename" button listed at the top of the page, along with "reply" "notify" "mark unread" etc, instead of bottom? It makes more sense to me to be in that position
I assume I have to edit display.template.php and add something here


// Build the normal button array.
        $normal_buttons = array(
'reply' => array('test' => 'can_reply', 'text' => 146, 'image' => 'reply.gif', 'lang' => true, 'url' => $scripturl . '?action=post;topic=' . $context['current_topic'] . '.' . $context['start'] . ';num_replies=' . $context['num_replies']),
'bookmark' => array('test' => 'can_reply', 'image' => 'print.gif', 'text' => 'bookmark', 'lang' => true, 'url' => $scripturl . '?topic=' . $context['current_topic'] . '.0;do=Bookmark'),
'notify' => array('test' => 'can_mark_notify', 'text' => 125, 'image' => 'notify.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . ($context['is_marked_notify'] ? $txt['notification_disable_topic'] : $txt['notification_enable_topic']) . '\');"', 'url' => $scripturl . '?action=notify;sa=' . ($context['is_marked_notify'] ? 'off' : 'on') . ';topic=' . $context['current_topic'] . '.' . $context['start'] . ';sesc=' . $context['session_id']),
'custom' => array(),
'send' => array('test' => 'can_send_topic', 'text' => 707, 'image' => 'sendtopic.gif', 'lang' => true, 'url' => $scripturl . '?action=sendtopic;topic=' . $context['current_topic'] . '.0'),
'print' => array('text' => 465, 'image' => 'print.gif', 'lang' => true, 'custom' => 'target="_blank"', 'url' => $scripturl . '?action=printpage;topic=' . $context['current_topic'] . '.0'),
);
       
// Special case for the custom one.
if ($context['user']['is_logged'] && $settings['show_mark_read'])
$normal_buttons['custom'] = array('text' => 'mark_unread', 'image' => 'markunread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=topic;t=' . $context['mark_unread_time'] . ';topic=' . $context['current_topic'] . '.' . $context['start'] . ';sesc=' . $context['session_id']);
elseif ($context['can_add_poll'])
$normal_buttons['custom'] = array('text' => 'add_poll', 'image' => 'add_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=editpoll;add;topic=' . $context['current_topic'] . '.' . $context['start'] . ';sesc=' . $context['session_id']);
else
unset($normal_buttons['custom']);

but i am not sure what
thanks
Title: Re: RenameTopic
Post by: JayBachatero on July 13, 2006, 01:42:39 AM
Change

$mod_buttons[] = array('text' => 'rename_topic', 'image' => 'edit.gif', 'lang' => true, 'url' => $scripturl . '?action=renameTopic;topic=' . $context['current_topic']);
to this

$normal_buttons[] = array('text' => 'rename_topic', 'image' => 'edit.gif', 'lang' => true, 'url' => $scripturl . '?action=renameTopic;topic=' . $context['current_topic']);
Title: Re: RenameTopic
Post by: tapirul on July 13, 2006, 01:55:58 AM
thanks
I tried, but the button actually disappears...
shouldn't I add something here as well?... Just guessing
// As before, build the custom button right.
if ($context['user']['is_logged'] && $settings['show_mark_read'])
$normal_buttons['custom'] = array('text' => 'mark_unread', 'image' => 'markunread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=topic;t=' . $context['mark_unread_time'] . ';topic=' . $context['current_topic'] . '.' . $context['start'] . ';sesc=' . $context['session_id']);
elseif ($context['can_add_poll'])
$normal_buttons['custom'] = array('text' => 'add_poll', 'image' => 'add_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=editpoll;add;topic=' . $context['current_topic'] . '.' . $context['start'] . ';sesc=' . $context['session_id']);

echo '
Title: Re: RenameTopic
Post by: JayBachatero on July 13, 2006, 02:18:09 AM
Ok add what I gave you right before that.
Title: Re: RenameTopic
Post by: tapirul on July 13, 2006, 02:40:49 AM
Thanks!
I actually added it in two places, somewhere under
// Build the normal button array.
(it's line 194 in my case)
and under
// As before, build the custom button right.
line 645 in my case

.. in order to have the button listed BOTH at the top of the topic and the bottom of the topic.

Correction: If I add it under line 645, it will appear twice at the bottom... I left it only in the first area, and now it appears only once in each position.
I left the original "$mod_buttons[] = array(..." under //Rename topic, so now I have the buttom both at the top and the bottom of the topic AND at the bottom in the moderation area (where "move" "remove" "lock" etc buttons are.

Thanks again.
i've now idea of PHP scripting, I am just guessing as I said...
Title: Re: RenameTopic
Post by: JayBachatero on July 13, 2006, 02:50:59 AM
I guess if it works with no errors that's good.
Title: Re: RenameTopic
Post by: tapirul on July 13, 2006, 03:36:22 AM
actually it doesn't work... (if I add under "Build the normal button array")
I have it at the bottom, though, that should do it. I'll try to play around to get the right code to put it at the top, too.
Thanks again
Title: Re: RenameTopic
Post by: JayBachatero on July 13, 2006, 11:23:58 AM
When I added it there when I told you it added it at the top and bottom.

EDIT:  Add it before this comment.
   // Special case for the custom one.
Title: Re: RenameTopic
Post by: tapirul on July 14, 2006, 12:50:05 PM
I uninstalled the mod and reinstalled it fresh...First thing, this time the button didn't show anymore for regular users (which is strange.. )...
I added the code chunk where you said, but it gives an error.. The button shows at the top and the bottom but when I click it as a regular user I get "An error has occurred"
From error logs:
QuoteUndefined index: cannot_rename_topic
File: /....../Sources/Errors.php
Line: 336

::) ::)
Title: Re: RenameTopic
Post by: JayBachatero on July 14, 2006, 01:24:18 PM
The button is not supposed to show unless you are allowed to rename the topic.  I made it a permission setting.

Which reminds me change

$normal_buttons[] = array('text' => 'rename_topic', 'image' => 'edit.gif', 'lang' => true, 'url' => $scripturl . '?action=renameTopic;topic=' . $context['current_topic']);

to


if (allowedTo('rename_topic'))
$normal_buttons[] = array('text' => 'rename_topic', 'image' => 'edit.gif', 'lang' => true, 'url' => $scripturl . '?action=renameTopic;topic=' . $context['current_topic']);

Title: Re: RenameTopic
Post by: PrizeLive.com on July 14, 2006, 01:26:09 PM
So I need to edit the code since I installed this a few days ago?

Which file is that that you just showed?
Title: Re: RenameTopic
Post by: JayBachatero on July 14, 2006, 01:28:26 PM
You want to change the position of the menu also?
Title: Re: RenameTopic
Post by: PrizeLive.com on July 14, 2006, 01:41:03 PM
Oh... no i think it's better on the bottom...
Title: Re: RenameTopic
Post by: tapirul on July 14, 2006, 03:16:52 PM
Quote from: Jay The Code Monkey on July 14, 2006, 01:24:18 PM
The button is not supposed to show unless you are allowed to rename the topic.  I made it a permission setting.
I understand that.. What I did is, I created a normal user, I opened a topic with it and I checked to see if I can rename (the permissions are set to be able to rename own topics).
After the uninstall/reinstall I couldn't see the button anymore, as a regular user (I can see it as admin).
Maybe something left over after uninstall?

So okay, if I start fresh, where do I add the code?

Thanks
Title: Re: RenameTopic
Post by: tapirul on July 14, 2006, 03:23:45 PM
Quote from: Jay The Code Monkey on July 14, 2006, 01:28:26 PM
You want to change the position of the menu also?
no, just to show the button in "normal buttons" area
Title: Re: RenameTopic
Post by: JayBachatero on July 14, 2006, 04:12:59 PM
Ok search for

// Build the normal button array.
$normal_buttons = array(
'reply' => array('test' => 'can_reply', 'text' => 146, 'image' => 'reply.gif', 'lang' => true, 'url' => $scripturl . '?action=post;topic=' . $context['current_topic'] . '.' . $context['start'] . ';num_replies=' . $context['num_replies']),
'notify' => array('test' => 'can_mark_notify', 'text' => 125, 'image' => 'notify.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . ($context['is_marked_notify'] ? $txt['notification_disable_topic'] : $txt['notification_enable_topic']) . '\');"', 'url' => $scripturl . '?action=notify;sa=' . ($context['is_marked_notify'] ? 'off' : 'on') . ';topic=' . $context['current_topic'] . '.' . $context['start'] . ';sesc=' . $context['session_id']),
'custom' => array(),
'send' => array('test' => 'can_send_topic', 'text' => 707, 'image' => 'sendtopic.gif', 'lang' => true, 'url' => $scripturl . '?action=sendtopic;topic=' . $context['current_topic'] . '.0'),
'print' => array('text' => 465, 'image' => 'print.gif', 'lang' => true, 'custom' => 'target="_blank"', 'url' => $scripturl . '?action=printpage;topic=' . $context['current_topic'] . '.0'),
);


Add after

// Show rename topic button.
if (allowedTo('rename_topic'))
$normal_buttons[] = array('text' => 'rename_topic', 'image' => 'edit.gif', 'lang' => true, 'url' => $scripturl . '?action=renameTopic;topic=' . $context['current_topic']);



In Display.php.
Title: Re: RenameTopic
Post by: tapirul on July 14, 2006, 05:50:28 PM
this is exactly what I did after your last post (replly 13), but the button doesn't show in the "normal buttons" area, and this is what puzzles me; this and the fact that regular users cannot rename their topics even if they are allowed to (i get that
8: Undefined index: cannot_rename_topic
File: /...Sources/Errors.php
Line: 336

error)
I'll try it in a different theme to see how it works...
Title: Re: RenameTopic
Post by: tapirul on July 14, 2006, 05:59:50 PM
.........so, it seems it has something to do with permissions...
the buttons show allright for admin... They don't show for regular users, even if they have permissions set...
an if it shows (in the original position), it gives me the error...
Title: Re: RenameTopic
Post by: JayBachatero on July 14, 2006, 11:48:32 PM
Ok I'll look into it.
Title: Re: RenameTopic
Post by: JayBachatero on July 15, 2006, 12:47:44 AM
! RenameTopic tab was not checking permission correctly (Display.template.php)
! Language string for error was missing (Errors.english.php)
! Permissions were not being picked up correctly for rename_topic_own and rename_topic_any (RenameTopic.php)

You should be able to upgrade from the other versions.  No need to uninstall.
Title: Re: RenameTopic
Post by: lorddraco on July 21, 2006, 07:30:41 AM
Hi ... me using Babylon Theme.... anyway to teach me how to mod the theme to include your function?
Title: Re: RenameTopic
Post by: JayBachatero on July 21, 2006, 11:56:09 AM
In Display.template.php for the Babylong theme

Code (find) Select

return implode($context['menu_separator'], $moderationButtons);


Code (add before) Select

// Rename Topic
if (allowedTo('rename_topic'))
$moderationButtons[] = '<a href="' . $scripturl . '?action=renameTopic;topic=' . $context['current_topic'] . '">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/rename_topic.gif" alt="' . $txt['rename_topic'] . '" />' : $txt['rename_topic']) . '<a>';


Upload this image to the /Themes/babylon/images/english dir.
Title: Re: RenameTopic
Post by: K_4_kelly on August 08, 2006, 04:18:11 PM
hi Jay,

can i have this with the chinese word available to show as well?

thanks  ;D
Title: Re: RenameTopic
Post by: Simplemachines Cowboy on August 08, 2006, 07:29:41 PM
Again, I have installed the latest version, and I have no button on the mod bar at the bottom, and I see no place in the admin section to change to allow admin and mods permission to use this feature.
I'd really like to have this but it says it installs correctly, but I cannot find any evidence that it exists.

Except for these two errors:"
Quotehttp://www.mydomain.net/forum/index.php?action=permissions;sa=modify;group=2
8: Undefined index: permissionname_rename_topic_any
File: /home/mydomain/public_html/forum/Sources/ManagePermissions.php
Line: 1417
and
Quotehttp://www.mydomain.net/forum/index.php?action=permissions
8: Undefined index: permissionname_rename_topic_own
File: /home/mydomain/public_html/forum/Sources/ManagePermissions.php
Line: 1413
Title: Re: RenameTopic
Post by: JayBachatero on August 09, 2006, 01:07:39 AM
Simplemachines Cowboy are you using RC2?

K_4_Kelly sure.  Try this file.  BTW I released another version of the Global Announcements mod if you are interested ;).
Title: Re: RenameTopic
Post by: K_4_kelly on August 09, 2006, 03:09:16 AM
hi Jay..

thanks ya!  I replaced the renametopic.php already.. will try it later!

I m definitely interested in the another version of the Global Announcements Mod.. :D
Have you already Post it?  Could you please send me the URL, so that I can go and check it out...
by the way, what is the difference between the two versions?
Title: Re: RenameTopic
Post by: JayBachatero on August 09, 2006, 03:34:21 AM
Two versions have been released.
http://www.simplemachines.org/community/index.php?topic=93129.msg664639#msg664639
and
http://www.simplemachines.org/community/index.php?topic=93129.msg672262#msg672262
Title: Re: RenameTopic
Post by: Simplemachines Cowboy on August 09, 2006, 11:23:54 PM
I am using RC2 and I installed this file:
RenameTopic_1-0-2.tar.gz
Title: Re: RenameTopic
Post by: JayBachatero on August 10, 2006, 12:29:14 AM
Did you receive any errors on install?
Title: Re: RenameTopic
Post by: Simplemachines Cowboy on August 10, 2006, 01:09:05 AM
No.
It installed ok according to the package installer.

Here is my manage_permissions revelant sections regarding the errors I posted earlier:

1406 $context['permissions'][$permissionType]['columns'][$position][$permissionGroup]['permissions'][$perm] = array(
1407 'id' => $perm,
1408 'name' => &$txt['permissionname_' . $perm],
1409 'show_help' => isset($txt['permissionhelp_' . $perm]),
1410 'has_own_any' => $has_own_any,
1411 'own' => array(
1412 'id' => $perm . '_own',
1413 'name' => $has_own_any ? $txt['permissionname_' . $perm . '_own'] : ''
1414 ),
1415 'any' => array(
1416 'id' => $perm . '_any',
1417 'name' => $has_own_any ? $txt['permissionname_' . $perm . '_any'] : ''
1418 )
1419 );
1420 }
Title: Re: RenameTopic
Post by: JayBachatero on August 10, 2006, 01:14:52 AM
I have a feeling that the ManagePermission modification failed.  Can you post that file so that I can look into it?
Title: Re: RenameTopic
Post by: Simplemachines Cowboy on August 10, 2006, 11:45:01 PM
You want the whole Sources/ManagePermissions.php file posted?
Title: Re: RenameTopic
Post by: JayBachatero on August 11, 2006, 12:26:53 AM
Yea. You are a CM so you can post attachments.
Title: Re: RenameTopic
Post by: Simplemachines Cowboy on August 11, 2006, 12:36:25 AM
Here ya go.

It did change my file - the old file is 50641 bytes and the new one is 50670 bytes.
Title: Re: RenameTopic
Post by: JayBachatero on August 11, 2006, 12:53:17 AM
Umm seems like the mod installed twice.  Check the other files to see if the code is repeated.  Also remove 'rename_topic' => true, from the ManagePermissions.php file.  Remove one of them.
Title: Re: RenameTopic
Post by: daragor on August 28, 2006, 10:07:50 AM
works un RC3? i need this great mod!
Title: Re: RenameTopic
Post by: JayBachatero on August 28, 2006, 11:04:24 AM
Yea it should work on RC3.
Title: Re: RenameTopic
Post by: littleone on August 28, 2006, 01:30:01 PM
Quote from: Jay The Code Monkey on August 28, 2006, 11:04:24 AM
Yea it should work on RC3.

I will confirm that it does
Title: Re: RenameTopic
Post by: JayBachatero on August 28, 2006, 02:14:54 PM
I'll updaet the mod site and add RC3 to the lsit.
Title: Re: RenameTopic
Post by: Manu.G on October 07, 2006, 07:44:51 PM
I tried to download the mod here (http://mods.simplemachines.org/index.php?mod=384), but it wont work.
Where can I get the mod?
Title: Re: RenameTopic
Post by: JayBachatero on October 07, 2006, 08:23:01 PM
What error are you getting?
Title: Re: RenameTopic
Post by: Inflame on October 18, 2006, 12:39:49 PM
Heya,

I like this mod, there is only 1 thing I don't really like

Its a tiny thing, but I might be perfectionistic (how to spell that :P ) since the Rename Topic mod renames the topic to "RE: (topic name)" except of SMF normal places: "Re: (topic name)"

How can i change thhat capital E to a normal one?


Sorry for whining about nothing, but well... ;)

Should be easy to modify, but can't find it.

Thanks

Matthijs
Title: Re: RenameTopic
Post by: JayBachatero on October 18, 2006, 12:54:16 PM
Umm I guess this one slipped by I'm going to change it locally also.
In RenameTopic.php
Code (find) Select

subject = 'RE: $_POST[subject]'


Code (replace) Select

subject = " . $txt['response_prefix'] . $_POST['subject'] . "
Title: Re: RenameTopic
Post by: Inflame on October 18, 2006, 12:59:31 PM
Thanks for helping out!

Have a nice evening :)
Title: Re: RenameTopic
Post by: Inflame on October 30, 2006, 10:36:13 AM
Heya


I get an Hacking attempt error on my forum when i use this mod whahahah


not cool


I dont know what is wrong, I changed the code like you told before in your post, but not this message comes up:
"Hacking attempt..."

How can I hack the stuff I own, :P

Forum Error Log shows this:


UPDATE main_forum_messages
SET
subject = Re: Fast & Pray United
WHERE ID_TOPIC = '76'
File: /usr/home/inflame/domains/inflame.nu/public_html/forum/Sources/RenameTopic.php
Line: 83


Whats wrong?

Im running on 1.1 RC3, with UTF-8 database

Thanks!

(and btw just wanted to say off topic, the skin of this board is TERRIBLE :P )
Title: Re: RenameTopic
Post by: Inflame on October 30, 2006, 11:45:42 AM
I fixed the problem,

I replaced the code subject = " . $txt['response_prefix'] . $_POST['subject'] . " which I filled in before, with subject = 'Re: $_POST[subject]'

You see I just only changed the capital E to a normal e, and it works fine at my forum.

So a better option? ;)
Title: Re: RenameTopic
Post by: JayBachatero on October 30, 2006, 12:24:10 PM
Oops my mistake.  This should work.

subject = '" . $txt['response_prefix'] . $_POST['subject'] . "'
Title: Re: RenameTopic
Post by: gmatyi on December 11, 2006, 09:37:16 AM
Hi,

I recommend to modify the install.xml as the following:

<modification xmlns="http://www.simplemachines.org/xml/modification" xmlns:smf="http://www.simplemachines.org/">
<id>jaybachatero:rename-topic</id>
<version>1.0.3</version>

<file name="$boarddir/index.php">
<operation>
<search position="before"><![CDATA[
'removepoll' => array('Poll.php', 'RemovePoll'),
]]></search>
<add><![CDATA[
'renameTopic' => array('RenameTopic.php', 'RenameTopic'),
]]></add>
</operation>
</file>

<file name="$sourcedir/ManagePermissions.php">
<operation>
<search position="before"><![CDATA[
'announce_topic' => false,
]]></search>
<add><![CDATA[
'rename_topic' => true,
]]></add>
</operation>
</file>

<file name="$themedir/Display.template.php">
<operation>
<search position="before"><![CDATA[
$mod_buttons[] = array('text' => 'quickmod_delete_selected', 'image' => 'delete_selected.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . $txt['quickmod_confirm'] . '\');" id="quickmodSubmit"', 'url' => 'javascript:document.quickModForm.submit();');
]]></search>
<add><![CDATA[

// Rename Topic
if (allowedTo('rename_topic_any') || ($context['user']['started'] && allowedTo('rename_topic_own')))
$mod_buttons[] = array('text' => 'rename_topic', 'image' => 'edit.gif', 'lang' => true, 'url' => $scripturl . '?action=renameTopic;topic=' . $context['current_topic']);
]]></add>
</operation>
</file>

<file name="$themes_dir/classic/Display.template.php">
<operation>
<search position="before"><![CDATA[
$mod_buttons[] = array('text' => 'quickmod_delete_selected', 'image' => 'delete_selected.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . $txt['quickmod_confirm'] . '\');" id="quickmodSubmit"', 'url' => 'javascript:document.quickModForm.submit();');
]]></search>
<add><![CDATA[

// Rename Topic
if (allowedTo('rename_topic_any') || ($context['user']['started'] && allowedTo('rename_topic_own')))
$mod_buttons[] = array('text' => 'rename_topic', 'image' => 'edit.gif', 'lang' => true, 'url' => $scripturl . '?action=renameTopic;topic=' . $context['current_topic']);
]]></add>
</operation>
</file>

<file name="$themes_dir/babylon/Display.template.php">
<operation>
<search position="before"><![CDATA[
return implode($context['menu_separator'], $moderationButtons);]]></search>
<add><![CDATA[

// Rename Topic
if (allowedTo('rename_topic'))
$moderationButtons[] = '<a href="' . $scripturl . '?action=renameTopic;topic=' . $context['current_topic'] . '">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/rename_topic.gif" alt="' . $txt['rename_topic'] . '" />' : $txt['rename_topic']) . '<a>';
]]></add>
</operation>
</file>

<file name="$languagedir/Modifications.english.php">
<operation>
<search position="end" />
<add><![CDATA[
// Rename Topic general
$txt['rename_topic'] = 'Rename Topic';
$txt['rename_topic_no_id'] = 'You must select a valid topic.';
$txt['rename_topic_current_subject'] = 'Current Subject';
$txt['rename_topic_new_subject'] = 'New Subject';

//RenameTopic permissions.
$txt['permissionname_rename_topic'] = 'Rename Topic';
$txt['permissionhelp_rename_topic'] = 'If you enable this permission for this membergroup they will be allowed to rename the subject for an entire topic.';
$txt['permissionname_rename_topic_own'] = 'Own topic';
$txt['permissionname_rename_topic_any'] = 'Any topic';

$txt['cannot_rename_topic_any'] = 'Sorry, you\'re not allowed to rename just any topic.';
$txt['cannot_rename_topic_own'] = 'Sorry, you\'re not allowed to rename your own topic.';
]]></add>
</operation>
</file>

</modification>


The reason is that the right place of the language strings is the file Modifications.english.php. Many users use the smf with any language pack and lots of these users don't know where can be found these string. If the user translate these string in the ManagePermissions.translated.php and later he get a new translation (that doesn't include the strings for the Renametopic), the user have to modify this file again.

Also I recommend to add this line to the package-info.xml

<require-file name="rename-topic.gif" destination="$themes_dir/babylon/images/english" />

of course with adding the file rename-topic.gif.
Title: Re: RenameTopic
Post by: JayBachatero on December 12, 2006, 12:04:07 PM
Thanks for the suggestion but I prefer to keep them the following way since that's where they really belong.  Permissions, help and modification files.
Title: Re: RenameTopic
Post by: ProtoMan.EXE on December 17, 2006, 02:53:10 AM
When my members tried to rename their topics, it said :

QuoteSorry, you're not allowed to rename just any topic.

But I am sure I gave them the permissions to rename their topics. What should I do now ? Should I look for some codes and change it ? Thank you.
Title: Re: RenameTopic
Post by: Deb on December 31, 2006, 09:57:58 AM
Hello,

need some help with this MOD.

All works good when Admin is logged in.. BUT when I give permission ( permission settings in Admin CP )to the Global Moderator Group, the link "Rename Topic" in the doesn't show up at all  ???

What's wrong?
Title: Re: RenameTopic
Post by: JayBachatero on December 31, 2006, 11:14:11 AM
is this with the default theme?
Title: Re: RenameTopic
Post by: Deb on December 31, 2006, 11:27:24 AM
Yes it is.

I figured it out, it wasn't enough to set permission only for the Group, I had to set them for all boards.

Thanks

Happy New Year
Title: Re: RenameTopic
Post by: tapirul on January 21, 2007, 09:36:26 PM
SMF 1.1.1?
:)
Title: Re: RenameTopic
Post by: JayBachatero on January 23, 2007, 06:24:56 PM
This mod should work in 1.1.1.
Title: Re: RenameTopic
Post by: GetRank on February 07, 2007, 09:44:39 PM
Quote from: JayBachatero on January 23, 2007, 06:24:56 PM
This mod should work in 1.1.1.
working..  ;)
Title: Re: RenameTopic
Post by: RODEOSOLSTICE on February 11, 2007, 08:58:32 PM
great mod :thumbs:

working great on 1.1.1

thanks!!!

I did mistakenly use the first version by accident, so I point out here that RenameTopic_1-0-2.tar.gz is the most recent version - for newbies like me :D
Title: Re: RenameTopic
Post by: Matthew Schenker on March 03, 2007, 07:06:23 PM
I really like the idea of this mod, as I have had to manually rename topics a few times!

Does it work with 1.1.2?
Title: Re: RenameTopic
Post by: littleone on March 03, 2007, 08:43:29 PM
Yes it works with 1.1.2.  I installed it this morning after i upgraded and its works fine.
Title: Re: RenameTopic
Post by: Matthew Schenker on March 04, 2007, 11:14:12 AM
I installed it on my 1.1.2 test forum and it works great.  Nice modification.
Thanks!
Title: Re: RenameTopic
Post by: rwsniadach on March 23, 2007, 04:02:24 PM
Hi!
Have downloaded the 1.0.2 version and attempted to use this Package Parser to install it. I get several errors when attempting it. Maybe the Rename Topic mod is not compatible with the Package Parser?
http://modparser.dev.dansoftaustralia.net/ (http://modparser.dev.dansoftaustralia.net/)
Sorry if I'm making some obvious error - I'm a newbie to installing mods.
Am using SMF1.1.1
Will install Rename Topic mod another way if easier to do so. Let me know.
Thanks!
RWS
Title: Re: RenameTopic
Post by: littleone on March 23, 2007, 07:02:19 PM
Just generally speaking, the mod authors write their mods to work with the SMF package install.  Its unlikely that any of them test their mods on that parser, nor do they really support it in that fashion (for a better lack of words).  Your best bet is to just use it with the SMF install, that way you know it works.
Title: Re: RenameTopic
Post by: JayBachatero on March 26, 2007, 10:23:27 AM
If I'm correct Dan was having a few issues with the Package Parser.  Try installing the mod and see if it works.
Title: Re: RenameTopic
Post by: shaiss on August 03, 2007, 03:52:25 PM
thank god you are a genius!!! THANK YOU!!!
Title: Re: RenameTopic
Post by: softtouch on January 04, 2008, 09:34:13 PM
Would it work on 1.1.4? I really need this to rename a LONG topic...
Title: Re: RenameTopic
Post by: TrueSatan on January 04, 2008, 10:04:14 PM
It works perfectly on SMF 1.1.4...BTW to make it work with the Package Parser first download the mod to your local machine...unpack the archive...repack the files in the archive (not any overall directory) into a .zip archive...the Package Parser chokes on .tar.gz archives so by making the mod into a .zip archive instead you will be able to use it.
Title: Re: RenameTopic
Post by: farhaddad on January 21, 2008, 06:31:48 PM
Quote from: ProtoMan.EXE on December 17, 2006, 02:53:10 AM
When my members tried to rename their topics, it said :

QuoteSorry, you're not allowed to rename just any topic.

But I am sure I gave them the permissions to rename their topics. What should I do now ? Should I look for some codes and change it ? Thank you.

Dear JayBachatero,

I'm having the same [quoted] problem here. I read the mod code several times and couldn't find where it went wrong

Would you please look in to this issue again!

I'm using SMF 1.1.4 with Classic Theme and the only altered code is in display template:

// Rename Topic
if (allowedTo('rename_topic_any') || ($context['user']['started'] && allowedTo('rename_topic_own')))
$moderationButtons[] = '<a href="' . $scripturl . '?action=renameTopic;topic=' . $context['current_topic'] . '">' . $txt['rename_topic'] . '</a>';


Note: The mod works well if I set the permission to "rename any"

Thanks
Title: Re: RenameTopic
Post by: TrueSatan on January 21, 2008, 09:28:13 PM
 Does the mod work properly for you if you use the SMF default theme? Always check with that first to see that it is properly installed and working as it should before trying it in any custom theme.

You should also edit the language directory files (if they exist) in your custom theme as per the mod installation in the default theme (Modifications.english.php, ManagePermissions.english.php and Errors.english.php.)
Title: Re: RenameTopic
Post by: farhaddad on January 22, 2008, 08:02:32 AM
Yes sure I'm having the same problem with the default theme and I'm using the default language directory.

Thank you for replying.  :)

Quote from: TrueSatan on January 21, 2008, 09:28:13 PM
Does the mod work properly for you if you use the SMF default theme? Always check with that first to see that it is properly installed and working as it should before trying it in any custom theme.

You should also edit the language directory files (if they exist) in your custom theme as per the mod installation in the default theme (Modifications.english.php, ManagePermissions.english.php and Errors.english.php.)
Title: Re: RenameTopic
Post by: TrueSatan on January 23, 2008, 06:24:37 PM
Before I start digging into this would you please see reply #56 and let me know if doing as the member concerned did solves your problem?
Title: Re: RenameTopic
Post by: farhaddad on January 24, 2008, 06:59:26 AM
Quote from: TrueSatan on January 23, 2008, 06:24:37 PM
Before I start digging into this would you please see reply #56 and let me know if doing as the member concerned did solves your problem?

I think reply #56 was about the mod not working at all for that group when using local board permissions

I'm not using local board permissions but I tried that and used local board permissions for one of the boards and gave regular members group the permission to rename "own" topics only and I still get the same error message.

I tried that on a clean SMF installation... so yes please start digging into this...

Many thanks
Title: Re: RenameTopic
Post by: TrueSatan on January 24, 2008, 09:36:16 AM
If you look at the first post in this topic you'll see that the mod author had a problem with the permissions logic of the mod and attempted to fix it with a subsequent version...looking at it now the fix hasn't had its desired effect so I'll attempt to debug the problem and to see if I can come up with a better fix.
Title: Re: RenameTopic
Post by: TrueSatan on January 24, 2008, 09:51:01 AM
It's not a final version (needs cleaning up) but would you please test this for me? It works on my test site but, obviously, it hasn't had extensive testing.

Rename your existing RenameTopic.php in your Sources directory to RenameTopic.phpold and upload the attached file.
Title: Re: RenameTopic
Post by: farhaddad on January 24, 2008, 11:03:23 AM
Quote from: TrueSatan on January 24, 2008, 09:51:01 AM
It's not a final version (needs cleaning up) but would you please test this for me? It works on my test site but, obviously, it hasn't had extensive testing.

Rename your existing RenameTopic.php in your Sources directory to RenameTopic.phpold and upload the attached file.

Worked for me as well  :) I tested it on the default groups and also on a new created group.
Thank you for sacrificing your time to fix this... I really appreciate it
Title: Re: RenameTopic
Post by: TrueSatan on January 24, 2008, 11:56:44 AM
Thank you for your kind words and for posting back so I know the problem is solved.
Title: Re: RenameTopic
Post by: gavin on January 31, 2008, 12:00:29 PM
Thanks for this fix TrueSatan, it works for me too.
Title: Re: RenameTopic
Post by: TrueSatan on January 31, 2008, 08:13:03 PM
Thanks for your report too gavin.
Title: Re: RenameTopic
Post by: PrizeLive.com on February 28, 2008, 12:18:40 PM
I downloaded this and tried to upload but got an error:

The package you tried to upload either is not a valid package or has become corrupted.
Title: Re: RenameTopic
Post by: Manu.G on March 18, 2008, 12:26:51 PM
Since I have installed the Rename Mod, the little button to modify postings in the postings
itself isn't working anymore.
What was going wrong with the installation?
Title: Re: RenameTopic
Post by: Matthew Schenker on May 07, 2008, 11:56:13 AM
I have been using this modification in my 1.1.X forum for some time.  In my opinion, renaming topics is a basic administrative function!

I'm disappointed to see that it is not part of the 2.0 release.  Or am I missing something?

Matthew
Title: Re: RenameTopic
Post by: stomic on February 09, 2009, 01:30:14 PM
Is there any plan on supporting 2.0?
Title: Re: RenameTopic
Post by: JayBachatero on March 17, 2009, 04:15:15 PM
From me?  I don't think so.  You can say that I'm done for the most part with SMF related work.  If anyone wants to take on this, be my guest.
Title: Re: RenameTopic
Post by: ameo on March 17, 2009, 04:51:00 PM
This is so useful I'm surprised it isn't default.
Title: Re: RenameTopic
Post by: style72 on June 26, 2009, 04:54:56 AM
the mod works fine but only for administrators. for the moderators do not see the button "topic rename", the permissions are enabled. thanks and sorry for my English
Title: Re: RenameTopic
Post by: Turkishe on September 15, 2009, 03:26:15 AM
thanks this nice mod!!! ;)
Title: Re: RenameTopic
Post by: Özgür on September 15, 2009, 06:59:30 AM
Turkish language didn't have any word like "Pardon"!
Title: Re: RenameTopic
Post by: Turkishe on September 15, 2009, 10:53:55 AM
Quote from: [Daydreamer] on September 15, 2009, 06:59:30 AM
Turkish language didn't have any word like "Pardon"!
böyle söylererek "senle uğraşamam, şimdiden vazgeç" gibi bişey diyosun.
türkçe'de nasıl "Pardon" kelimesi olmaz. hem türkçe bile yazmamışsın.

(thanks for information mr daydreamer)
(bilgi için teşekkür ederim daydreamer)
Title: Re: RenameTopic
Post by: Özgür on September 15, 2009, 11:21:12 AM
I didn't mean anything. Pardon is french word. Are you try to search in "tdk sözlük" ?
I don't use turkish language in this board because this is this board rules.

Pardon fransızca bir kelimedir. Türkçe'de Üzgünüm Özür dilerim anlamına gelir. Tdk sözlüğe bakabilirsiniz. Ben çeviriniz yada bundan sonraki yapacaklarınızla alakalı birşey söylemedim. Çeviri yapıyorsanız önce türkçeyi doğru kullanın sadece. Bu bölümde türkçe konuşamazsınız. Türkçe bölümü harici diğer bölümlerde ingilizceden başka dil kullanlmaz.Bu bir kuraldır.
Title: Re: RenameTopic
Post by: javierjp on October 15, 2009, 04:58:20 PM
Quote from: style72 on June 26, 2009, 04:54:56 AM
the mod works fine but only for administrators. for the moderators do not see the button "topic rename", the permissions are enabled. thanks and sorry for my English

The lastest version (Ver. 1.0.2) still have these error? its possible to assign the permision to a custom group?

I want to create a custom group with move and rename topic permissions only (without post edit permissions)
Its possible?

thanks in advance.
excuse my english,
Title: Re: RenameTopic
Post by: Max22 on October 16, 2009, 08:51:57 AM
Is there a way to add code for locked topics? I added rename_own permission for normal users, and they can rename own topic also when closed.
Title: Re: RenameTopic
Post by: whitehack on November 10, 2009, 02:38:52 PM
Help!

I need this precious mod for SMF 1.1.10!

but the downloadable archives in this page:
http://mods.simplemachines.org/index.php?mod=384 (http://mods.simplemachines.org/index.php?mod=384)

seems to be empty (they all contain only an empty xml file..)

am I wrong?

I followed the Manual Install Instructions for SMF 1.1.10 but the last step is:

"...
Move the included file "RenameTopic.php" to "./Sources".
Move the included file "RenameTopic.template.php" to "./Themes/default".
..."

where can I get these files?

thanks a lot!!
Title: Re: RenameTopic
Post by: ameo on November 10, 2009, 03:04:06 PM
Try to download this one (http://www.box.net/shared/600h6ppotb). Maybe it will help. I downloaded file, and everything seems right with download.
Title: Re: RenameTopic
Post by: Max22 on January 08, 2010, 04:51:10 PM
Quote from: Max22 on October 16, 2009, 08:51:57 AM
Is there a way to add code for locked topics? I added rename_own permission for normal users, and they can rename own topic also when closed.

Up.
Title: Re: RenameTopic
Post by: live627 on January 08, 2010, 11:40:14 PM
Try Change All Subjects. It is not an offspring of RenameTopic but it is under active support.

http://custom.simplemachines.org/mods/index.php?mod=1165
Title: Re: RenameTopic
Post by: FragaCampos on February 20, 2011, 02:46:20 PM
I just want to say that this mod is awesome and it still works in SMF 1.1.13.

I can't believe this isn't a default option...
Title: Re: RenameTopic
Post by: FragaCampos on November 04, 2018, 08:13:24 PM
Still working in 2.0.15.

There's only one change needed in RenameTopic.php:


Code (find) Select
mysql_free_result($selectSubject);

Code (replace) Select
$smcFunc['db_free_result']($selectSubject);

(Thanks to Arantor here (https://www.simplemachines.org/community/index.php?topic=554124.msg3927705#msg3927705))
Title: Re: RenameTopic
Post by: FragaCampos on June 09, 2020, 12:25:48 AM
I think there was some kind of update to PHP in my server, because I suddenly got this error on my error log:

2048: Only variables should be passed by reference
File: Sources/RenameTopic.php
Line: 63


Here's the line:
// Stripslashes and htmlspecialchars
$context['currentSubject'] = strtr(censorText(stripslashes($currentSubject)), array("\r" => '', "\n" => '', "\t" => ''));



It seems something similar to this (https://www.simplemachines.org/community/index.php?topic=451795.msg3926772#msg3926772), but I can't make it work.
Anyone?
Title: Re: RenameTopic
Post by: live627 on July 15, 2020, 07:52:15 PM
// Stripslashes and htmlspecialchars
censorText($currentSubject);
$context['currentSubject'] = strtr(stripslashes($currentSubject), array("\r" => '', "\n" => '', "\t" => ''));
Title: Re: RenameTopic
Post by: FragaCampos on July 16, 2020, 11:22:40 PM
Thank you very much!

Working flawlessly now.  8)