Simple Machines Community Forum

SMF Development => Feature Requests => Applied or Declined Requests => Topic started by: Adrek on July 11, 2012, 01:26:44 PM

Title: Require to add subject in PM
Post by: Adrek on July 11, 2012, 01:26:44 PM
Why in Private messages subject is not required? By default it has (No subject) title.
Now if someone writes new PM, he takes time to explain everything in it, and doesn't have time to change subject? I don't even read those messages...

I think that subject in PM should be required, without default content.
It is the same if I would add in this topic (No subject). Would you even open it?

I know that I would just scroll down to next topic... but it's just me ::)
Title: Re: Require to add subject in PM
Post by: emanuele on July 11, 2012, 02:54:51 PM
Don't tell anyone, but a mean dev (unfortunately not me) removed the "(no subject)" from 2.1 a while ago! Shhh!!
Title: Re: Require to add subject in PM
Post by: MadTogger on October 30, 2012, 05:51:12 PM
Quote from: phantomm on July 11, 2012, 01:26:44 PM
Why in Private messages subject is not required? By default it has (No subject) title.
Now if someone writes new PM, he takes time to explain everything in it, and doesn't have time to change subject? I don't even read those messages...

I think that subject in PM should be required, without default content.
It is the same if I would add in this topic (No subject). Would you even open it?

I know that I would just scroll down to next topic... but it's just me ::)

Hi,

I didn't like the way that Private Messages could be posted without a subject apart from the default (no subject).

Here's my solution.

Find the file PersonalMessage.php.

FIND
$subject['subject'] = $subject['subject'] == '' ? $txt['no_subject'] : $subject['subject'];

REPLACE WITH
//$subject['subject'] = $subject['subject'] == '' ? $txt['no_subject'] : $subject['subject'];

FIND
$message['subject'] = $message['subject'] == '' ? $txt['no_subject'] : $message['subject'];

REPLACE WITH
//$message['subject'] = $message['subject'] == '' ? $txt['no_subject'] : $message['subject'];

FIND
$row['subject'] = $row['subject'] == '' ? $txt['no_subject'] : $row['subject'];

REPLACE WITH
//$row['subject'] = $row['subject'] == '' ? $txt['no_subject'] : $row['subject'];

FIND
$context['subject'] = $form_subject != '' ? $form_subject : $txt['no_subject'];

REPLACE WITH
//$context['subject'] = $form_subject != '' ? $form_subject : $txt['no_subject'];

There is probably an easier and tidier way to do this but it seems to work.


Regards..,
Title: Re: Require to add subject in PM
Post by: MadTogger on October 31, 2012, 07:52:28 AM
Forget what I posted above, I have come up with a much simpler way to achieve the same result.

in Themes/default/languages find the file index.english.php, or the same for your own set language.

FIND
$txt['no_subject'] = '(No subject)';

REPLACE WITH
$txt['no_subject'] = '';

Now the subject field is not populated with any text as standard and the software checks for a valid subject upon hitting the Preview or Post button.

Regards..,
Title: Re: Require to add subject in PM
Post by: Oldiesmann on October 31, 2012, 04:38:40 PM
There's just one minor problem with that. If you don't have the PM view set to "all at once", then there will be nothing to click on in your inbox to actually view that message once it isn't the most recent one.
Title: Re: Require to add subject in PM
Post by: MadTogger on November 01, 2012, 04:44:03 AM
Quote from: Oldiesmann on October 31, 2012, 04:38:40 PM
There's just one minor problem with that. If you don't have the PM view set to "all at once", then there will be nothing to click on in your inbox to actually view that message once it isn't the most recent one.


Sorry, I don't quite know what you mean by nothing to click on.

All I did was remove the standard (no subject) text from appearing in the subject field.

When there is no text in the subject field it is impossible to post or preview a message, so the sender has to enter their own subject, the software tells you there is an error.

Surely this process is just the same as the user having to first delete the (no subject) text and then type in their own subject text, or maybe I am losing the plot.

Regards..,