1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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

Discussion in 'Styling and Customization Questions' started by Mark Wein, Jul 15, 2013.

  1. Mark Wein

    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.png

    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.png

    Anyhow, any help is appreciated. :)
     
  2. EasyTarget

    EasyTarget Well-Known Member

    The only way I know of doing it, is you would have to create a custom add-on. Much easier to do in version 1.2.
     
  3. Mark Wein

    Mark Wein Member

    Thats a little outside of my skillset. :(

    Thanks for the info though. I was kind of hoping it would be something that I could just copy a snippet out of one template and put it in another.
     
  4. Jeremy

    Jeremy XenForo Moderator Staff Member

    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>
    
     
    Mark Wein likes this.
  5. Mark Wein

    Mark Wein Member


    awesome! Thanks! That worked perfectly!

    Screen Shot 2013-07-15 at 6.29.46 PM.png
     
  6. Floyd R Turbo

    Floyd R Turbo Well-Known Member

    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
     
  7. ProCom

    ProCom Active Member

    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.png
     
  8. Jeremy

    Jeremy XenForo Moderator Staff Member

    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.
     
  9. ProCom

    ProCom Active Member

    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. :(
     
  10. Jeremy

    Jeremy XenForo Moderator Staff Member

    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}">
    
     
    ProCom likes this.
  11. ProCom

    ProCom Active Member

    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.png
     

    Attached Files:

  12. Floyd R Turbo

    Floyd R Turbo Well-Known Member

    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?
     
  13. creativeforge

    creativeforge Active Member

    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.png

    Here is what I get when I style it:

    11e6d0e3068a9bd20ef42413258d62e2.png

    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
     

Share This Page