News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Remove (no subject) from Personal Messages

Started by Chas Large, September 17, 2009, 12:53:47 PM

Previous topic - Next topic

Chas Large

Are your members lazy? mine are. Having loads of PMs with (no subject) was a problem. Being the Admin and "teccy" I was continually getting messages with (no subject) but asking specific questions. Trying to find them later to answer or quote was proving very difficult.

So I decided I needed to force my members to input a subject line. If you delete the default (no subject) and try and send the PM you get an error so all that was needed was to remove the default text.

I found this was stored in the variable $txt[24] in the Themes\default\languages\index.english.php file. So I changed it from:

$txt[24] = '(no subject) ';

to

$txt[24] = ' ';    Ensuring you have at least ONE space between the ' '

Now they have to put a subject in when they create the message.

Hope this is of use and may be suitable for Tips and Tricks?

Note to Admin: Please move to Tips and Tricks if you think it suitable.
My Modifications :)  My Forum

Please DO NOT PM me with support requests. Post the problem in the appropriate Support Board so everyone can benefit from the advice given.

Arantor

The equivalent in 2.0 would be $txt['no_subject'].

Word of advice with this: there are instances where this can be displayed elsewhere, though it is far from common.

Chas Large

Quote from: Arantor on September 20, 2009, 12:36:28 PM
The equivalent in 2.0 would be $txt['no_subject'].

Word of advice with this: there are instances where this can be displayed elsewhere, though it is far from common.
Sorry Arantor, I don't understand. What can be displayed elsewhere? The phrase "No Subject", the variable or this post  ???
My Modifications :)  My Forum

Please DO NOT PM me with support requests. Post the problem in the appropriate Support Board so everyone can benefit from the advice given.

Arantor

There are instances where the string (no subject) comes up elsewhere in the forum, which feeds on $txt['no_subject'] (or $txt[24]), so while it does work to do this, it isn't always recommended.

For example: in the event of a thread's title being deleted by a moderator, normally (no subject) would be substituted in.

Chas Large

#4
Quote from: Arantor on September 21, 2009, 03:20:48 PM
There are instances where the string (no subject) comes up elsewhere in the forum, which feeds on $txt['no_subject'] (or $txt[24]), so while it does work to do this, it isn't always recommended.

For example: in the event of a thread's title being deleted by a moderator, normally (no subject) would be substituted in.
Aha! Thanks, hadn't realised that, I'll warn the mods. Might revisit this and create a new variable to hold "No Subject" for other areas.

[Edit] Just checked this out. If a topic is created without a subject or a topics subject is deleted as you suggested, then the error message "No Subject was filled in" is shown like it does in personal messages posted without a subject. So in a way, removing the default is good here too as it forces the user to put one in. Seems the tip has even more benefits than I thought :)
My Modifications :)  My Forum

Please DO NOT PM me with support requests. Post the problem in the appropriate Support Board so everyone can benefit from the advice given.

Arantor

That error is actually the standard error for doing that, but there are times when it can happen - though it's not normal practice.

qtime


supahben


johnnynine

Thanks, although I wish though could be done without modifying the source code.

Samker

Samker's Computer Forum - SCforum.info

Antechinus

Quote from: johnnynine on June 27, 2010, 11:27:28 PM
Thanks, although I wish though could be done without modifying the source code.
In 2.0 you can edit language strings in admin so it's hardly a big deal. Of course if you were crazy you could write a mod for this but it really would be a total waste of time.

Nice tip anyway. I might use it.

Chas Large

Quote from: Antechinus on July 02, 2010, 05:14:18 AM
Quote from: johnnynine on June 27, 2010, 11:27:28 PM
Thanks, although I wish though could be done without modifying the source code.
In 2.0 you can edit language strings in admin so it's hardly a big deal. Of course if you were crazy you could write a mod for this but it really would be a total waste of time.

Nice tip anyway. I might use it.
Indeed you can and for those not too familiar with doing so, here's how.
Admin > Configuration > Themes and Layout > Modify Themes.
Under SMF default theme, click the link "Browse the templates and files in this theme."
Click "Languages" (directory icon)
Click "Index.english.php or whatever language file you're using. This will open in the built in editor.
Search for $txt['no_subject'] = 'No Subject'; and edit it accordingly
Click the SAVE CHANGES button.
All done :)

My Modifications :)  My Forum

Please DO NOT PM me with support requests. Post the problem in the appropriate Support Board so everyone can benefit from the advice given.

Joker™

Quote from: Chas Large on July 05, 2010, 02:29:15 AM
Indeed you can and for those not too familiar with doing so, here's how.
Admin > Configuration > Themes and Layout > Modify Themes.
Under SMF default theme, click the link "Browse the templates and files in this theme."
Click "Languages" (directory icon)
Click "Index.english.php or whatever language file you're using. This will open in the built in editor.
Search for $txt['no_subject'] = 'No Subject'; and edit it accordingly
Click the SAVE CHANGES button.
All done :)

you can done it via

* My Community »* Administration Center »* Languages »* Edit Languages(click on english if you want to edit it)

Edit Language Entries  << (in it choose general strings)

Find (No subject) in it and edit it by simply replace the test there with a space ;)

Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

lucas-ruroken

#13
For diferentes languages?

You can add that:
Search:
$txt['no_subject'] = 'Something/algo';

and replace with
$txt['no_subject'] = '';

;)
Adk Portal 3.1 is coming....

Design your universe!

Idiotji

Not working in mine case i change the name (no subject) to (welcome) but still by default no subject comes???
http://tekloverz.com
This Time Every Thing Is Customized

lucas-ruroken

are you using SMF2?

If so... delete the content of the cache folder ;)
Adk Portal 3.1 is coming....

Design your universe!

marwan

Quote from: lucas-ruroken on July 06, 2010, 06:25:10 PM
For diferentes languages?

You can add that:
Search:
$txt['no_subject'] = 'Something/algo';

and replace with
$txt['no_subject']

;)
Great tip! So in one- English languages I should remove the equal mark and whatever is after it?

hsimpson

I'm in no condition to drive...wait! I shouldn't listen to myself, I'm drunk!

faeriedust

Quote from: Chas Large on July 05, 2010, 02:29:15 AM
Quote from: Antechinus on July 02, 2010, 05:14:18 AM
Quote from: johnnynine on June 27, 2010, 11:27:28 PM
Thanks, although I wish though could be done without modifying the source code.
In 2.0 you can edit language strings in admin so it's hardly a big deal. Of course if you were crazy you could write a mod for this but it really would be a total waste of time.

Nice tip anyway. I might use it.
Indeed you can and for those not too familiar with doing so, here's how.
Admin > Configuration > Themes and Layout > Modify Themes.
Under SMF default theme, click the link "Browse the templates and files in this theme."
Click "Languages" (directory icon)
Click "Index.english.php or whatever language file you're using. This will open in the built in editor.
Search for $txt['no_subject'] = 'No Subject'; and edit it accordingly
Click the SAVE CHANGES button.
All done :)

I've been trying to accomplish this but I'm having a problem. After I click on languages, it gives me settings.english.php but there is no $txt['no_subject'] anywhere in there. This is what I have in that file:

<?php
// Version: 1.1; Settings

$txt['theme_thumbnail_href'] = $settings['images_url'] . '/thumbnail.gif';
$txt['theme_description'] = 'The classic look that introduced the groundbreaking PHP/MySQL port of YaBB and distinguished it through two years of development until its rebirth as SMF.<br /><br />Author: <i><a href="mailto:[email protected]">The YaBB SE Team</a></i>.';

?>

How or where would I insert the "no subject" part? (Sorry, I'm a neophite)
I'm using 1.1.11

Oya

you won't find it in settings.english.php, the instructions say index.english.php...

Advertisement: