MyBB Community Forums

Full Version: rename No Prefix and show post icons on main index page
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hey guys,

Can we rename No Prefix and its error message field? Also Can we Rename Thread Subject: to City: and add the text field below Thread Subject: named Title: infront of empty Subject text field.

[Image: 906d2eca99.png]

I want this to look like this:
[Image: f649588af4.jpg]

Furthermore, is it possible to show post icons on main index page before Subject and on Latest Threads:
[Image: 393f68e635.jpg]

I want this to look like this:
[Image: 66cd05f800.png]

Regards.
Can anyone help me on this?
You can consider changing language file entries if the change is intended to be global, i.e. all forums require a thread prefix. If it is only for the one forum and not others, then additional coding changes must be made. Whether as a plugin or core edits, it's more complicated. But not impossible.

On a linux machine, grep is useful for finding the entry.

~/Downloads/mybb_1834/Upload$ grep -r "No prefix"
inc/languages/english/search.lang.php:$l['no_prefix'] = "No prefix";

~/Downloads/mybb_1834/Upload$ grep -r "requires a thread prefix"
inc/languages/english/datahandler_post.lang.php:$l['postdata_require_prefix'] = 'This forum requires a thread prefix to be set. Please select a valid prefix.';

~/Downloads/mybb_1834/Upload$ grep -r "Thread Subject:"
inc/languages/english/newthread.lang.php:$l['thread_subject'] = "Thread Subject:";

The rest involves template changes.
If you have set the forums , new thread required prefix with intention then it's okay to get that error . if not then off that required option through forum settings
For the "Title" in the textbox, in the theme template newthread, find the line similar to this one in Default template and add placeholder="Title"

<td class="trow2">{$prefixselect}<input type="text" class="textbox" placeholder="Title" name="subject" size="40" maxlength="85" value="{$subject}" tabindex="1" /></td>
(2023-07-25, 10:56 AM)HLFadmin Wrote: [ -> ]You can consider changing language file entries if the change is intended to be global, i.e. all forums require a thread prefix. If it is only for the one forum and not others, then additional coding changes must be made. Whether as a plugin or core edits, it's more complicated. But not impossible.

On a linux machine, grep is useful for finding the entry.

~/Downloads/mybb_1834/Upload$ grep -r "No prefix"
inc/languages/english/search.lang.php:$l['no_prefix'] = "No prefix";

~/Downloads/mybb_1834/Upload$ grep -r "requires a thread prefix"
inc/languages/english/datahandler_post.lang.php:$l['postdata_require_prefix'] = 'This forum requires a thread prefix to be set. Please select a valid prefix.';

~/Downloads/mybb_1834/Upload$ grep -r "Thread Subject:"
inc/languages/english/newthread.lang.php:$l['thread_subject'] = "Thread Subject:";

The rest involves template changes.

I am using Thread Prefix on only 1 Forum where I want to rename No Prefix to Select City. Moreover, I want to edit the Error messages like to Select the City, Write the Title.

Finding on template is very hard and I have tried alot aswell.
(2023-07-25, 11:16 AM)PARADOX987 Wrote: [ -> ]If you have set the forumsĀ  , new thread required prefix with intention then it's okay to get that error . if not then off that required option through forum settings

(2023-07-25, 11:26 AM)HLFadmin Wrote: [ -> ]For the "Title" in the textbox, in the theme template newthread, find the line similar to this one in Default template and add placeholder="Title"

<td class="trow2">{$prefixselect}<input type="text" class="textbox" placeholder="Title" name="subject" size="40" maxlength="85" value="{$subject}" tabindex="1" /></td>

Great. I just want to have that line code and I will add the Placeholder right away.

(2023-07-25, 10:56 AM)HLFadmin Wrote: [ -> ]You can consider changing language file entries if the change is intended to be global, i.e. all forums require a thread prefix. If it is only for the one forum and not others, then additional coding changes must be made. Whether as a plugin or core edits, it's more complicated. But not impossible.

On a linux machine, grep is useful for finding the entry.

~/Downloads/mybb_1834/Upload$ grep -r "No prefix"
inc/languages/english/search.lang.php:$l['no_prefix'] = "No prefix";

~/Downloads/mybb_1834/Upload$ grep -r "requires a thread prefix"
inc/languages/english/datahandler_post.lang.php:$l['postdata_require_prefix'] = 'This forum requires a thread prefix to be set. Please select a valid prefix.';

~/Downloads/mybb_1834/Upload$ grep -r "Thread Subject:"
inc/languages/english/newthread.lang.php:$l['thread_subject'] = "Thread Subject:";

The rest involves template changes.

Fixed. Only No Prefix is not changing.

[Image: 7e4643cf7a.png]
Hmm. My grep search was case sensitive. This one shows desired results. Edit as necessary.

~/Downloads/mybb_1834/Upload$ grep -r "No Prefix"
inc/languages/english/admin/config_mod_tools.lang.php:$l['no_prefix'] = "No Prefix";
inc/languages/english/newthread.lang.php:$l['no_prefix'] = "No Prefix";
inc/languages/english/editpost.lang.php:$l['no_prefix'] = "No Prefix";
inc/languages/english/forumdisplay.lang.php:$l['prefix_all'] = "Prefix: Any/No Prefix";
inc/languages/english/forumdisplay.lang.php:$l['prefix_none'] = "Prefix: No Prefix";
(2023-07-25, 04:43 PM)HLFadmin Wrote: [ -> ]Hmm. My grep search was case sensitive. This one shows desired results. Edit as necessary.

~/Downloads/mybb_1834/Upload$ grep -r "No Prefix"
inc/languages/english/admin/config_mod_tools.lang.php:$l['no_prefix'] = "No Prefix";
inc/languages/english/newthread.lang.php:$l['no_prefix'] = "No Prefix";
inc/languages/english/editpost.lang.php:$l['no_prefix'] = "No Prefix";
inc/languages/english/forumdisplay.lang.php:$l['prefix_all'] = "Prefix: Any/No Prefix";
inc/languages/english/forumdisplay.lang.php:$l['prefix_none'] = "Prefix: No Prefix";

Fixed. Can you tell me how to change it for lifetime if mybb update cames than it will revert back to default.

Moreover, do you know on which code to put {$posticons} to show like this:
[Image: 687474703a2f2f7075752e73682f4a4d6145622f...302e706e67]
Always make notes of what you have customized, so you can restore again in the event of an update which usually brings additions to language strings.

You are using a custom theme, so I can't answer your question directly, but if you use browser tools to identify components in your theme you wish to modify, you will be able to pinpoint where in the page source that component occurs.

If you have template tags enabled, you will be able to see what template a particular element is called in.

An example:

[attachment=46186]
(2023-07-26, 11:16 AM)HLFadmin Wrote: [ -> ]Always make notes of what you have customized, so you can restore again in the event of an update which usually brings additions to language strings.

You are using a custom theme, so I can't answer your question directly, but if you use browser tools to identify components in your theme you wish to modify, you will be able to pinpoint where in the page source that component occurs.

If you have template tags enabled, you will be able to see what template a particular element is called in.

An example:

Notes wont be updated ? You mean comments on html or php ?

Moreover, I know how to use inspect but I cant find the specific html or page where to add or edit the code.
Pages: 1 2