Ich habe es bei mir quick&dirty gelöst.
in der archiv.php
Zeile 718 - 730
// aendern / eintragen
if (isset($_POST['sub'])) {
$_POST['name'] = escape($_POST['name'], 'string');
$_POST['banner'] = escape($_POST['banner'], 'string');
$_POST['link'] = get_homepage(escape($_POST['link'], 'string'));
if (empty ($_POST['pkey'])) {
$_POST['pos'] = db_result(db_query("SELECT COUNT(*) FROM prefix_partners"), 0);
db_query("INSERT INTO prefix_partners (name,banner,link,pos) VALUES ('" . $_POST['name'] . "','" . $_POST['banner'] . "','" . $_POST['link'] . "','" . $_POST['pos'] . "')");
} else {
db_query("UPDATE prefix_partners SET name = '" . $_POST['name'] . "',banner = '" . $_POST['banner'] . "',link = '" . $_POST['link'] . "' WHERE id = '" . $_POST['pkey'] . "'");
}
}
ändern in:
// aendern / eintragen
if (isset($_POST['sub'])) {
$_POST['name'] = escape($_POST['name'], 'string');
$_POST['banner'] = escape($_POST['banner'], 'string');
$_POST['banner'] = $_FILES['banner']['name'];
move_uploaded_file($_FILES['banner']['tmp_name'], "include/images/wb/".$_POST['banner']);
$_POST['link'] = get_homepage(escape($_POST['link'], 'string'));
if (empty ($_POST['pkey'])) {
$_POST['pos'] = db_result(db_query("SELECT COUNT(*) FROM prefix_partners"), 0);
db_query("INSERT INTO prefix_partners (name,banner,link,pos) VALUES ('" . $_POST['name'] . "','" . $_POST['banner'] . "','" . $_POST['link'] . "','" . $_POST['pos'] . "')");
} else if ( empty($_POST['banner']) ) {
db_query("UPDATE prefix_partners SET name = '" . $_POST['name'] . "',link = '" . $_POST['link'] . "' WHERE id = '" . $_POST['pkey'] . "'");
} else if ( empty($_POST['link']) ) {
db_query("UPDATE prefix_partners SET name = '".$_POST['name']."', banner = '".$_POST['banner']."' WHERE id ='".$_POST['pkey']."'");
}
}
in der partners.htm:
<td class="Cnorm"><input type="text" size="50" name="banner" value="{banner}" /></td>
Ändern in:
<td class="Cnorm"><input name="banner" type="file" id="banner"><br /><a href="/include/images/wb/{banner}">{banner}</a></td>
Danach noch unter images das Verzeichnis wb erstellen und Schreibrechte geben.
Zuletzt modifiziert von mabu78 am 27.07.2013 - 16:55:08