Hallo zusammen,
bin mit meinen Anpassungen ganz gut voran gekommen. Trotzdem bekomme ich teilweise Fehlermeldungen, wo ich nicht weiss wo ich schauen muĂ. Möchte ein .zip-File temporĂ€r packen und dann direkt herunterladen. Leider bekomme ich dabei folgende Fehlermeldung:
Fatal error: Call to undefined function mosgetparam() in D:\Programme\xampp\htdocs\quixplorer_2_3_1\quixplorer_2_3_1.include\fun_archive.php on line 53
Hier mal der Code:
[code]//------------------------------------------------------------------------------
function zip_items($dir,$name) {
require_once("./_lib/lib_zip.php");
$cnt=count($GLOBALS['__POST']["selitems"]);
$abs_dir=get_abs_dir($dir);
$download = mosGetParam( $_REQUEST, 'download', "n" );
$archive_name = get_abs_item($dir,$name);
if( !strstr( $archive_name, "." )) $archive_name .= ".zip";
$zipfile=new ZipFile();
for($i=0;$i<$cnt;++$i) {
$selitem=stripslashes($GLOBALS['__POST']["selitems"][$i]);
if(!$zipfile->add($abs_dir,$selitem)) {
show_error($selitem.": Failed adding item.");
}
}
if(!$zipfile->save( $archive_name )) {
show_error($name.": Failed saving zipfile.");
}
else {
if( $download=="y" ) {
require "./_include/fun_down.php";
download_item( $dir, basename($archive_name), true );
}
}
return;
}
//------------------------------------------------------------------------------
function tgz_items($dir,$name) {
require_once("./_lib/Tar.php");
$cnt=count($GLOBALS['__POST']["selitems"]);
$abs_dir=get_abs_dir($dir);
$download = mosGetParam( $_REQUEST, 'download', "n" );
$type = ($GLOBALS['__POST']["type"] == "tgz") ? "gz" : "bz2";
$archive_name = get_abs_item($dir,$name);
if( !strstr( $archive_name, "." )) {
$archive_name .= ".tar.$type";
}
$tgz_file = new Archive_Tar($archive_name, $type);
for($i=0;$i<$cnt;++$i) {
$selitem=stripslashes($GLOBALS['__POST']["selitems"][$i]);
$v_list[] = $abs_dir ."/". $selitem;
}
if(!$tgz_file->createModify($v_list, '', realpath($GLOBALS['home_dir']))) {
show_error($name.": Failed saving Archive File.");
}
else {
if( $download=="y" ) {
require "./_include/fun_down.php";
download_item( dirname($archive_name), basename($archive_name), true );
}
}
return;
}
//------------------------------------------------------------------------------
function archive_items($dir) {
if(($GLOBALS[âpermissionsâ]&01)!=01) show_error($GLOBALS[âerror_msgâ][âaccessfuncâ]);
if(!$GLOBALS[âzipâ]) show_error($GLOBALS[âerror_msgâ][âmiscnofuncâ]);
if(isset($GLOBALS['__POST']["name"])) {
$name=basename(stripslashes($GLOBALS['__POST']["name"]));
if($name=="") show_error($GLOBALS["error_msg"]["miscnoname"]);
switch($GLOBALS['__POST']["type"]) {
case "zip": zip_items($dir,$name); break;
default: tgz_items($dir,$name);
}
header("Location: ".make_link("list",$dir,NULL));
}
show_header($GLOBALS["messages"]["actarchive"]);
echo "<br/><form name=\"archform\" method=\"post\" action=\"".str_replace("index2.php", "index3.php", make_link("arch",$dir,NULL))."\">\n";
echo "<input type=\"hidden\" name=\"no_html\" value=\"1\" />";
$cnt=count($GLOBALS['__POST']["selitems"]);
for($i=0;$i<$cnt;++$i) {
echo "<input type=\"hidden\" name=\"selitems[]\" value=\"".stripslashes($GLOBALS['__POST']["selitems"][$i])."\">\n";
}
echo "<table summary=\"\" width=\"300\"><tr><td>".$GLOBALS["messages"]["nameheader"].":</td><td align=\"left\">";
echo "<input type=\"text\" name=\"name\" size=\"25\"></td></tr>\n";
echo "<tr><td>".$GLOBALS["messages"]["typeheader"].":</td><td align=\"left\"><select name=\"type\">\n";
if(extension_loaded("zlib")) {
echo "<option value=\"zip\">Zip</option>\n";
}
if(extension_loaded("bz2")) echo "<option value=\"bz2\">Bzip2</option>\n";
echo "</select></td></tr>";
echo "<tr><td>".$GLOBALS["messages"]["downlink"]."?:</td><td align=\"left\">";
echo "<input type=\"checkbox\" checked=\"checked\" name=\"download\" value=\"y\" /></td></tr>\n";
echo "<tr><td></td><td align=\"right\"><input type=\"submit\" value=\"".$GLOBALS["messages"]["btncreate"]."\">\n";
echo "<input type=\"button\" value=\"".$GLOBALS["messages"]["btncancel"];
echo "\" onclick=\"javascript:location='".make_link("list",$dir,NULL)."';\">\n</td></tr></form></table><br/>\n";
?><?php
}
function extract_item( $dir, $item ) {
if( !is_archive( $item )) {
show_error($GLOBALS[âerror_msgâ][âextract_noarchiveâ]);
}
else {
$archive_name = realpath(get_abs_item($dir,$item));
$file_info = pathinfo($archive_name);
if( empty( $dir ))
$extract_dir = realpath($GLOBALS['home_dir']);
else
$extract_dir = realpath( $GLOBALS['home_dir']."/".$dir );
$ext = $file_info["extension"];
switch( $ext ) {
case "zip":
require_once( "./_lib/pcl/pclzip.lib.php" );
require_once( "./_lib/pcl/pclerror.lib.php" );
$zip = new PclZip($archive_name);
$res = $zip->extract( PCLZIP_OPT_PATH, $extract_dir );
if( $res < 1 ) {
show_error( $GLOBALS["messages"]["extract_failure"]." (". $zip->error_string.")" );
}
else
$_REQUEST['mosmsg'] = $GLOBALS["messages"]["extract_success"];
break;
case "gz": // a
case "bz": // lot
case "bz2": // of
case "bzip2": // fallthroughs,
case "tbz": // don't
case "tar": // wonder
require_once("./_lib/Tar.php");
$archive = new Archive_Tar($archive_name, $type);
if( $archive->extract( $extract_dir ) )
$_REQUEST['mosmsg'] = $GLOBALS["messages"]["extract_success"];
else
show_error($GLOBALS["error_msg"]["extract_failure"]);
break;
default:
show_error($GLOBALS["error_msg"]["extract_unknowntype"]);
break;
}
header("Location: ".make_link("list",$dir,NULL));
}
}
//------------------------------------------------------------------------------
?>[/code]
Kann mir jemand sagen wo ich schauen muĂ bzw. wo ich da was definieren muĂ?