Simple Machines Community Forum

SMF Development => Bug Reports => Fixed or Bogus Bugs => Topic started by: timned88 on February 14, 2009, 02:09:23 AM

Title: [3035] BUG: Attachments rendering incorrectly
Post by: timned88 on February 14, 2009, 02:09:23 AM
Version SMF 2.0RC1
i have been getting a lot of complaints about attached images being pushed too  far to the right of the post and until recently have not been able to replicate the problem.  the problem is for guests and regular users ONLYadmins and mods are not affected

the problem is this...  there is a horizontal ruler that is not being displayed at the end of the post but is instead being rendered at the top of the post almost between the title of the post and the « Reply #15 on: Today at 12:08 PM » text.  it is pushed to the right for some reason, which is causing everything else to be pushed to the right (see screenshots).  i am trying to figure out if this is a css error or a bug in hardcode but have had no luck so far. 

here is the link to the full thread of what people are complaining about...   i am sure this should be an easy fix for someone.
http://www.themagicinpixels.com/forum/index.php/topic,3754.msg28370/topicseen.html#msg28370 (http://www.themagicinpixels.com/forum/index.php/topic,3754.msg28370/topicseen.html#msg28370)

in the bottom attachment for this message, arrow #1 is showing the second horizontal rule for the post with an attachment, #2 is showing how the image is pushed way right, #3 is showing the huge horizontal scrollbar for the affected posts.

i have tested this one a clean base install with nothing changed but the database copied over and this issue persists.   i cross posted this topic from the 2.0 support threads because it seems now to be a bug that needs to be looked at vs. a simple error on my part.

links
base install:  http://www.themagicinpixels.com/forum-testing (http://www.themagicinpixels.com/forum-testing)



screenshots
(http://www.simplemachines.org/community/index.php?action=dlattach;topic=292840.0;attach=86279;image)

(http://www.simplemachines.org/community/index.php?action=dlattach;topic=292840.0;attach=86285;image)


Title: Re: BUG: Attachments rendering incorrectly
Post by: karlbenson on February 14, 2009, 12:57:53 PM
Thanks.
We're already aware of the issue affecting attachments in certain browsers.

http://dev.simplemachines.org/mantis/view.php?id=3035

---
Note. some reports of this are related to custom themes using different css than default smf core theme for attachments.
http://www.simplemachines.org/community/index.php?topic=292347.msg1928870#msg1928870
Title: Re: [3035] BUG: Attachments rendering incorrectly
Post by: timned88 on February 14, 2009, 01:31:01 PM
regular, i am using the default theme with the wrapper, but this happened to me on a clean install that i created for testing purposes.  is there a work around or way to solve the issue?  i run a photography forum and attachments are critical to my members.  thanks.
Title: Re: [3035] BUG: Attachments rendering incorrectly
Post by: karlbenson on February 14, 2009, 01:33:18 PM
There isn't a posted fix with it.

Its on the bugtracker. Hopefully it should be fixed for the next release.
Title: Re: [3035] BUG: Attachments rendering incorrectly
Post by: timned88 on February 14, 2009, 01:35:46 PM
i was hoping that you wouldn't say that :(
do you have any estimated time frame?
Title: Re: [3035] BUG: Attachments rendering incorrectly
Post by: karlbenson on February 14, 2009, 01:38:56 PM
no.  RC2 will be "when its ready".

Although once its fixed on the svn, it might be possible for one of the team to provide the fix.
But even for when the devs will get to look it is unknown. [I can't speak for them].

I will link this topic to the bug report though.
Title: Re: [3035] BUG: Attachments rendering incorrectly
Post by: timned88 on February 14, 2009, 01:43:05 PM
i clicked through the link you provided but 3035 is not listed in the list of issues.
Title: Re: [3035] BUG: Attachments rendering incorrectly
Post by: timned88 on February 14, 2009, 01:54:45 PM
regular, could you tell me what files are involved in attachment rendering so I could try to come up with my own temp fix (and where to look in them if possible?).
Title: Re: [3035] BUG: Attachments rendering incorrectly
Post by: karlbenson on February 14, 2009, 02:11:29 PM
see that link i posted above. It appears to be playing with css.
http://www.simplemachines.org/community/index.php?topic=292347.msg1928870#msg1928870

Themes/default/style.css

(if your using default theme, then style.css in those themes aswell).
Title: Re: [3035] BUG: Attachments rendering incorrectly
Post by: timned88 on February 14, 2009, 02:27:58 PM
ok, i will give it a try. 
Title: Re: [3035] BUG: Attachments rendering incorrectly
Post by: metallica48423 on February 14, 2009, 04:18:23 PM
Quote from: timned88 on February 14, 2009, 01:43:05 PM
i clicked through the link you provided but 3035 is not listed in the list of issues.

It's in there.  It is currently marked as "private"
Title: Re: [3035] BUG: Attachments rendering incorrectly
Post by: timned88 on February 14, 2009, 04:47:47 PM
oh, ok. hopefully this can get resolved quickly.
is there a particular line in the Css files that I should be looking for?
I don't mean to be a pest but this is a crippler for a photo forum. 
Title: Re: [3035] BUG: Attachments rendering incorrectly
Post by: karlbenson on February 14, 2009, 04:49:25 PM
not sure sorry.
Title: Re: [3035] BUG: Attachments rendering incorrectly
Post by: timned88 on February 14, 2009, 10:47:42 PM
i think i fixed it!!!!

changed line #497 in display.template.php

ORIGINAL
<div id="msg_', $message['id'], '_footer" class="attachments smalltext">';


MODIFIED
<div class="post floatleft" id="msg_', $message['id'], '_footer" class="attachments smalltext">';

SEEMS to be working properly line.  tested in IE7, FF3, Safari for windows.  More later if necessary.
Title: Re: [3035] BUG: Attachments rendering incorrectly
Post by: DerEineDa on February 14, 2009, 11:06:42 PM
I came up with almost the same solution, but with only editing a CSS-file:

/Themes/default/css/forum.css, Line 353:

.attachments
{
clear: right;
padding-top: 1em;
}


Change this to:

.attachments
{
clear: right;
float: left;
width: 100%;
padding-top: 1em;
}


This is pretty dirty, but the nesting of boxes and the abuse of floats are already horrible in this theme (at least since this release) :)
Title: Re: [3035] BUG: Attachments rendering incorrectly
Post by: timned88 on February 14, 2009, 11:09:16 PM
boy i wish you would have posted this last nite!  ;)
this has been making me crazy trying to figure out.
i will try your solution as well.  should give equal results but i would rather modify css than basecode.
i agree- i had a helluva time with trying to figure out the div's and other things.
Title: Re: [3035] BUG: Attachments rendering incorrectly
Post by: timned88 on February 14, 2009, 11:13:43 PM
Quote from: DerEineDa on February 14, 2009, 11:06:42 PM
I came up with almost the same solution, but with only editing a CSS-file:

/Themes/default/css/forum.css, Line 353:

.attachments
{
clear: right;
padding-top: 1em;
}


Change this to:

.attachments
{
clear: right;
float: left;
width: 100%;
padding-top: 1em;
}


This is pretty dirty, but the nesting of boxes and the abuse of floats are already horrible in this theme (at least since this release) :)


btw, your solution did not work for me.
Title: Re: [3035] BUG: Attachments rendering incorrectly
Post by: DerEineDa on February 14, 2009, 11:28:24 PM
I am absolutely positive that this works. It does here and I didn't do any other changes. Please try to clear your cache.

Btw, the culprit here seems to be the modify button, which floats to the right of each post - but only if you are mod or admin. Because the attachment-area tries to do a "clear: right;", which depends on this button, this results in this behaviour. This was pretty easy to figure out with firebug. But finding a good solution was harder.

There are other bad dependencies like this. For example, there are situations where there are no buttons to the top right of a post (right of the title). This happens if a thread is read-only and you are not a mod or member. If all these buttons are missing, the horizontal divider-line between the post-time and the post-text is positioned too high (it sticks right under the post-time, without the little gap that should be there). This is because the height of this "postingbuttons"-area (this is the name of the css-class) depends of the size of these buttons at the top right. If these are not present, then the divider is too high. This is only one example.

edit: Just to make sure I tried again: I replaced all theme-files with the originals from a fresh download. Then I did the css-edit above and it works again... I am sure it works.
Title: Re: [3035] BUG: Attachments rendering incorrectly
Post by: timned88 on February 15, 2009, 07:27:38 AM
ok thanks for the explanation.  I was messing with web developer in firefox and could not figure it out until I went into the code and started digging around, based on regular's linked post from up above. I will try your solution again.
Title: Re: [3035] BUG: Attachments rendering incorrectly
Post by: timned88 on February 15, 2009, 09:29:50 AM
you are correct...  it did work on my testing forum.  might have been a cache issue on my production forum.  i will try again later.

btw, some of my images now have scrollbars inside of the frame.  any idea why that is happening?  it never used to happen.  it started before i made the code change to render the attachments properly...   it is an admin setting that i goofed on and can't remember?  it doesn't do it on my testing forum.

note:  firefox does not exhibit this behavior but IE and safari do.
Title: Re: [3035] BUG: Attachments rendering incorrectly
Post by: timned88 on February 15, 2009, 10:22:21 AM
disregard...  fixed that one as well.
Title: Re: [3035] BUG: Attachments rendering incorrectly
Post by: marcozambi on April 29, 2009, 06:16:23 PM
I had the same problem on my forum, and this thread provided a vital solution. Thanks a lot!!