nach dem update auf 4.8.8 wird der medianname anders abgespeichert als zuvor, und ich kriege es in meinem downloadlistenmodul nicht hin, den passenden mediennamen für neu hochgeladene dateien auszulesen.
kann mir jemand helfen?
hier der originalcode, der bis 4.8.7 lief:
wenn jemand helfen könnte, wäre das super. merci!<?php
/***********************************************
* CONTENIDO MODUL - OUTPUT
*
* Modulname : Download List
* Author(s) : Stefan Seifarth <info@polycoder.de>
* Copyright : www.polycoder.de / www.htcm.de
* Created : 2006-01-07
* Modified : 2006-11-07
************************************************/
cInclude ("classes", "class.upload.php");
cInclude ("classes", "class.properties.php");
cInclude ("classes", "class.htmlelements.php");
cInclude ("includes", "functions.upl.php");
// template defined vars
$dllist_path = "CMS_VALUE[110]";
$dllist_extensions = trim("CMS_VALUE[111]");
$dllist_idart = trim("CMS_VALUE[112]");
$dllist_filenamefilter = trim("CMS_VALUE[113]");
$cms_sort_direction = "CMS_VALUE[16]";
if ($cms_sort_direction == 'desc') {
$cms_sort_direction = 'DESC';
} else { $cms_sort_direction = 'ASC'; }
if ($dllist_path == "none") {
$nonregmsg = "<p>".mi18n('')."</p>";
} else {
if ($auth->auth["uid"] != "nobody")
{
// add filetype condition
$str_where_filetype = "";
if ( strlen ($dllist_extensions) > 0) {
$arr_extensions = explode (",",$dllist_extensions);
$arr_where = array();
foreach ($arr_extensions as $str_extension) {
$arr_where[] = "filetype ='" . trim($str_extension) . "'";
}
$str_where_filetype = ' ( ' . implode( " OR ", $arr_where ) . ' ) AND ';
}
// add filename filter condition
$str_where_filenamefilter = "";
if ( strlen ($dllist_filenamefilter) > 0) {
$arr_filenamefilter = explode(";", $dllist_filenamefilter);
$arr_where = array();
foreach ($arr_filenamefilter as $str_filenamefilter) {
$str_filenamefilter = trim($str_filenamefilter);
// replace special chars for wildcards
$str_filenamefilter = str_replace("%","\%", $str_filenamefilter);
$str_filenamefilter = str_replace("_","\_", $str_filenamefilter);
$str_filenamefilter = str_replace("*","%", $str_filenamefilter);
$str_filenamefilter = str_replace("?","_", $str_filenamefilter);
$arr_where[] = ' filename LIKE "' . mysql_escape_string($str_filenamefilter) . '"';
}
$str_where_filenamefilter = ' ( ' . implode( " OR ", $arr_where ) . ' ) AND ';
}
// get list of all files
$dllist_collection = new UploadCollection ();
$dllist_collection->select($str_where_filenamefilter . $str_where_filetype . " dirname = '" . $dllist_path .
"'","","filename ".$cms_sort_direction);
// initialize needed objects
$obj_file_properties = new PropertyCollection();
$obj_icon = new cHTMLImage();
$obj_description = new cHTMLDIV();
// reset template
$tpl = new Template();
$tpl->reset();
// add head description
$tpl->set("s","HEAD_NAME", mi18n("Dateiname") );
$tpl->set("s","HEAD_FILETYPE", mi18n("Dateityp") );
$tpl->set("s","HEAD_FILESIZE", mi18n("Größe") );
$tpl->set("s","HEAD_COUNTER", mi18n("Downloads") );
// run file list
$image_id = 0;
while ($dllist_item = $dllist_collection->next() ) {
$image_id++;
// icon for file
$obj_icon->setSrc( uplGetFileIcon($dllist_item->get("filename")) );
//$obj_icon->setID("dlIco".$image_id);
$obj_icon->setID("iconDownload");
$str_file_description = "";
if (strlen($dllist_item->get("description"))> 0) {
$str_file_description = $dllist_item->get("description");
} else {
$str_file_description = mi18n("Linkbeschreibung fehlt");
}
// filename
$str_file_name = $dllist_item->get("filename");
$str_file_name_property = $obj_file_properties->getValue("upload",
$dllist_item->get("dirname").$dllist_item->get("filename"), "file", "medianame");
if (strlen($str_file_name_property) > 0) {
$str_file_name = $str_file_name_property;
}
// filecounter
$str_file_counter = "0";
$str_file_counter_property = $obj_file_properties->getValue("upload",
$dllist_item->get("dirname").$dllist_item->get("filename"), "file", "counter");
if ( strlen ($str_file_counter_property) > 0 ) {
$str_file_counter = $str_file_counter_property;
}
// file url
$str_file_url = $cfgClient[$client]["upl"]["htmlpath"] . $dllist_item->get("dirname") .
$dllist_item->get("filename");
if ( isset($dllist_idart) && !empty($dllist_idart) && (int)$dllist_idart > 0 ) {
$str_file_url = $sess->url("front_content.php?idart=" . $dllist_idart . "&changelang=" . $lang .
"&client=" . $client . "&sse_idupl=" . $dllist_item->get("idupl") );
}
// fill template
$tpl->set("d", "FILE_ICON", $obj_icon->toHTML());
$tpl->set("d", "FILE_NAME", $str_file_name );
$tpl->set("d", "FILE_TYPE", $dllist_item->get("filetype") );
$tpl->set("d", "FILE_SIZE", human_readable_size($dllist_item->get("size")) );
$tpl->set("d", "FILE_COUNTER", $str_file_counter );
$tpl->set("d", "FILE_DESCRIPTION", $str_file_description );
$tpl->set("d", "FILE_URL", $str_file_url );
$tpl->next();
}
// set template
$str_template_name = "download_listreg.html";
if ( isset($dllist_idart) && !empty($dllist_idart) && (int)$dllist_idart > 0 ) {
$str_template_name = "download_listreg.html";
}
// print template
print $tpl->generate($cfgClient[$client]["tpl"]["path"] . $str_template_name, 1, 0);
} else {
$nonregmsg = "<p>".mi18n("Hinweis: Weitere Dokumente stehen Ihnen nach erfolgtem Login zur Verfügung.")."</p>";
if ( $warnnextmodulue == true ) {
$nonregmsg = "<p>".mi18n("Hinweis: Die Dokumente stehen Ihnen nach erfolgtem Login zur Verfügung.")."</p>";
}
}
}
print $nonregmsg;
?>