SimplePortal
Development => Bugs => Fixed or Bogus Bugs => Topic started by: dannbass on November 19, 2009, 11:28:50 AM
-
I'm using articles for the front page, and the three dots that cut the article work great, if I'm writing normal, but since I want my articles pretty, I'm using the justify bbcode and the dots are pushed down.
I get that I'm not being as descriptive as possible, so I'm attaching three screen caps. First two are with the problem, and the last one is fine.
-
Try this edit.
if (!empty($modSettings['articlelength']) && $smcFunc['strlen']($row['body']) > $modSettings['articlelength'])
$row['body'] = parse_bbc(sp_truncateText($row['body']), $row['smileys_enabled'], $row['id_message']) . '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.0" title="' . $row['subject'] . '">...</a>';
if (!empty($modSettings['articlelength']) && $smcFunc['strlen']($row['body']) > $modSettings['articlelength'])
{
$row['body'] = rtrim(sp_truncateText($row['body']));
$row['body'] = substr($row['body'], -6) == '<br />' ? substr($row['body'], 0, -6) : $row['body'];
$row['body'] = parse_bbc($row['body'], $row['smileys_enabled'], $row['id_message']) . '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.0" title="' . $row['subject'] . '">...</a>';
}
-
No, it didn't work.
-
This part:
$row['body'] = substr($row['body'], -6) == '<br />' ? substr($row['body'], 0, -6) : $row['body'];
Change to:
$row['body'] = substr($row['body'], -6) == '[br]' ? substr($row['body'], 0, -6) : $row['body'];
-
Nope, that didn't do it either. :|
-
What kind of justify tag are you using? Can you show me the exact bbcode?
-
Sure! here is the mod I'm using.
Thank you for looking into it!
-
Try this out:
if (!empty($modSettings['articlelength']) && $smcFunc['strlen']($row['body']) > $modSettings['articlelength'])
$row['body'] = parse_bbc(sp_truncateText($row['body']), $row['smileys_enabled'], $row['id_message']) . '<div align="justify"><a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.0" title="' . $row['subject'] . '">...</a></div>';
-
I'm sorry to say, but that didn't do it either, and moved the dots from the articles that were not justified.
-
I'm confused as to what you're trying to do then. Are you justifying the entire article? As in, you will wrap the entire post in the justify tag?
-
Yes, I'm wrapping the whole article and when displayed it sends the dots to the next line.
Oh I see, is the code to justify the article without having to use the tags?
-
It is quite possible (and probably easier) to just justify using manual HTML in the article template than manipulating it through BBC.
What I did above was put the "..." in a justify wrap, but I'm assuming the HTML doesn't layer like that. I see two possible solutions:
1.) Remove the BBcode "justify" from the articles, and then manually hack the article templates to use it.
2.) Write up a nice regex that will look for the closed justify tag, and then push it after the "...".
-
The only problem is that not all of the articles will need to be justified, for layout reasons, maybe not the best but I might not need them all displayed like that.
Thank you so much! I'll just get by without justifying them. The dots are more important in my opinion.
-
The reason to why this was happening was because, everything in an article, is contained (think of it as layer 1), and then the layer closed and another layer is manually put on top of it (layer 2). Layer 2 is the "...".
Example:
<div class="content"><div align="justify">The article post is here.</div>...</div>
As you can see, the "..." is not contained in layer 1 because the article system is assuming you aren't manipulating the alignment.
Technically this could be considered as a bug, as if I made an entire post align to the left or right (like for example, my signature), the "..." would show to the left when it is not intended. The only known solution would be to use regex and see if anything alignment-esque entites are manipulating the article itself.
Hopefully the development team can address this.
-
Thank you for the explanation! I see now, yes I think it looks better once everything is justified, but it should be the same for the post, so ideally the alignment should be in the message itself, and then displayed accordingly in the frontpage.