pragmaMx Support Forum

pragmaMx => Coder und Bastlerecke => Thema gestartet von: GerhardSt am 29 August 2008, 17:13:01

Titel: [Erledigt] Bitte um Hilfe, bei selbst geändertem Geburtstagsblock
Beitrag von: GerhardSt am 29 August 2008, 17:13:01
Hallo, :smile:

ich habe den Geburtstagsblock, so umgecodet, das er jetzt 2 Spalten hat. Wenn vorhanden, werden in der linken aktuelle Geburtstage angezeigt und in der rechten, die der nächsten 30 Tage.

Wenn beide Spalten angezeigt werden, ist alles in Ordnung. Wenn aber am aktuellen Tag keiner Geburtstag hat, wir das ganze Theme unterhalb des Blockes verschoben und der Block ganz links zusammengequetscht.
Da der Inhalt korrekt ist, tippe ich mal auf einen Fehler in der Ausgabe, vielleicht kann mir da wer einen Tipp geben.

Hier mal der Code der Ausgabe:
$content = '<center>';
if (($counter) OR ($counter1)) {
if ($counter) {
        $content .= '<table width="100%"><tr><td valign="top" width="50%"><center><strong>';
    $content .= _MBIRTHDAY . "</strong><p>" . mxCreateImage('images/birthday/tcake.gif', _BIRTHDAYHAPPY) . "</p>";
    $content .= ($blockheigth == 0 || $counter <= 5) ? $list : "<div style=\"height: " . $blockheigth . "px; overflow : auto;\">" . $list . "</div>>";
    $content .= "<p><br /><strong>" . _MHAPPYBIRTHDAY . "</strong></p><p>" . mxCreateImage('images/birthday.gif', _BIRTHDAYHAPPY) . "</p></center></td></tr></table>";
} else {
        $content .= '<table width="100%"><tr>';
}
    $content .= '<td valign="top" width="50%"><center><strong>' . _MNBIRTHDAY . "</strong><p>" . mxCreateImage('images/birthday/tcake.gif', _BIRTHDAYHAPPY) . "</p>";
    $content .= ($blockheigth == 0 || $counter1 <= 5) ? $list1 : "<div style=\"height: " . $blockheigth . "px; overflow : auto;\">" . $list1 . "</div></center></td></tr></table>";
} else {
    $content .= _NOMBIRTHDAYS;
}
        $content .= '</center>';


Nach einigen Test´s, habe ich festgestellt, das anscheinend das zweite mal das '<table with="100%">' nicht richtig verarbeitet wird. Denn wenn ich dort eine fixe Breite einstelle, wird die Anzeige wieder zur Mitte verschoben und nach langem probieren, habe ich es sogar geschafft, das bei meiner Auflösung die Anzeige wieder richtig war. Leider stimmt das dann ja nur für eine Auflösung.
Was mache ich falsch?

Danke, für Eure Hilfe, Gerhard
Titel: Re: Bitte um Hilfe, bei selbst geändertem Geburtstagsblock
Beitrag von: GerhardSt am 31 August 2008, 12:01:34
Ist erledigt, ich habe nur wiedereinmal zu kompliziert gedacht :smile:

Das ganze muss so aussehen:
$content = '<center><table width="100%"><tr>';
if (($counter) OR ($counter1)) {
if ($counter) {
$content .= '<td valign="top" width="50%"><center><strong>';
    $content .= _MBIRTHDAY . "</strong><p>" . mxCreateImage('images/birthday/tcake.gif', _BIRTHDAYHAPPY) . "</p>";
    $content .= ($blockheigth == 0 || $counter <= 5) ? $list : "<div style=\"height: " . $blockheigth . "px; overflow : auto;\">" . $list . "</div>>";
    $content .= "<p><br /><strong>" . _MHAPPYBIRTHDAY . "</strong></p><p>" . mxCreateImage('images/birthday.gif', _BIRTHDAYHAPPY) . "</p></center></td>";
}
    $content .= '<td valign="top" width="50%"><center><strong>' . _MNBIRTHDAY . "</strong><p>" . mxCreateImage('images/birthday/tcake.gif', _BIRTHDAYHAPPY) . "</p>";
    $content .= ($blockheigth == 0 || $counter1 <= 5) ? $list1 : "<div style=\"height: " . $blockheigth . "px; overflow : auto;\">" . $list1 . "</div></center></td>";
} else {
    $content .= _NOMBIRTHDAYS;
}
$content .= '</tr></table></center>';