XF 1.2 Is it possible to move a posts time and date to another part of the post?

Mark Wein

Member
I'm putting together the customizations for my forum (currently vB4 but moving to XF 1.2) and I've been able to find pretty much every tweak my users have asked for here except for the fact that they are used to the posting time and date at the top of a post like it is in vBulletin:

Screen shot 2013-07-15 at 2.52.24 PM.webp

I haven't been able to figure out how to make a change like that in XF but even if it could be moved to under the Avatar that would allow the users to see when a post was made without having to scroll to the bottom of a longer post.

Screen shot 2013-07-15 at 2.50.55 PM.webp

Anyhow, any help is appreciated. :)
 
In the template thread_view find:
HTML:
        <xen:foreach loop="$posts" value="$post">

After that, you can place any HTML you want, want to get the post date, use the following:
HTML:
                    <a href="{xen:link threads/post-permalink, $thread, 'post={$post}'}" title="{xen:phrase permalink}" class="datePermalink"><xen:datetime time="$post.post_date" /></a>
 
In the template thread_view find:
HTML:
        <xen:foreach loop="$posts" value="$post">

After that, you can place any HTML you want, want to get the post date, use the following:
HTML:
                    <a href="{xen:link threads/post-permalink, $thread, 'post={$post}'}" title="{xen:phrase permalink}" class="datePermalink"><xen:datetime time="$post.post_date" /></a>


awesome! Thanks! That worked perfectly!

Screen Shot 2013-07-15 at 6.29.46 PM.webp
 
I added this also. The first time I added it, I remove the "if" code...that was bad, all posts went into hiding. reverted template then added the other code, works great. I'm such a newbie. Thanks
 
Wow, this is brilliant and way more simple than I thought it would be, thanks @Jeremy !

One question: Is there an easy way to put it right above the avatar and underneath the message frame/box line? For example move it to here:

upload_2014-1-31_12-9-10.webp
 
You would have to look and mess with the template some more. It would have to be moved down a few lines to be within the main container for the post.
 
I've been copy/pasting in a bunch of different locations, but unfortunately this is over my pay-scale ;) My test text just winds up in odd places and never where I expect it to. :(
 
Untested, but putting it after the following line in the message template should work:
Code:
<li id="{$messageId}" class="message {xen:if $message.isDeleted, 'deleted'} {xen:if '{$message.is_staff}', 'staff'} {xen:if $message.isIgnored, ignored}" data-author="{$message.username}">
 
Wow, thanks Jeremy! I added it and the positioning was off (it was off to the right of the postbit) but adding a simple <br> at the end of the line worked perfectly!

upload_2014-2-1_1-10-42.webp
 

Attachments

  • upload_2014-2-1_1-10-18.webp
    upload_2014-2-1_1-10-18.webp
    2.2 KB · Views: 2
I would also like to show the post number at the top right of the post (before the date/time stamp), in addition to (or instead of) at the bottom of the post by the 'like' and 'reply' bits. How would I go about adding this?
 
It's working!... BUT, now I need to figure out a couple more things:

1- location to the right, I used float:right, but it's losing its formatting.

2- how to maintain the same dimensions as when I don't add any CSS.

Here is what I have when I just put the code "as is":

c14fb01a01edf34853e3cd2c12004630.webp

Here is what I get when I style it:

11e6d0e3068a9bd20ef42413258d62e2.webp

This is the code I used.

Code:
  <div style="font-weight:bold;float:right;background:transparent;">
<a href="{xen:link threads/post-permalink, $thread, 'post={$post}'}" title="{xen:phrase permalink}" class="datePermalink"><xen:datetime time="$post.post_date" /></a></div>

Now, I can also see there will be 3 dates and times in the same area (2 per post, plus the one that shows that the post if and when was edited. Should I eliminate one of them? If so, I'm thinking of taking out the one beside the member's name in the private controls (to the right of their name).

Is this making sense?

Thanks you in advance!

Andre
 
Top Bottom