MyBB Community Forums

Full Version: Changed Postbit makes first post lose style
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
My problem is very unusual. I have been transitioning my site over to HTML5 and in doing so I've decided to get rid of the tabled posts and make them into listed articles.

The modified "postbit_classic" by me was this:

   <a name="pid{$post['pid']}" id="pid{$post['pid']}"></a>
<article class="postborder" style=" {$post_visibility} margin: 10px 0;width:100%" id="post_{$post['pid']}">
  <aside class="trow1" style="padding: 14px 28px;white-space: nowrap; text-align: center; border-bottom:none;display:table-cell">
    	  <div class="mob">{$post['useravatar']}</div>
          <div style="height:8px"></div>
          <div class="largetext centered" style="padding-bottom: 0px;">{$post['profilelink']}</div>
          <span style="font-size:13px">{$post['groupimage']}{$post['usertitle']}</span>
          <span style="font-size:12px">{$post['profilefield']}</span>
          <div style="height:8px"></div>
          <span class="smalltext">
          <div class="author_statistics" style="margin: 0 auto; width: 120px;">
			{$post['user_details']}{$post['newpoints_postbit']}
          </div>
            <br>
            <span class="float_left">{$post['button_email']}{$post['button_pm']}{$post['button_www']}{$post['button_find']}{$post['button_rep']}	{$post['iplogged']}</span></td>
  </aside>
    <div class="trow1" style="border-bottom:none;width:100%;display:table-cell;vertical-align:top">
      <span style="font-size:11px;color:#999"><time>{$post['postdate']} {$post['posttime']}</time></span>
      <div style="text-align: right; vertical-align: bottom;" id="post_meta_{$post['pid']}">
      </div>
      <div style="clear:both;width:100%"></div>
      <article id="pid_{$post['pid']}" class="post_body">
				{$post['message']}
      {$post['attachments']}
      <br>
      <span class="float_right">{$post['button_edit']}{$post['button_quickdelete']}{$post['button_quickrestore']}{$post['button_quote']}{$post['button_multiquote']}{$post['button_report']}{$post['button_warn']}{$post['button_purgespammer']}{$post['button_reply_pm']}{$post['button_replyall_pm']}{$post['button_forward_pm']}{$post['button_delete_pm']}</span>
      <br> 
      <div style="float: right; width: auto; vertical-align: top;"><span style="font-size:11px;color:#999">{$post['posturl']}</span></div>    
      {$post['signature']}
    </div>
</article>

The original was this:

  {$ignore_bit}
<table border="0" cellspacing="0" cellpadding="6" class="postborder" style=" {$post_visibility} margin: 10px 0;" id="post_{$post['pid']}">
     <tr>
		<td class="trow1" width="15%" valign="top" style="white-space: nowrap; text-align: center; border-bottom:none">
          <div class="mob">{$post['useravatar']}</div>
          <div style="height:8px"></div>
          <div class="largetext centered" style="padding-bottom: 0px;">{$post['profilelink']}</div>
          <span style="font-size:13px">{$post['groupimage']}{$post['usertitle']}</span>
          <span style="font-size:12px">{$post['profilefield']}</span>
          <div style="height:8px"></div>
          <span class="smalltext">
          <div class="author_statistics" style="margin: 0 auto; width: 120px;">
			{$post['user_details']}{$post['newpoints_postbit']}
          </div>
            <br />
		
            </span></div></div>
   </td>
	<td class="trow1" valign="top" style="border-bottom:none">
		<table width="100%">
			<tr><td>
			<article id="pid_{$post['pid']}" class="post_body">
				{$post['message']}
			<div style="text-align: right; vertical-align: bottom;" id="post_meta_{$post['pid']}">
			</div>
         	{$post['attachments']}
          <br><span style="font-size:11px;color:#999"><time>{$post['postdate']} {$post['posttime']}</time></span> 
           <div style="float: right; width: auto; vertical-align: top;"><span style="font-size:11px;color:#999">{$post['posturl']}</span></div>    
          {$post['signature']}
		</td>
     </tr>
  </table>
</td>
</tr>
<tr valign="bottom">
	<td class="buttons" style="background:none" align="left" valign="bottom">
<span class="float_left">{$post['button_email']}{$post['button_pm']}{$post['button_www']}{$post['button_find']}{$post['button_rep']}	{$post['iplogged']}</span></td>
	<td class="buttons" align="right" valign="bottom">
<span class="float_right">{$post['button_edit']}{$post['button_quickdelete']}{$post['button_quickrestore']}{$post['button_quote']}{$post['button_multiquote']}{$post['button_report']}{$post['button_warn']}{$post['button_purgespammer']}{$post['button_reply_pm']}{$post['button_replyall_pm']}{$post['button_forward_pm']}{$post['button_delete_pm']}</span>
</td>
</tr>
</table>

(sorry for the rough style tags, I put them on a style sheet when I've got it good)

And this is the result I get:

http://i60.tinypic.com/kewv0h.jpg

As you can see, the very first post ends up with no style and the userinfo disappears somewhere. Has anyone any ideas? I haven't changed anything else except the postbit.
I see 2 opening <article> and only 1 </article> closing tag. So something can go wrong there.
Yeah. In the modified version I originally had no article tag open there, but I noticed it was there in the original version so I added it in. The problem has been occurring from before that.

If its any help, I noticed when the code of the postbit is generated on the front end, it doesn't generate the master article tag (around everything) nor the aside tag, but only for the first post... that is strange...

edit: actually the author_info and surrounding box is pushed under very last post.

FIXED: I moved the {$POSTS} above the table it was already stored in because the first post stayed inside that tag but the rest appeared above it. Weird no idea why.

Secondly, where do I edit the view of a private as if you were reading it?
just put <article> and </article> at the very top and bottom respectively of the postbit(s). No classes, just wrap the whole thing in the tags. Make sure the whole list is a section.