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 Well-Known Member

    In the template thread_view find:
            <xen:foreach loop="$posts" value="$post">
    After that, you can place any HTML you want, want to get the post date, use the following:
                        <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:

  8. Jeremy

    Jeremy Well-Known 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 Well-Known Member

    Untested, but putting it after the following line in the message template should work:
    <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!


    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":


    Here is what I get when I style it:


    This is the code I used.

      <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!


Share This Page