MyBB Community Forums

Full Version: What is subject_extra in postbit template ?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hi, I work actually on my own theme, and I modify the postbit template. I have the variable

$post['subject_extra']

but I don't know what its supposed displayed and I don't find anything in showthread.php to understand it.

Anyone know what is this variable ?

Thanks
I think it's something left over from earlier versions, and no longer used.

Results of
grep -rnw ./ -e "subject_extra"
from the distribution source code files shows it is referenced only 4 times, and none of them show it is assigned any value.

./private.php:1166: eval("\$pm['subject_extra'] = \"".$templates->get("private_read_to")."\";");
./install/resources/mybb_theme.xml:9642: {$post['subject_extra']}
./install/resources/mybb_theme.xml:9714: {$post['subject_extra']}
./inc/functions_post.php:28: foreach(array('pid', 'aid', 'pmid', 'posturl', 'button_multiquote', 'subject_extra', 'attachments', 'button_rep', 'button_warn', 'button_purgespammer', 'button_pm', 'button_reply_pm', 'button_replyall_pm', 'button_forward_pm', 'button_delete_pm', 'replink', 'warninglevel') as $post_field)
Thanks for your answer, strange to don't remove an unused variable
(2021-06-12, 11:26 AM)LuFo Wrote: [ -> ]Thanks for your answer, strange to don't remove an unused variable

From @HLFadmin's post above, it looks like this var is used in private messages as an indicator for a private message's status, forwarded, replied to, etc.
Ok thanks, I test that
Oops. noyle is right.
It is used in the postbit display when showing PMs.

I didn't read the code correctly. It is apparently only used in the one place.
ok thanks for your help guys Smile
(2021-06-12, 12:13 PM)HLFadmin Wrote: [ -> ]Oops. noyle is right.
It is used in the postbit display when showing PMs.

I didn't read the code correctly. It is apparently only used in the one place.

Hmm, seems I was wrong. The variable was supposed to be displaying recipients a PM was sent to.

Further, although PM has this var, it seems that it doesn't use it in any template (Please see @HLFadmin's reply). Meanwhile, a post doesn't have this var, but it was used in some templates. So, I guess @LuFo's saying also makes sense, it should be fixed.

By the way, posts, PMs, announcements and previews all use a single build_postbit() function for displaying their message.
(2021-06-12, 01:07 PM)noyle Wrote: [ -> ]Hmm, seems I was wrong. The variable was supposed to be displaying recipients a PM was sent to.

Further, although PM has this var, it seems that it doesn't use it in any template. Meanwhile, a post doesn't have this var, but it was used in some templates. So, I guess @LuFo's saying also makes sense, it should be fixed.

By the way, posts, PMs, announcements and previews all use a single build_postbit() function for displaying their message.

Yes actually in pm the recipients are displayed with "{$to_recipients}" in template "private_read_to", so "subject_extra" its no more used ?
I haven't checked the code for this yet but if I remember correctly does it not relate to

[Image: 54e05976f442e2e0456737a8192164b1.png]
Pages: 1 2