Signature setting default on for OP and off for replies

Need some custom code changes to the phpBB core simple enough that you feel doesn't require an extension? Then post your request here so that community members can provide some assistance.

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Bozworth
Registered User
Posts: 2
Joined: Sun Jul 21, 2024 5:27 pm

Signature setting default on for OP and off for replies

Post by Bozworth »

Is there a way to set the signature default to ON for the original poster and default OFF for people replying? I don't want to disable it entirely, but leave the check box available for the people replying if they want to apply their signature.
Last edited by thecoalman on Mon Jul 22, 2024 2:02 pm, edited 1 time in total.
User avatar
warmweer
Jr. Extension Validator
Posts: 11660
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Bel ... gium

Re: Signature setting default on for OP and off for replies

Post by warmweer »

There's no native way (that I know) to do that.
Your best bet is to request an extension.
Spelling is freeware, which means you can use it for free.
On the other hand, it is not open source, which means you cannot change it or publish it in a modified form.


Time flies like an arrow, but fruit flies like a banana.
User avatar
Brf
Support Team Member
Support Team Member
Posts: 53525
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}

Re: Signature setting default on for OP and off for replies

Post by Brf »

Wasn't there an extension that only showed each signature once per page? That might work too.
User avatar
thecoalman
Community Team Member
Community Team Member
Posts: 6309
Joined: Wed Dec 22, 2004 3:52 am
Location: Pennsylvania, U.S.A.

Re: Signature setting default on for OP and off for replies

Post by thecoalman »

This can be done with fairly simple edit, report the post if you want it moved to custom coding.
“Results! Why, man, I have gotten a lot of results! I have found several thousand things that won’t work.”

Attributed - Thomas Edison
User avatar
thecoalman
Community Team Member
Community Team Member
Posts: 6309
Joined: Wed Dec 22, 2004 3:52 am
Location: Pennsylvania, U.S.A.

Re: Signature setting default on for OP and off for replies

Post by thecoalman »

This is untested. On line 1970 of posting.php find:

Code: Select all

	'S_SIGNATURE_CHECKED'		=> ($sig_checked) ? ' checked="checked"' : '',
Replace with:

Code: Select all

	'S_SIGNATURE_CHECKED'		=> ($sig_checked  && ($mode == 'post' || ($mode == 'edit' && $post_id == $post_data['topic_first_post_id']))) ? ' checked="checked"' : '',

On line 159 of language/en/ucp.php find

Code: Select all

	'DEFAULT_ADD_SIG'			=> 'Attach my signature by default',
Replace with:

Code: Select all

	'DEFAULT_ADD_SIG'			=> 'Attach my signature by default to new topics',

If you are using different language files you will need to make edits to them instead. As I said untested but should work.
“Results! Why, man, I have gotten a lot of results! I have found several thousand things that won’t work.”

Attributed - Thomas Edison
User avatar
AmigoJack
Registered User
Posts: 6120
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン

Re: Signature setting default on for OP and off for replies

Post by AmigoJack »

That solution would need merged and split topics to take manual care to set/remove signatures, as then you have multiple or none "OP"s in one topic.
  • "The problem is probably not my English but you do not want to understand correctly. ... We will not come anybody anyway, nevertheless, it's best to shit this." Affin, 2018-11-20
  • "But this shit is not here for you. You can follow with your. Maybe the question, instead, was for you, who know, so you shoved us how you are." axe70, 2020-10-10
  • "My reaction is not to everyone, especially to you." Raptiye, 2021-02-28
Bozworth
Registered User
Posts: 2
Joined: Sun Jul 21, 2024 5:27 pm

Re: Signature setting default on for OP and off for replies

Post by Bozworth »

thecoalman wrote: Mon Jul 22, 2024 2:42 pm This is untested. On line 1970 of posting.php find:

Code: Select all

	'S_SIGNATURE_CHECKED'		=> ($sig_checked) ? ' checked="checked"' : '',
Replace with:

Code: Select all

	'S_SIGNATURE_CHECKED'		=> ($sig_checked  && ($mode == 'post' || ($mode == 'edit' && $post_id == $post_data['topic_first_post_id']))) ? ' checked="checked"' : '',
this worked perfectly, thank you!

edit: FYI the line number 1970 didn't match up, but i searched for S_SIGNATURE_CHECKED and found it around 1948 i think it was
User avatar
warmweer
Jr. Extension Validator
Posts: 11660
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Bel ... gium

Re: Signature setting default on for OP and off for replies

Post by warmweer »

Bozworth wrote: Mon Jul 22, 2024 6:34 pm edit: FYI the line number 1970 didn't match up, but i searched for S_SIGNATURE_CHECKED and found it around 1948 i think it was
line 1970 is for phpBB 3.3.12

phpBB 3.3.11 > line 1949

The line numbers for language/en/ucp.php may also not match if your using a different phpBB version.
Spelling is freeware, which means you can use it for free.
On the other hand, it is not open source, which means you cannot change it or publish it in a modified form.


Time flies like an arrow, but fruit flies like a banana.

Return to “phpBB Custom Coding”