コード例 #1
0
<?php

// $Id$
// Presseeintrag hinzufügen, Formular
//
require_once I_PATH . "template2.class.php";
require_once I_PATH . "press_entry.class.php";
require_once I_PATH . "press_sites.class.php";
require_once I_PATH . "form.class.php";
$T = new template($DBG);
$PE = new press_entry($SQL, $DBG);
$PS = new press_sites($SQL, $DBG);
$VAR['db']['tableprefix'] = "";
$PS->set_prefix($VAR['db']['tableprefix']);
$PE->set_prefix($VAR['db']['tableprefix']);
// was form  send?
$send = init("send");
// fill template head
$T->add_title("Presseintrag erstellen");
$T->add_css("css/nentry.css");
$T->add_hidden_field("menu", "nentry");
// PREFILL -------------------------------------------------------------------
// head
$T->leadin("<div class=\"error\">" . $formerror['main'] . "</div>" . "<div class=\"status\">" . $status . "</div>" . "<table summary=\"form table (as layout)\" width=\"100%\">\n");
// Titel
$name = "title";
$html['content'] .= $T->add_form_field(array("name" => $name, "label" => "<u>T</u>itel", "key" => "t", "type" => "text", "help" => "Bitte geben Sie den Titel des Presseartikels ein.\nz. Bsp.: Rostocker Mensa gewinnt goldenen Suppentopf"));
// stichw�rter
$name = "keywords";
$html['content'] .= $T->add_form_field(array("name" => $name, "label" => "<u>S</u>tichw&ouml;rter", "key" => "s", "type" => "text", "help" => "Bitte geben Sie Stichw&ouml;rter an, die den Inhalt des Artikels gut beschreiben und trennen Sie die mit Komma oder Leerzeichen.\nz. Bsp.: Mensa, Suppentopf, Auszeichnung"));
// Link
コード例 #2
0
// FIXME: ugly
define("OK", "<span class='ok'>ok</span>");
define("NOK", "<span class='nok'>no</span>");
$ERRORS = 0;
// PUSER
require_once I_PATH . "press_user.class.php";
$PUSER = new press_user($db);
// 	$db	 = &$VAR['db'];
require_once I_PATH . "press.class.php";
// PSITES
require_once I_PATH . "press_sites.class.php";
$PSITES = new press_sites(&$SQL, &$DBG);
// $SQL has to be a valid MySQL-Object
//PENTRIES
require_once I_PATH . "press_entry.class.php";
$PENTRIES = new press_entry(&$SQL);
// SQL has to be an valid Object
// setup test-database
$prefix = "test_";
// needed for database
$PUSER->set_prefix($prefix);
include "doc/database.php";
$SQL->create($table['user']);
// main user
$SQL->create($table['press_user']);
// user extension
$SQL->create($table['press_sites']);
// sites
$SQL->create($table['press_entries']);
// press_entries
$SQL->create($table['press_keywords']);