Subversion Repositories personal-webbase

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 daniel-mar 1
<?php
2
 
3
if (!defined('WBLEGAL')) die('Kann nicht ohne Personal WebBase ausgef&uuml;hrt werden.');
4
 
5
echo str_replace('<body', '<body onload="self.focus();document.getElementById(\'eintrag\').focus();"', $header);
6
 
7
if (isset($sent) && ($sent == '1'))
8
{
9
        if ((!isset($eintrag)) || ((isset($eintrag)) && ($eintrag == ''))) die(''); // Alternativ: Prüfen, ob der Datenträger wirklich existiert!
10
 
11
        if (($wurzel == '') && ($ordner == '') && ($komplett == ''))
12
        {
13
                db_query("DELETE FROM `".$WBConfig->getMySQLPrefix()."mediacollection_content` WHERE `eintrag` = '".db_escape($eintrag)."' AND `category` = '".$category."' AND `user_cnid` = '".$benutzer['id']."'");
14
                if (db_affected_rows() > 0)
15
                        db_query("OPTIMIZE TABLE `".$WBConfig->getMySQLPrefix()."mediacollection_content`");
16
        }
17
        else
18
        {
19
                $ary = explode('-', $eintrag);
20
                $category = $ary[0];
21
                $eintrag = $ary[1];
22
                $komplett = $komplett;
23
                $komplett = str_replace('„', '&auml;', $komplett);
24
                $komplett = str_replace('”', '&ouml;', $komplett);
25
                $komplett = str_replace('?', '&uuml;', $komplett);
26
                $komplett = str_replace('Ž', '&Auml;', $komplett);
27
                $komplett = str_replace('™', '&Ouml;', $komplett);
28
                $komplett = str_replace('š', '&Uuml;', $komplett);
29
                $komplett = str_replace('á', '&szlig;', $komplett);
30
                db_query("UPDATE `".$WBConfig->getMySQLPrefix()."mediacollection_content` SET `komplett` = '".db_escape($komplett)."' WHERE `eintrag` = '".db_escape($eintrag)."' AND `category` = '".db_escape($category)."' AND `user_cnid` = '".$benutzer['id']."'");
31
                db_query("INSERT INTO `".$WBConfig->getMySQLPrefix()."mediacollection_content` (`eintrag`, `komplett`, `category`, `user_cnid`) VALUES ('".db_escape($eintrag)."', '".db_escape($komplett)."', '".db_escape($category)."', '".$benutzer['id']."')");
32
        }
33
}
34
 
35
echo '<h1>Neuen Inhalt erstellen</h1>';
36
 
37
$disks = '';
38
 
39
$something_found = false;
40
$res2 = db_query("SELECT `nummer`, `spalte`, `name` FROM `".$WBConfig->getMySQLPrefix()."mediacollection_categories` WHERE `user_cnid` = '".$benutzer['id']."' ORDER BY `spalte`, `nummer` ASC");
41
while ($row2 = db_fetch($res2))
42
{
43
        $res3 = db_query("SELECT `id`, `nr`, `name` FROM `".$WBConfig->getMySQLPrefix()."mediacollection_entries` WHERE `category` = '".$row2['spalte'].$row2['nummer']."' AND `user_cnid` = '".$benutzer['id']."' ORDER BY `id` ASC");
44
        while ($row3 = db_fetch($res3)) {
45
                $disks .= '<option value="'.$row2['spalte'].$row2['nummer'].'-'.$row3['id'].'">'.$row2['spalte'].$row2['nummer'].' - ('.$row3['nr'].') '.$row3['name'].'</option>';
46
                $something_found = true;
47
        }
48
}
49
 
50
if (!$something_found) {
51
        echo '<p>Es existieren keine Datentr&auml;ger.</p>';
52
        echo '<p><a href="'.$_SERVER['PHP_SELF'].'?modul='.$modul.'&amp;seite=newdisk">Einen Datentr&auml;ger hinzuf&uuml;gen</a></p>';
53
        echo '<p><a href="'.$_SERVER['PHP_SELF'].'?modul='.$modul.'&amp;seite=main">Zur&uuml;ck zum Hauptmen&uuml;</a></p>';
54
} else {
55
        echo '<form method="post" action="'.$_SERVER['PHP_SELF'].'" name="mainform">';
56
        echo '<input type="hidden" name="modul" value="'.$modul.'">';
57
        echo '<input type="hidden" name="seite" value="newinhalt">';
58
        echo '<input type="hidden" name="sent" value="1">';
59
 
60
        echo 'Datentr&auml;ger: <select name="eintrag" id="eintrag">';
61
        echo $disks;
62
        echo '</select><br><br>';
63
 
64
        echo 'Komplettinhalt (tree x: /f /a)<br><br><textarea name="komplett" cols="70" rows="10"></textarea><br><br>';
65
 
66
        echo '<input type="submit" class="button" onmouseover="this.className=\'button_act\';" onmouseout="this.className=\'button\';" value="Inhalt einf&uuml;gen"> <input type="button" value="Abbrechen" onclick="document.location.href=\'?modul='.$modul.'&amp;seite=main\'" class="button" onmouseover="this.className=\'button_act\';" onmouseout="this.className=\'button\';">';
67
 
68
        echo '</form>';
69
}
70
 
71
unset($something_found);
72
unset($disks);
73
 
74
echo $footer;
75
 
76
?>