News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

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

faeriedust



Chas Large

@faeriedust, look in

Forum/Themes/default/languages and you'll find index.english.php

Upload it here and I'll check it for you.
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.

Robert.


faeriedust

Quote from: Chas Large on November 04, 2010, 11:20:04 AM
@faeriedust, look in

Forum/Themes/default/languages and you'll find index.english.php

Upload it here and I'll check it for you.


Chas, I go into themes & layout, modify themes, but there is no "default" theme listed, just the regular name of each theme.
When I look under themes & settings, the default directory shows up but that doesn't help me with modifying the language file.
This is why I'm so confused.

Chas Large

Quote from: faeriedust on November 04, 2010, 05:26:56 PM
Quote from: Chas Large on November 04, 2010, 11:20:04 AM
@faeriedust, look in

Forum/Themes/default/languages and you'll find index.english.php

Upload it here and I'll check it for you.


Chas, I go into themes & layout, modify themes, but there is no "default" theme listed, just the regular name of each theme.
When I look under themes & settings, the default directory shows up but that doesn't help me with modifying the language file.
This is why I'm so confused.
So there is no theme named SMF Default Theme - Curve (2.0 RC3) ?

If not then your default theme must have been renamed something else. What theme is used by non-logged in members? this will be your default theme.

If possible, it may be easier to access the site via FTP (Filezilla, CuteFTP etc), this should show the Directory structure as I mentioned above and allow access to the files for downloading and editing.
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.

Oya

probably because it won't let you actually go into modify themes for the default theme to prevent you breaking things...

if you're using 2.0... there's a built in language editor! (which should be used instead!!!!)

faeriedust

I'm using 1.1.12 but I don't see what that would have to do with modifying the default theme. Perhaps 2.0 is set up differently.

Oya

nope

you can't modify the default theme's files from the admin panel because every theme implicitly relies on the default theme, so editing the default theme is not allowed through the admin panel

faeriedust

Okay, then what you're saying is that I can't modify the default theme from admin, right? If that's so, then how does every one else do it? According to Chas, it should be listed in the "modify themes" section with all the other themes but it's not.

Oya

no, you can't modify it from admin, you have to copy it to a new theme to be able to modify it and even then that won't be the language files

if you want to edit those you will have to do so via ftp

Chas Large

Quote from: Oya on November 05, 2010, 12:40:08 PM
no, you can't modify it from admin, you have to copy it to a new theme to be able to modify it and even then that won't be the language files

if you want to edit those you will have to do so via ftp
Not strictly true. In SMF 2.0 you can edit the files in the default theme. Admin > Themes & Layout > Modify Themes > then click on Browse the templates and files in this theme. This option is available for all installed themes including the default. It give a tree of directories. Click on languages gives the files listed inside. Click the file and it opens in the internal editor.

However you are correct in that you cannot edit the default theme's files in 1.x.x You can in fact only edit the CSS and Template files and then only for the extra themes installed by the Admin, the default, classic and babylon files cannot be edited either.

@faeriedust You will need to edit them off site and upload via FTP.
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.

Advertisement: