MyBB Community Forums

Full Version: How could this be done?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
i want the first to have the date and time of creation and the second the date and time of the last creation!

can anyone help me?


[Image: w8mNzZe.png]
My Code forumdisplay_thread
<tr class="inline_row">
	<td align="center" class="{$bgcolor}{$thread_type_class}" width="1%"><span class="thread_status {$folder}" title="{$folder_label}">&nbsp;</span></td>
	<td align="center" class="{$bgcolor}{$thread_type_class}" width="1%"></td>
	<td class="{$bgcolor}{$thread_type_class}">
		{$attachment_count}
		<div>
          <span>{$prefix} {$gotounread}{$thread['threadprefix']}<span class="{$inline_edit_class} {$new_class}" id="tid_{$inline_edit_tid}"><a href="{$thread['threadlink']}">{$stprf}{$clprf}{$clclr}{$stclr}{$str1}{$stprf}{$clprf}{$clclr}{$stclr}{$str1}{$stprf}{$clprf}{$clclr}{$stclr}{$str1}{$stprf}{$clprf}{$clclr}{$stclr}{$str1}{$stprf}{$clprf}{$clclr}{$stclr}{$str1}{$thread['subject']}{$str2}{$stimg}{$clclr2}{$stclr2}{$climg}{$str2}{$stimg}{$clclr2}{$stclr2}{$climg}{$str2}{$stimg}{$clclr2}{$stclr2}{$climg}{$str2}{$stimg}{$clclr2}{$stclr2}{$climg}{$str2}{$stimg}{$clclr2}{$stclr2}{$climg}</a></span>{$thread['multipage']}</span>
			<div class="author smalltext"><span style="font: 12px verdana;">{$thread['profilelink']},
				{$lastpostdate}</div></span>
		</div>
	</td>
	<td align="center" class="{$bgcolor}{$thread_type_class}"><a href="{$mybb->settings['bburl']}/misc.php?action=whoposted&tid={$thread['tid']}" onclick="MyBB.whoPosted({$thread['tid']}); return false;">{$thread['replies']}</a>{$unapproved_posts}</td>
	<td align="center" class="{$bgcolor}{$thread_type_class}">{$thread['views']}</td>
	{$rating}
	<td class="{$bgcolor}{$thread_type_class}" style="white-space: nowrap; text-align: right;">
		{$lastposterlink}<br/>{$lastpostdate} </span> <span class="lastpost smalltext"><a href="{$thread['lastpostlink']}"><img src="images/lastpost.png"/></a>
	</td>
{$modbit}
</tr>
This requires a change of PHP code in showthread.php:

Time ago I managed to achieve that lastpost date with this simple modification:
Add the following variables to the empty line 71 in showthread.php (v1.8.22/.24):
$ets_thread_firstpost_date = my_date('relative', $post['dateline']); $ets_thread_lastpost_date = my_date('relative', $thread['lastpost']);
(Try to keep the original line structure and do not intentionally break lines - so you don't get in any trouble on future code investigations)

The variable can now be used in "Show Thread Templates / showthread", for example:
{$ets_thread_firstpost_date} / {$lang->lastpost}: {$ets_thread_lastpost_date}

Good luck!

[ExiTuS]
(2021-01-22, 11:45 AM)[ExiTuS] Wrote: [ -> ]This requires a change of PHP code in showthread.php:

Time ago I managed to achieve that lastpost date with this simple modification:
Add the following variables to the empty line 71 in showthread.php (v1.8.22/.24):
$ets_thread_firstpost_date = my_date('relative', $post['dateline']); $ets_thread_lastpost_date = my_date('relative', $thread['lastpost']);
(Try to keep the original line structure and do not intentionally break lines - so you don't get in any trouble on future code investigations)

The variable can now be used in "Show Thread Templates / showthread", for example:
{$ets_thread_firstpost_date} / {$lang->lastpost}: {$ets_thread_lastpost_date}

Good luck!

[ExiTuS]

Hi , thanks , but I'm use Forumdisplay template , not showthread for date and time :/