Hallo,
ich habe init_3rdparty 1.4 installiert und ausgeführt, es wurde auch korrekt PHPInfo zu den Applikationen hinzugefügt.
Nun habe ich Webeditor (1.0) installiert, und erhalte beim Aufrufen immer:
Woran kann das liegen? Ich hatte die diskstation erst vor kurzem resettet, der Webeditor hatte im Anschluss auch kurzzeitig funktioniert, warum es jetzt auf einmal nicht mehr geht, weiß ich nicht.
Grüße,
Olli
ich habe init_3rdparty 1.4 installiert und ausgeführt, es wurde auch korrekt PHPInfo zu den Applikationen hinzugefügt.
Nun habe ich Webeditor (1.0) installiert, und erhalte beim Aufrufen immer:
Rich (BBCode):
<?php
function diff($a,$b){
$max_a = count($a);
$max_b = count($b);
$i = 0; $j = 0; $z = 1;
while ($i < $max_a) {
if (trim($a[$i]) == trim($b[$j])) { $out[] = array(sprintf("% 6d",$z++), htmlspecialchars($a[$i++])); $j++; }
else {
$found=false;
for ($j1=$j; $j1 <= $max_b; $j1++)
if (trim($a[$i]) == trim($b[$j1])) {
for ($k=$j; $k < $j1; $k++) $out[] = array(sprintf("% 6d",$z),'<span class="red">'.htmlspecialchars($b[$k]).'</span>');
$j=$j1+1; $j1 = $max_b+1;
$out[] = array(sprintf("% 6d",$z++),htmlspecialchars($a[$i++]));
$found = true;
}
if (!$found) $out[] = array(sprintf("% 6d",$z++),'<span class="green">'.htmlspecialchars($a[$i++]).'</span>');
}
}
$z--;
while ($j < $max_b) $out[] = array(sprintf("% 6d",$z),'<span class="red">'.htmlspecialchars($b[$j++]).'</span>');
return $out;
}
if (isset($fname2) && $_REQUEST['filename2'] == '') $_REQUEST['filename2'] = $fname2;
if ($_REQUEST['filename'] == '' && $_REQUEST['action'] == '' && isset($fname)) {
$_REQUEST['filename'] = $fname;
$_REQUEST['action'] = 'load'; }
if ($_REQUEST['filename'] <> '') {
if ($_REQUEST['action'] == 'load') {
$content=addslashes(@file_get_contents($_REQUEST['filename']));
setcookie("fname",$_REQUEST['filename']); }
elseif (substr($_REQUEST['action'],0,4) == 'save') {
if ($_REQUEST['action'] == 'save_unix') $_REQUEST['content']=str_replace(chr(13).chr(10),chr(10),$_REQUEST['content']);
if ($_REQUEST['action'] == 'save_mac') $_REQUEST['content']=str_replace(chr(13).chr(10),chr(13),$_REQUEST['content']);
@file_put_contents($_REQUEST['filename'], stripslashes($_REQUEST['content']));
}
elseif ($_REQUEST['action'] == 'remove')
@unlink($_REQUEST['filename']);
elseif ($_REQUEST['action'] == 'mkdir')
@mkdir($_REQUEST['filename']);
elseif ($_REQUEST['action'] == 'rmdir')
@rmdir($_REQUEST['filename']);
elseif ($_REQUEST['action'] == 'diff' && $_REQUEST['filename2'] != '') {
$content=addslashes(@file_get_contents($_REQUEST['filename']));
$work_file=@file($_REQUEST['filename']);
$diff_file=@file($_REQUEST['filename2']);
unset($item_number);unset($item_array);
foreach(diff($work_file,$diff_file) as $item) {
$item_number[] = $item[0];
$item_array[] = str_replace(' ',' ',$item[1]);
}
$diff_number = @implode('<br/>',$item_number);
$diff_file_string = @implode('<br/>',$item_array);
setcookie("fname",$_REQUEST['filename']);
setcookie("fname2",$_REQUEST['filename2']);
}
elseif ($_REQUEST['action'] == 'show' && $_REQUEST['filename2'] != '') {
$diff_file=@file($_REQUEST['filename2']);
if (!$diff_file) $diff_file=array('');
unset($item_number);unset($item_array);$z=1;
foreach($diff_file as $item) {
$item_number[] = sprintf("%6d",$z++);
$item_array[] = str_replace(array(' ',chr(9)),
array(' ',str_repeat(' ',8)),htmlspecialchars($item));
}
$diff_number = @implode('<br/>',$item_number);
$diff_file_string = @implode('<br/>',$item_array);
setcookie("fname",$_REQUEST['filename']);
setcookie("fname2",$_REQUEST['filename2']);
}
} else { $_REQUEST['filename']='/'; }
if ($_REQUEST['filename2'] == '') $_REQUEST['filename2'] = '/';
$_REQUEST['action'] == '';
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Editor: <?php print basename($_REQUEST['filename']) ?></title>
<script language="Javascript" type="text/javascript" src="edit_area/edit_area_full.js"></script>
<script language="Javascript" type="text/javascript">
editAreaLoader.init({
id: "content" // id of the textarea to transform
,start_highlight: false
,font_size: "8"
,font_family: "Consolas, verdana, monospace"
,allow_resize: "y"
,allow_toggle: false
,language: "en"
,syntax: "html"
,toolbar: "new_document, save, load, |, charmap, |, search, go_to_line, |, undo, redo, select_font, syntax_selection, change_smooth_selection, highlight, reset_highlight, help"
,syntax_selection_allow: "css,html,js,php,python,vb,xml,c,cpp,sql,basic,pas,brainfuck"
,load_callback: "my_load"
,save_callback: "my_save"
,plugins: "charmap"
,charmap_default: "arrows"
});
// callback functions
function my_save(id, content){
document.getElementById('action').value = 'save';
document.getElementById('content').value=content;
init('<?php print $_REQUEST['filename'] ?>','filename');
}
function my_load(id){
document.getElementById('action').value = 'load';
init('<?php print $_REQUEST['filename'] ?>','filename');
}
var myXMLHTTPRequest = (window.XMLHttpRequest)?
new XMLHttpRequest():
new ActiveXObject("Microsoft.XMLHTTP");
function LoadHTML(htmlfile){
myXMLHTTPRequest.open("GET", htmlfile, false); myXMLHTTPRequest.send(null);
return myXMLHTTPRequest.responseText;
}
function init(p,fn) {
var d = LoadHTML('dir.php?dir='+p+'&fn='+fn);
document.getElementById('fileselect').style.display='block';
co=document.getElementById('fileselect');
co.innerHTML=d;
}
</script>
<style>
td{font:11px Verdana;text-align:right;padding-right:6px}
tr{cursor:pointer}
#fileselect{position:absolute;top:50px;left:300px;width:480px;height:400px;
background-color:#bbf;overflow:auto;padding:5px;border:1px solid #666;display:none;}
#filename,#filename2{font:10px verdana;width:300px}
input{font:10px verdana;}
#cancel{font:11px Verdana;position:absolute;top:5px;right:5px;width:9px;hight:10px;
color:#fff;padding:3px;cursor:pointer;background-color:#222}
.l{text-align:left}
.view { width:613px;height:387px;font:11px Consolas;
border:1px solid #888;overflow:auto;background-color:#fff }
.viewnumber { width:36px;float:left;text-align:right;padding-right:3px;
border-right:1px solid #444;color:#999; }
.viewcontent { width:1200px;padding-left:42px; }
.red { background:#edd; }
.green { background:#ded; }
</style>
</head>
<body style="margin-top:0px">
<form id="f" name="f" method="post" action="editor.php">
<input type="hidden" name="action" id="action" value="">
<div style="font:11px verdana;margin-bottom:2px;"><input type="text" ondblclick="init(this.value,this.name)"
name="filename" id="filename" style="width:270px" value="<?php print $_REQUEST['filename'] ?>">
<input type="button" value="load" onclick="document.getElementById('action').value='load';f.submit();">
<input type="button" value="save DOS [CR+LF]" onclick="document.getElementById('action').value='save_dos';
document.getElementById('content').value=editAreaLoader.getValue('content');f.submit();">
<input type="button" value="save UNIX [LF]" onclick="document.getElementById('action').value='save_unix';
document.getElementById('content').value=editAreaLoader.getValue('content');f.submit();">
<input type="button" value="save MAC [CR]" onclick="document.getElementById('action').value='save_mac';
document.getElementById('content').value=editAreaLoader.getValue('content');f.submit();">
<input type="button" value="remove" onclick="document.getElementById('action').value='remove';f.submit();">
<input type="button" value="mkdir" onclick="document.getElementById('action').value='mkdir';f.submit();">
<input type="button" value="rmdir" onclick="document.getElementById('action').value='rmdir';f.submit();"><br/>
<input type="text" ondblclick="init(this.value,this.name)" style="width:278px;margin-left:50.2%"
name="filename2" id="filename2" value="<?php print $_REQUEST['filename2'] ?>">
<input type="button" value="diff" onclick="document.getElementById('action').value='diff';f.submit();">
<input type="button" value="show" onclick="document.getElementById('action').value='show';f.submit();">
</div>
<div style="margin-top:-21px">
<textarea id="content" style="height:500px;width:50%;float:left;" name="content">
<?php print htmlspecialchars(stripslashes($content)) ?></textarea>
<div class="view" style="position:absolute;top:44px;left:50.1%;height:475px;width:49.6%;" id="diff">
<div class="viewnumber"><?php print $diff_number ?></div>
<div class="viewcontent"><?php print $diff_file_string ?></div></div>
</div>
</form>
<div id="fileselect"><div>
</body>
</html>
Woran kann das liegen? Ich hatte die diskstation erst vor kurzem resettet, der Webeditor hatte im Anschluss auch kurzzeitig funktioniert, warum es jetzt auf einmal nicht mehr geht, weiß ich nicht.
Grüße,
Olli