News:

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

Main Menu

RenameTopic

Started by JayBachatero, July 12, 2006, 12:32:17 AM

Previous topic - Next topic

JayBachatero

Yea it should work on RC3.
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

littleone


JayBachatero

I'll updaet the mod site and add RC3 to the lsit.
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

Manu.G

I tried to download the mod here, but it wont work.
Where can I get the mod?
Version SMF 2.0.8
SimplePortal 2.3.5

JayBachatero

What error are you getting?
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

Inflame

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

JayBachatero

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'] . "
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

Inflame

Thanks for helping out!

Have a nice evening :)

Inflame

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 )

Inflame

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

JayBachatero

Oops my mistake.  This should work.

subject = '" . $txt['response_prefix'] . $_POST['subject'] . "'
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

gmatyi

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

JayBachatero

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.
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

ProtoMan.EXE

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.

Deb

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?
Thank you from Deb :)

JayBachatero

is this with the default theme?
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

Deb

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
Thank you from Deb :)

tapirul


JayBachatero

This mod should work in 1.1.1.
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert


Advertisement: