Пример #1
0
include "form.inc";
$LocalImageDir = "/home/hromi1/images/clanky/";
if ($id) {
    $article = $redakce->getArticleData($id);
    $article->next();
    echo "<html><head><link rel=stylesheet type=\"text/css\" href=\"./kyberia.css\"></head>";
    $form = new HTML_Form($PHP_SELF, "POST", "", "multipart/form-data");
    echo "<html><head><title>Pridanie clanku</title></head><body>\n";
    $redakce->listArticles();
    echo "<body><table><tr>\n";
    $form->addText("nazov", "Nazov:", $article->getString("nazov"));
    $form->addText("autor", "Autor:", $article->getString("autor"));
    $form->addfile("title_image", "Titulni Obrazok:");
    $form->addfile("image1", "Obrazok:");
    $form->addfile("image2", "Obrazok:");
    $form->addhidden("id", $id);
    $form->addfile("image3", "Obrazok:");
    $form->addSelect("id_rubrika", "Rubrika", $redakce->listRubrikyArray());
    $form->addSelect("id_rubrika_secondary", "Sekundarna rubrika", $redakce->listRubrikyArray());
    $form->addTextarea("short_desc", "Kraktky popis", $article->getString("short_desc"), 40, 6);
    $form->addTextarea("text1", "Text:", stripslashes($article->getString("text1")), 80, 23);
    $form->addTextarea("text2", "Text:", stripslashes($article->getString("text2")), 40, 6);
    $form->addTextarea("text3", "Text:", stripslashes($article->getString("text3")), 40, 6);
    $form->addTextarea("keywords", "Keywords:", stripslashes($article->getString("keywords")), 40, 6);
    $form->addSubmit("submit", "pridaj", "");
    $form->display();
    echo "</body></html>";
}
if ($submit == "pridaj") {
    if (isset($title_image)) {
        Copy($title_image, $LocalImageDir . $title_image_name);