2019-10-24, 06:08 AM
2019-10-24, 08:27 AM
I don't think you can easily. The showthread template is a composition of Post Bit Templates containing post date/time.
With some modification you may can grab the "lastpost_date" used in Forum Bit Template.
By editing the hard coded PHP, it is possible to read the last post date/time and make it available as variable for templates.
[ExiTuS]
With some modification you may can grab the "lastpost_date" used in Forum Bit Template.
By editing the hard coded PHP, it is possible to read the last post date/time and make it available as variable for templates.
[ExiTuS]
2019-10-24, 08:37 AM
(2019-10-24, 08:27 AM)[ExiTuS] Wrote: [ -> ]I don't think you can easily. The showthread template is a composition of Post Bit Templates containing post date/time.
With some modification you may can grab the "lastpost_date" used in Forum Bit Template.
By editing the hard coded PHP, it is possible to read the last post date/time and make it available as variable for templates.
[ExiTuS]
I've never really done hard coding with PHP, but I feel like maybe something like this is something I *possibly* can take on my own. I tried adding the following variable
{$lastpost_date}
to the template, but it unfortunately was not a solution.If I were to hard code this to make it available as a variable, which file should I be working in, and would it be custom code, or basically swapping some code over from another file, and making the changes in that code?
2019-10-24, 09:36 AM
Here you go!
Edit showthread.php (1.8.21)
Add the following line anywhere below(!) line 65. A good location is empty line 96:
Drop this variable wherever you want to your showthread[_*] templates:
{$thread_lastpost_date}
That's it
[ExiTuS]
Edit showthread.php (1.8.21)
Add the following line anywhere below(!) line 65. A good location is empty line 96:
$thread_lastpost_date = my_date('relative', $thread['lastpost']);
This will just create a new variable with the relative date format. You can rename it for sure.Drop this variable wherever you want to your showthread[_*] templates:
{$thread_lastpost_date}
That's it
[ExiTuS]
2019-10-24, 10:02 AM
(2019-10-24, 09:36 AM)[ExiTuS] Wrote: [ -> ]Here you go!
Edit showthread.php (1.8.21)
Add the following line anywhere below(!) line 65. A good location is empty line 96:
This will just create a new variable with the relative date format. You can rename it for sure.$thread_lastpost_date = my_date('relative', $thread['lastpost']);
Drop this variable wherever you want to your showthread[_*] templates:
{$thread_lastpost_date}
That's it
[ExiTuS]
Incredible! Thank you!
2019-10-24, 10:39 AM
Make notes to document changes you make. You will need to do them again when you upgrade forum. There's a plugin somewhere that helps, called Patches. I haven't used it myself, but I've seen references to it here and there.
2019-10-24, 10:41 AM
(2019-10-24, 10:39 AM)HLFadmin Wrote: [ -> ]Make notes to document changes you make. You will need to do them again when you upgrade forum. There's a plugin somewhere that helps, called Patches. I haven't used it myself, but I've seen references to it here and there.
Thank you for this note. I will definitely need to put this down then for future upgrades and I will look into this Patches plugin as well. It sounds useful
2019-10-24, 11:49 AM
1. Yes, keep all changes in mind
For documentation purpose I used to write down all changes to the Administrator Notepad in ACP in addition.
2. When editing PHP core files, try to find empty space/lines for new code to avoid unnecessary line breaks. That makes you keep safe to reference on line numbers.
[ExiTuS]
For documentation purpose I used to write down all changes to the Administrator Notepad in ACP in addition.
2. When editing PHP core files, try to find empty space/lines for new code to avoid unnecessary line breaks. That makes you keep safe to reference on line numbers.
[ExiTuS]