MyBB Community Forums

Full Version: Thread Date & Time not showing
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I've been lurking around the Mybb forums and Google searching for a fix, though sadly I didn't find one.

I'm trying to look for the correct code to display a thread's creation date and time right underneath the thread name.

Any help or suggestions is appreciated, thanks Smile
Anyone know the answer? I really need it before I open my forum Smile
Any help please?

I'm using: {$post['postdate']} and {$post['posttime']}, not sure what seems to be wrong.
Do you mean like the default way?

Like this?
[Image: 7owXKNy.png]
(2014-03-28, 11:48 PM)thexshadow Wrote: [ -> ]Do you mean like the default way?

Like this?
[Image: 7owXKNy.png]

Yeah, that's exactly what I mean, it's not showing up when I create a new thread Sad
Are you using postbit or postbit_classic?

Ill guess and say you are using postbit.

Go to the postbit template and check and make sure it looks something like this like this: (I will seperate where the time/date should be with another code box)
{$ignore_bit}
<a name="pid{$post['pid']}" id="pid{$post['pid']}"></a>
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" style="{$post_extra_style} {$post_visibility}" id="post_{$post['pid']}">
	<tbody>
		<tr>
			<td class="tcat">
This is what you want to check to make sure it is there.
				<div class="float_left smalltext">
					{$post['postdate']}, {$post['posttime']} <span id="edited_by_{$post['pid']}">{$post['editedmsg']}</span>
				</div>
				{$post['posturl']}
			</td>

		</tr>

		<tr>
			<td class="trow1 {$unapproved_shade}">
				<table cellspacing="0" cellpadding="0" border="0" style="width: 100%;">
					<tr>
						<td class="post_avatar" width="1" style="{$post['avatar_padding']}">
							{$post['useravatar']}
						</td>
						<td class="post_author">
							<strong><span class="largetext">{$post['profilelink']}</span></strong> {$post['onlinestatus']}<br />
							<span class="smalltext">
								{$post['usertitle']}<br />
								{$post['userstars']}
								{$post['groupimage']}
							</span>
						</td>
						<td class="smalltext post_author_info" width="165">
							{$post['user_details']}
						</td>
					</tr>
				</table>
			</td>
		</tr>

		<tr>
			<td class="trow2 post_content {$unapproved_shade}">
				<span class="smalltext"><strong>{$post['icon']}{$post['subject']} {$post['subject_extra']}</strong></span>

				<div class="post_body" id="pid_{$post['pid']}">
					{$post['message']}
				</div>
				{$post['attachments']}
				{$post['signature']}

				<div class="post_meta" id="post_meta_{$post['pid']}">
				{$post['iplogged']}
				</div>
			</td>
		</tr>

		<tr>
			<td class="trow1 post_buttons {$unapproved_shade}">
				<div class="author_buttons float_left">
					{$post['button_email']}{$post['button_pm']}{$post['button_www']}{$post['button_find']}{$post['button_rep']}
				</div>
				<div class="post_management_buttons float_right">{$post['button_edit']}{$post['button_quickdelete']}{$post['button_quote']}{$post['button_multiquote']}{$post['button_report']}{$post['button_warn']}{$post['button_reply_pm']}{$post['button_replyall_pm']}{$post['button_forward_pm']}{$post['button_delete_pm']}
				</div>
			</td>
		</tr>
	</tbody>
</table>
Is it possible to put it in Showthread template? I'm not using the default mybb theme, so my postbit doesn't look the same as the one you stated
Specify details such as template in first post if you wish a quick answer, because I don't think anyone had known what you want before you made your last post...

As for solution, you can use only {$thread['dateline']} by default, but it's in UNIX timestamp. To convert it to usual date format you can download Template Conditionals: http://mybbhacks.zingaburga.com/showthread.php?tid=464 Upload both .php and .txt files to inc/plugins, acivate and then put this code to showthread:
<?=my_date($mybb->settings['dateformat'], $thread['dateline'])?>
Post your postbit template.
(2014-03-29, 01:29 AM)Destroy666 Wrote: [ -> ]Specify details such as template in first post if you wish a quick answer, because I don't think anyone had known what you want before you made your last post...

As for solution, you can use only {$thread['dateline']} by default, but it's in UNIX timestamp. To convert it to usual date format you can download Template Conditionals: http://mybbhacks.zingaburga.com/showthread.php?tid=464 Upload both .php and .txt files to inc/plugins, acivate and then put this code to showthread:
<?=my_date($mybb->settings['dateformat'], $thread['dateline'])?>

That works perfect! Could you help me with the code for the time also? The above code only displays the date, not the time of the thread.
Pages: 1 2