<?php
if(!empty($message))
    echo $message;

//jesli artykuł bez podartykułów - layout - 1 kolumna
//w przeciwnym razie layout - 2 kolumnowy

echo '<div id="article">';
    if(!empty($article))
    {
        if(!empty($article['image1']) || !empty($article['image2']))
        {
                echo '<div id="col1">';
                    if(!empty($article['image1']))
                    {
                        list($width, $height, $type, $attr) = getimagesize("./files/img/articles/".$article['image1']);
                        echo '<p><img src="/files/img/articles/'.$article['image1'].'" alt="" width="'.$width.'" height="'.$height.'" />';
                    }
                    if(!empty($article['image2']))
                    {
                        list($width, $height, $type, $attr) = getimagesize("./files/img/articles/".$article['image2']);
                        echo '<p><img src="/files/img/articles/'.$article['image2'].'" alt="" width="'.$width.'" height="'.$height.'" />';
                    }
                echo '</div>';

                echo '<div id="col2">';
                    echo '<h2>'.$article['title'].'</h2>';
                    echo '<div>'.$article['content'].'</div>';
                echo '</div>';
        }
        else
        {
                    echo '<h2>'.$article['title'].'</h2>';
                    echo '<div>'.$article['content'].'</div>';  
        }
    }
echo '</div>';

?>
