Disable Subject Change
Written by: tyty1234 (http://www.simplemachines.org/community/index.php?action=profile;u=159909)
Current Version: 2.0
Compatible With: SMF 2.0
Download (http://custom.simplemachines.org/mods/index.php?mod=2045)
Summary
This mod adds an option in the admin panel to disable the ability to change the subject of a topic when replying to that topic. This option can be accessed via Admin -> Forum -> Post and Topics.
Installation
This mod should be installed using the Package Manager. No manual edits should be necessary, but if it comes to that resort, please use the Package Parser (http://www.tytyweb.net/projects/smf/package-parser/).
Changelog
What's new in this version?
Released for SMF 2.0
Enabled subject changing for all moderators (board moderators, global moderators)
Slight change of code.
Dropped SMF 1.1.x compatibility. DO NOT use this version for SMF 1.1.x
Nice mod TyTy. :)
Thanks Shadow!
I hope that most people will find it useful. :D
getting error on install
QuoteExecute Modification ./Themes/default/Post.template.php Test failed
post.template.php does not have this bit of code your mod is looking for
</td>
</tr>
<tr>
<td align="right">
<b>', $txt[71], ':</b>
The one in my themes folder does not have it either ::)
Have you tried installing the mod manually?
I would .. but this bit of code that needs to be replaced is not in post.template
Quote</td>
</tr>
<tr>
<td align="right">
<b>', $txt[71], ':</b>
Can you attach your Post.template.php file?
Quote from: tyty1234 on September 07, 2009, 09:23:27 PM
Can you attach your Post.template.php file?
i have attached my theme's post.template ... but its also not found in the default themes post.template .. Im using SMF 1.1.10
This is caused by another mod you have installed. Here are the changes you should make though.
', $txt[70], ':
</td>
<td>
', $txt[70], ':
</td>
<td>';
<input type="text" name="subject"', $context['subject'] == '' ? '' : ' value="' . $context['subject'] . '"', ' tabindex="', $context['tabindex']++, '" size="80" maxlength="50" />
// Disable Subject Change Mod.
if(isset($modSettings['disableSubjectChange']))
echo '
', $modSettings['disableSubjectChange'] ? !isset($context['num_replies']) ? '' : $context['subject'] == '' ? '' : $context['subject'] . ' ' : '', '<input type="', $modSettings['disableSubjectChange'] ? !isset($context['num_replies']) ? 'text' : 'hidden' : 'text', '" name="subject"', $context['subject'] == '' ? '' : ' value="' . $context['subject'] . '"', ' tabindex="', $context['tabindex']++, '" size="80" maxlength="80" />
</td>
</tr>
<tr>
<td align="right"> </td>
<td>
<fieldset id="newstyleMI">
<legend><b>', $txt[71] ,':</b></legend>
echo '
</td>
</tr>
<tr>
<td align="right"> </td>
<td>
<fieldset id="newstyleMI">
<legend><b>', $txt[71] ,':</b></legend>
Thank you for this, tyty1234. I'm tired of my posters taking advantage of my senility by changing the subject and messing with my head. This'll fix 'em!
:D
lol, your welcome gbsothere! :D
it wont break my other mod ??
If anything goes wrong, just let me know. It shouldn't break your other mod. What mod is that btw?
Quote from: tyty1234 on September 07, 2009, 10:12:12 PM
If anything goes wrong, just let me know. It shouldn't break your other mod. What mod is that btw?
look like the new style message icon mod i have ...
http://custom.simplemachines.org/mods/index.php?mod=1447
I also changed the maxsubjectlength from 80 to 50 .. but that i can easily edit in your code
question ... can the original poster edit the subject?
and can admin/mods still adjust subjects
Quote from: aw06 on September 07, 2009, 10:27:19 PM
question ... can the original poster edit the subject?
and can admin/mods still adjust subjects
This has been addressed to me by someone else, as the mod prevents everyone from changing the subject line.
Quote from: tyty1234 on September 07, 2009, 10:28:51 PM
Quote from: aw06 on September 07, 2009, 10:27:19 PM
question ... can the original poster edit the subject?
and can admin/mods still adjust subjects
This has been addressed to me by someone else, as the mod prevents everyone from changing the subject line.
wow .. this is not good :-[ if that's the case this mod will slightly handicap things on my boards ...
Can you not make it so that it will only affect regular members ?
I'll probably address that in the next release of the mod. :)
Right now, I am caught up with other things at the moment.
Quote from: tyty1234 on September 07, 2009, 10:36:31 PM
I'll probably address that in the next release of the mod. :)
Right now, I am caught up with other things at the moment.
ok kool, keep us posted 8)
You can also receive updates from this mod by going here (http://custom.simplemachines.org/mods/index.php?mod=2045) and clicking on "Notify me of updates".
done .. i hope to see an update sometime in this quarter hehe
thanks for the update ... so admin can now edit the subjects ...
can the original topic starter edit as well ?
should be able to. If not, let me know. :)
Installed Disable Subject Change v1.2 on SMF 2.0 RC1.2, admins can't change the subject...
Fixed in version 1.3 :)
Quote from: tyty1234 on September 26, 2009, 01:43:46 AM
Fixed in version 1.3 :)
Txs for the fast action, all tests passed :)
can original topic starters change subject as well ?
Quote from: aw06 on September 26, 2009, 09:40:56 AM
can original topic starters change subject as well ?
Original topic starters can only change the subject of the OP, thus, changing the subject for all replies that were added after the subject of the OP was changed.
Quote from: tyty1234 on September 27, 2009, 08:26:58 PM
Quote from: aw06 on September 26, 2009, 09:40:56 AM
can original topic starters change subject as well ?
Original topic starters can only change the subject of the OP, thus, changing the subject for all replies that were added after the subject of the OP was changed.
Niceee 8)
ok, i have new style message icon mod installed .. and its conflicting with this mod ... can you take a look at my post.template.php ...
I installed version 1.3 and as admin it can't seem to edit the subjects ... i tried to edits you suggested to me on the first page of this thread, but it still does not work...
ahhh nevermind ... my mistake :P was using code from old version ... get it sorted and error free now ..
Quote from: tyty1234 on September 27, 2009, 08:26:58 PM
Quote from: aw06 on September 26, 2009, 09:40:56 AM
can original topic starters change subject as well ?
Original topic starters can only change the subject of the OP, thus, changing the subject for all replies that were added after the subject of the OP was changed.
Hmmm, just tested this ... not the case :-[ original topic starters CANT modify subject of the original post :(
Cand everybody can edit via quick/inline edit
Quote from: aw06 on September 27, 2009, 10:02:49 PM
Quote from: tyty1234 on September 27, 2009, 08:26:58 PM
Quote from: aw06 on September 26, 2009, 09:40:56 AM
can original topic starters change subject as well ?
Original topic starters can only change the subject of the OP, thus, changing the subject for all replies that were added after the subject of the OP was changed.
Hmmm, just tested this ... not the case :-[ original topic starters CANT modify subject of the original post :(
Cand everybody can edit via quick/inline edit
Thanks for letting me know. I have released a new version that addresses these issues. :)
Quote from: tyty1234 on September 28, 2009, 02:49:56 AM
Quote from: aw06 on September 27, 2009, 10:02:49 PM
Quote from: tyty1234 on September 27, 2009, 08:26:58 PM
Quote from: aw06 on September 26, 2009, 09:40:56 AM
can original topic starters change subject as well ?
Original topic starters can only change the subject of the OP, thus, changing the subject for all replies that were added after the subject of the OP was changed.
Hmmm, just tested this ... not the case :-[ original topic starters CANT modify subject of the original post :(
Cand everybody can edit via quick/inline edit
Thanks for letting me know. I have released a new version that addresses these issues. :)
Wow .. thanks for the quick update ... do we un-install the 1.3 totally, or this new version will install and overwrite it ?
Are the new chanages only done in Post.template.php and Display.template.php ? can i just go ahead and add those edits manually while still under version 1.3 ?
****sniper edit****Made changes to the files above .. all seems to be working and error free now ... :P
Someone mad a reply to their own topic and this came up as the subject
%subject%
any ideas ??
......................
OK, i see what's happening, when a user uses the inlink/quick edit, when they hit save it changes the subject to %subject% :o
Seems to be related to this part of the codeing
Quotevar smf_template_subject_edit = \'', $modSettings['disableSubjectChange'] ? $context['user']['is_admin'] ? '' : '%subject%' . ' ' : '', '<input type="', $modSettings['disableSubjectChange'] ? $context['user']['is_admin'] ? 'text' : 'hidden' : 'text', '" name="subject" value="%subject%" size="60" style="width: 99%;" maxlength="80" />\';
OK, as a fix i replaced
This Code
Quotevar smf_template_subject_edit = \'', $modSettings['disableSubjectChange'] ? $context['user']['is_admin'] ? '' : '%subject%' . ' ' : '', '<input type="', $modSettings['disableSubjectChange'] ? $context['user']['is_admin'] ? 'text' : 'hidden' : 'text', '" name="subject" value="%subject%" size="60" style="width: 99%;" maxlength="80" />\';
With
Quotevar smf_template_subject_edit = \'', $modSettings['disableSubjectChange'] ? $context['user']['is_admin'] ? '' : '%subject%' . ' ' : '', '<input type="', $modSettings['disableSubjectChange'] ? $context['user']['is_admin'] ? 'text' : 'hidden' : 'text', '" name="subject"', $context['subject'] == '' ? '' : ' value="' . $context['subject'] . '"', ' tabindex="', $context['tabindex']++, '" size="60" style="width: 99%;" maxlength="80" />\';
Error logs are clean ... but i don't know if this is the correct way to fix .. please advise ..
1. It's recommended you uninstall 1.3 before installing 1.4, that way, you don't need to make manual edits unless it was necessary.
2. %subject% is a JavaScript that is replaced using XML I believe. The reason why it's %subject%, is so it gets the subject of the message, not the subject of the topic. (e.g. If the subject of the message was Re: Disable Subject Change, %subject% will be replaced with the "Re: Disable Subject Change". However, if you used $context['subject'], then that will be replaced by "Disable Subject Change", which is what you don't want. I will however find a possible solution, so I will see what I can do with it.
Yup, you are right,,, i just notice what happens when i use the fix i did ..... It puts back the original first post subject ... and not a Re: Subject as you pointed out ...
Hoping you find a fix soon :)
how about trying $context['%subject%'] ???
$context['%subject%'] does not exist and therefore will not work.
Quote from: tyty1234 on September 29, 2009, 12:04:52 AM
$context['%subject%'] does not exist and therefore will not work.
8) ok .. figured as much ... will wait on your fix :)
The latest version (1.4.1) should now address those issues. :)
Quote from: tyty1234 on September 29, 2009, 01:21:04 AM
The latest version (1.4.1) should now address those issues. :)
Very Nice .... i see where you made it not hidden.. but read only :P Super Nice
var smf_template_subject_edit = \'<input readonly="readonly" type="text" name="subject" value="%subject%" size="60" style="width: 99%;" maxlength="80" />\';
Thats the only change you made to the mod right ?
That's correct. It should also allow admins to edit the subject via inline/quick editing, whilst everyone else cannot change the subject. :)
OK thanks 8) I'm still using version 1.3, I just did the edits manually as the only changes are in my custom theme files...
greek-utf8
$txt['disableSubjectChange'] = 'Απενεργοποίησε την αλλαγή τίτλου κατά την απάντηση στα θέματα';]
Will this be updated for RC2?
Yes it will. I will be working on it when I have the time. :)
Updated for RC2. Enjoy! ;D
Does this also remove the annoying "Re:" prefix from the main index page when someone replies to a topic?
With this mod alone, no. You will need to install this mod (http://custom.simplemachines.org/mods/index.php?mod=2172) to remove the prefix. If you're asking if this mod will work with the remove reply prefix mod, it should. :)
Thanks :)
Nice Mod
Please update it for SMF 2.0RC3 ;)
Thanks
1.6 has been released for SMF 2.0 RC3!
I kept the 1.5 package up for users using SMF 1.1.x and SMF 2.0 RC2 since there were minor changes made in 1.6 that makes it different from 1.5, but keeping it working in the same way. In other words, there was a change to the RC3 template that I had to adapt to making it different from RC2.
An even shorter description, all users using SMF 1.1.x or SMF 2.0 RC2, please use version 1.5. All users using SMF 2.0 RC3, please use version 1.6. Thanks! :D
Nice, can you make it work for thread starter as well, we prefer having the staff editing the subjects on request rather than having members editing them.
tyty1234, thanks for the mod...
can you make that moderators able to modify the subject change as well? (other that admin)
Thanks
Any Update to RC4?
Quote from: miftahx on August 09, 2010, 11:58:02 PM
tyty1234, thanks for the mod...
can you make that moderators able to modify the subject change as well? (other that admin)
Thanks
Will try to see if I can find the time to implement the permission in the next update :)
Quote from: GohighVoltage on November 05, 2010, 11:52:41 AM
Any Update to RC4?
I've been away from SMF for a very long time, so if I can find time some time this week, I will work on an update :)
thank you the mod works great
I only have on problem
is some one writes reply
in topic forum list , last reply will not have any subject
like:
...................
Last post by soulwhite
in N/A
on Today at 06:28:38 PM
(http://img189.imageshack.us/img189/7499/32180536.jpg)
nice mod, exactly what i was looking for. any updates on rc4? maybe someone has modified it? i'd really like to use it!
Any update to RC5?
Hey guys,
I want to apologize for not updating the mod periodically and addressing your errors. I've been real busy and it's been so long since I coded for SMF, but with the release of SMF 2.0, the mod will need to be updated. Before I do that however, if you guys would go here (http://www.tytyweb.net/forum/mod-support/disable-subject-change/) to report some bugs or errors that you found in the mod so that I can fix those bugs and errors and the next version of this mod can be bug-free and is working smoothly. I promise that I will do my best to update and fix the mod in a timely manner as I have a little free time on my hands.
Thanks,
tyty1234
Version 2.0 has been released! It supports SMF 2.0, but no longer supports SMF 1.1.x forums. Please refer to the OP for what's new in this version. This mod, along with the other mods that I wrote are also available on my site (http://www.tytyweb.net/forum/mod-support/).
Hi!
Is it possible modify code for SMF 1.1.15:
Quote from: miftahx on August 09, 2010, 11:58:02 PM
...that moderators able to modify the subject change as well? (other that admin)
my test :D Construction:
............$context['is_first_post'] || $context['subject'] == '' || $context['user']['is_admin'] || $context['user']['is_mod'] ? '' :................
does not work :-\
Thanks!
=========================
SOLVED
As of version 2.0 of this mod, I do not provide support for SMF 1.1.x as version 2.0 is not compatible with SMF 1.1.x. Version 1.6 is however compatible with SMF 1.1.x, but you are to use it at your own risk.
Hi Fernando,
That's odd...it should say "RE: Topic Subject" for every reply to a topic. It could be something I missed in the coding...I'll take a look as soon as I can. Thanks for reporting.
Regards,
tyty1234
Oh... you see. I haven't installed your mod yet.
I installed another mod to remove the RE: prefix.
Could you please take a lot to this thread I just created and see if you can help me? I would really appreciate that. It's the only thing I want to do before launching my forum. Thanks!
http://www.simplemachines.org/community/index.php?topic=462282.0
It looks like a Support Specialist is already helping you on your matter. Coordinate with him as he tries to help you out with your situation. :)
=)
No luck... could you help me, please?
=)
He's asking for your Display.template.php file that is found in the Themes folder for that theme you are using. If you attach it to your reply, he will be able to manually edit the file for you and make changes to your liking.
I see!
Thanks for your response. I'm such a newbie.
=)
Well... the problem I had was solved.
But I want to use this mod too. Is there a way to install this mod in SMF 2.0.1?
Does this work in wap2 mode?
Nice mod ! And it works for 2.0.2.
i successfully installed and check option on "admin > Post and Topics > Post settings", and don't work in any theme
my forum is 2.0.4
This breaks quick reply:
// Disable Subject Change Mod.
if (isset($modSettings['disableSubjectChange']))
{
// Check for admin, moderator and first post. Show subject textbox, otherwise, we just won't have it.
if ($modSettings['disableSubjectChange'] == 0 || ($context['user']['is_admin'] || $context['user']['can_mod']))
echo '
sTemplateSubjectEdit: ', JavaScriptEscape('<input type="text" style="width: 90%;" name="subject" value="%subject%" size="80" maxlength="80" tabindex="' . $context['tabindex']++ . '" class="input_text" />'), ',';
}
How can I fix it? This is the closest I've gotten but don't want the blanked out input field, just display like a regular link like in post.template:
// Check for admin, moderator and first post. Show subject textbox, otherwise, we just won't have it.
if ($context['is_first_post'] || $context['user']['is_admin'] || $context['user']['can_mod'])
echo '
sTemplateSubjectEdit: ', JavaScriptEscape('<input type="text" style="width: 90%;" name="subject" value="%subject%" size="80" maxlength="80" tabindex="' . $context['tabindex']++ . '" class="input_text" />'), ',';
}
echo '
sTemplateSubjectEdit: ', JavaScriptEscape('<input type="text" style="width: 90%;" name="subject" value="%subject%" size="80" maxlength="80" tabindex="' . $context['tabindex']++ . '" class="input_text" disabled />'), ',
EDIT: Well this works but as you click quick edit the subject disappears but it saves fine and the Re: subject comes back after saving.
// Check for admin, moderator and first post. Show subject textbox, otherwise, we just won't have it.
if ($context['is_first_post'] || $context['user']['is_admin'] || $context['user']['can_mod'])
echo '
sTemplateSubjectEdit: ', JavaScriptEscape('<input type="text" style="width: 90%;" name="subject" value="%subject%" size="80" maxlength="80" tabindex="' . $context['tabindex']++ . '" class="input_text" />'), ',';
}
echo '
sTemplateSubjectEdit: ', JavaScriptEscape('<a href="' . $scripturl . '?topic=' . $context['current_topic'] . '.msg%msg_id%#msg%msg_id%" rel="nofollow"></a><input type="hidden" style="width: 90%;" name="subject" value="%subject%" size="80" maxlength="80" tabindex="' . $context['tabindex']++ . '" class="input_text" disabled />'), ',
sTemplateBodyNormal: ', JavaScriptEscape('%body%'), ',
sTemplateSubjectNormal: ', JavaScriptEscape('<a href="' . $scripturl . '?topic=' . $context['current_topic'] . '.msg%msg_id%#msg%msg_id%" rel="nofollow">%subject%</a>'), ',
sTemplateTopSubject: ', JavaScriptEscape($txt['topic'] . ': %subject% '), ',
sErrorBorderStyle: ', JavaScriptEscape('1px solid red'), '
});
Not sure what to put within the anchor
<a href="' . $scripturl . '?topic=' . $context['current_topic'] . '.msg%msg_id%#msg%msg_id%" rel="nofollow"></a>
Have tried %subject% but that will change it to %subject% on saving. Also tried ', $message['subject'], ' but no luck.
It would be great to have it updated for latest SMF versions.
I don't know why SMF does not support this by default.
Quote from: SirLouen on February 01, 2017, 08:28:41 AMI don't know why SMF does not support this by default.
Probably because in the four years or so I've been coming here you're the first person I remember asking for such a feature. Just a guess on my part though.
I use this mod which has become one of my top two or three favorites: http://custom.simplemachines.org/mods/index.php?mod=3167
While it doesn't do want you want until or unless this one is updated, it does allow you to change the subject title of all posts in two clicks.
Quote from: SirLouen on February 01, 2017, 08:28:41 AM
It would be great to have it updated for latest SMF versions.
I don't know why SMF does not support this by default.
I second this, would be great if it would be a setting in SMF itself to change all topics for admins/mods and lock it for users.
And it's a pity that this mod doesn't work anymore, it doesn't parse for 2.0.15 at all.
Not parsing doesn't mean it won't work. And there's always emulation.
@ Steve: you were absolutely right.
Just installed it on 2.0.15 with emulation for 2.0 and it works as advertised.
'Normal' members now see the subject, but without an option to edit it.
Exactly what I wanted!