Seite 9 von 10

Re: Modul: Download Liste 4.6.

Verfasst: Fr 27. Feb 2009, 09:37
von baumpaul
Hallo ich wollte die Liste um eine Suche Erweitern, so wie ich das verstehe muss in dieser Zeile

Code: Alles auswählen

$dllist_collection->select($str_where_filetype . " dirname = '" . $dllist_path . "'","","filename $dllist_sort");
irgendetwas wie

Code: Alles auswählen

" filename = '%" . $suchestring . "%'
rein?

Übrigens gibt es ein Lösung dass in 4.8.11 auch der Medienname und die Description wieder ausgegeben wird?

Re: Modul: Download Liste 4.6.

Verfasst: Mi 27. Mai 2009, 00:27
von gassi
Hallo,
vielleicht weiss jemand von euch wieso ich auf meinem xampp system die Download Liste zum laufen bekommen habe. Und auf dem 1und1 Server nur folgendes erscheint?

Code: Alles auswählen

/homepages/xx/xxxxxxxxx/htdocs/contenido/cms/templates/download_list_counter.html
oder ohne counter

Code: Alles auswählen

/homepages/xx/xxxxxxxxx/htdocs/contenido/cms/templates/download_list.html

auf der Seite wo eigentlich die Tabelle kommen sollte - Konfigurieren kann ich alles...

Evtl. hat jemand das problem bei 1und1 schonmal gehabt oder ähnliches.... bin für jeden Tipp dankbar ....

Gruss Gassi

ps : System ist 4.811 mit AMR 0.54 (geht aber auch ohne AMR nicht) - 1und1 Webspace...

Re: Modul: Download Liste 4.6.

Verfasst: Mi 27. Mai 2009, 10:13
von Oldperl
Hallo Gassi,

nun weil auf dem 1und1 Server offensichtlich die Dateien download_list_counter.html und download_list.html entweder nicht vorhanden oder für Contenido nicht lesbar sind. Ich tippe auf den 1. Fall.

Gruß aus Franken

Ortwin

Re: Modul: Download Liste 4.6.

Verfasst: Mi 27. Mai 2009, 11:21
von gassi
Hi Ortwin,

vielen dank dein Tipp hats gebracht - Problem : Im Modul stand download_list.html - das Modul-Template hiess jedoch Download_list.html - mein xampp scheint gross/kleinschreibung eher zu ignorieren......
:oops:

Bis ich da drauf gekommen wäre...... danke nochma...

Gruss Gassi

Re: Modul: Download Liste 4.6.

Verfasst: Do 13. Mai 2010, 19:03
von matthiasschnueriger
Dieses Download-Modul war ja echt einfach zum installieren, danke sehr!
Gerne würde ich die Ausgabe erweitern und zwar mit dem Datum, wann die Datei das letzte mal verändert wurde.
Diese Info ist ja bei jedem Datei-Upload hinterlegt, wie krieg ich die in meine Ausgabe?

Re: Modul: Download Liste 4.6.

Verfasst: Fr 14. Mai 2010, 09:22
von Oldperl
Hallo Matthias,

indem du die entsprechende PHP-Funktion nutzt und eine Abfrage dafür einbaust.
:arrow: http://php.net/manual/de/function.filemtime.php

Oder du nutzt die Tabellenspalte 'lastmodified' aus der Upload-Tabelle in der DB und läßt diese anzeigen, wobei ich nicht genau weiß, ob da wirklich das Datum der letzten Bearbeitung der Datei, oder nicht eher das Datum der letzten Bearbeitung im BE eingetragen wird.

Gruß aus Franken

Ortwin

Re: Modul: Download Liste 4.6.

Verfasst: So 16. Mai 2010, 17:50
von matthiasschnueriger
Hallo Ortwin

Ich habe es jetzt über die Spalte "lastmodified" gelöst. Es nimmt das Datum der letzten Bearbeitung aus dem Backend und nicht die tatsächliche Bearbeitung der Datei, aber das ist in meinem Fall ok so.

Gruss
Matthias

Verzeichnisauswahl aktualisieren

Verfasst: Fr 25. Jun 2010, 00:43
von creamcandy
Hallo,

ich nutze das Modul unter 4.8.12. Es funktioniert alles, nur gelingt es mir nicht, das Dropdown mit der Darstellung des Verzeichnisses "upload" richtig zu aktualisieren. Es werden zwar neu hinzu gekommene Ordner irgendwann aufgelistet, aber auch Ordner, die schon seit langer Zeit verstorben sind. Wie kann ich die beseitigen? Cache und con_code leeren hat nichts geholfen ...

Ratlosen Gruß
Susanne

Re: Modul: Download Liste 4.6.

Verfasst: Mi 1. Sep 2010, 08:54
von Horst Wiese
Hallo,

gibt es eine Möglichkeit, die Downloadlist alphabetisch sortieren zu lassen?
Ich habe hier im Thread dazu nix gefunden ...

Danke,
Horst

Medienname

Verfasst: Mi 1. Sep 2010, 12:02
von Horst Wiese
Hallo nochmal ;-)
in der Contenido-Version 4.8.12 wird der Medienname ja leider nicht ausgelesen, wie ich bei der Suche durchs Forum erfuhr.
Die Lösungen dort sind für mich leider nicht mal eben auch auf das Downloadmodul übertragbar.
Gibt es da schon eine Löung,
Danke,
Horst

Re: Modul: Download Liste 4.6.

Verfasst: Do 9. Dez 2010, 13:33
von alderim
Hallo,
kann mir jemand einen Tipp geben wie ich bei zB. 20 Dateien nach 10 Dateien eine Möglichkeit zum blättern anbieten kann?

danke

Counter-Link ist nicht w3c valide

Verfasst: Mo 28. Feb 2011, 09:21
von derSteffen
Hallo,

leider bekomme ich es nicht hin, dass der Counter-Link anstatt & nur & schreibt.

Code: Alles auswählen

// 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") );    
   }
Obwohl hier schon & drin steht wird daraus immer &!

ich habe auch schon folgendes versucht:

Code: Alles auswählen

  $str_file_counter = eregi_replace("& ", "& ", $str_file_counter);
Aber leider auch kein Erfolg! Kann mir jemand einen Tipp geben?

Vielen Dank

MfG Steffen

Re: Modul: Download Liste 4.6.

Verfasst: Mi 2. Mär 2011, 10:34
von derSteffen
Mhm, ich kann hier versuchen was ich will. Irgendwie wird immer aus dem & ein &. Wird denn der Link noch irgendwo woanders generiert / zusammengesetzt?

MfG Steffen

Re: Modul: Download Liste 4.6.

Verfasst: Di 22. Nov 2011, 13:33
von pointnemo
Gibt es schon eine Lösung oder einen Ansatz zur Lösung zum Thema "Sortierung des Download Moduls"?
Vielen Dank!

Re: Modul: Download Liste 4.6.

Verfasst: Mi 13. Mär 2013, 10:18
von derSteffen
Hallo Gemeinde,

ich habe das Modul um eine Sortierung (Dateiname, Medienname, Erstellungsdatum, Änderungsdatum, Absteigen, Aufsteigend, Zufällig) in der Templatekonfiguration ergänzt, wobei leider "Medienname" und "Zufällig" noch nicht funktionert. wer hierfür einen Lösung hat. Bitte posten!

Im Template kann man nun auch anzeigen lassen, ob überhaupt eine Downloadliste angezeigt werden soll:

Input

Code: Alles auswählen

$Downloadzeigen="CMS_VALUE[8822]";
$Downloadsortierungnach="CMS_VALUE[8823]";
$Downloadsortierung="CMS_VALUE[8824]";

echo '<table cellspacing="0" cellpadding="2" border="0" width="100%"><tr><td><strong>Download-Bereich</strong><br /><br />Bitte wählen Sie, ob Sie in diesem Artikel einen Download-Bereich anzeigen lassen wollen. Sollte das der Fall sein, markieren Sie "Download-Bereich anzeigen" und wählen Sie den gewünschten Ordner mit den Dateien aus.<br /><br />'."\n";
if ($Downloadzeigen == "") {
   echo '<input type="radio" name="CMS_VAR[8822]" value="" id="nichtanzeigen" checked><label for="nichtanzeigen">'.mi18n("Kein Download-Bereich anzeigen").'&nbsp; </label><input type="radio" name="CMS_VAR[8822]" value="anzeigen" id="anzeigen"><label for="anzeigen">'.mi18n("Download-Bereich anzeigen").'&nbsp; </label>';
} else {
   echo '<input type="radio" name="CMS_VAR[8822]" value="" id="nichtanzeigen"><label for="nichtanzeigen">'.mi18n("Kein Download-Bereich anzeigen").'&nbsp; </label><input type="radio" name="CMS_VAR[8822]" value="anzeigen" id="anzeigen" checked><label for="anzeigen">'.mi18n("Download-Bereich anzeigen").'&nbsp; </label>';
}
echo '</td></tr>'."\n";
echo '<tr><td><br /><strong>Sortierung nach:</strong><br />'."\n";
if (($Downloadsortierungnach == "filename") || ($Downloadsortierungnach == "")) {
   echo '<input type="radio" name="CMS_VAR[8823]" value="filename" id="dateiname" checked><label for="dateiname">'.mi18n("Dateiname ").'&nbsp; </label><input type="radio" name="CMS_VAR[8823]" value="medianame" id="medienname"><label for="medienname">'.mi18n("Medienname").'&nbsp; </label><input type="radio" name="CMS_VAR[8823]" value="created" id="erstellungsdatum"><label for="erstellungsdatum">'.mi18n("Erstellungsdatum").'&nbsp; </label><input type="radio" name="CMS_VAR[8823]" value="modified" id="aenderungsdatum"><label for="aenderungsdatum">'.mi18n("&Auml;nderungsdatum").'&nbsp; </label>';
} else if ($Downloadsortierungnach == "medianame") {
   echo '<input type="radio" name="CMS_VAR[8823]" value="filename" id="dateiname"><label for="dateiname">'.mi18n("Dateiname").'&nbsp; </label><input type="radio" name="CMS_VAR[8823]" value="medianame" id="medienname" checked><label for="medienname">'.mi18n("Medienname").'&nbsp; </label><input type="radio" name="CMS_VAR[8823]" value="created" id="erstellungsdatum"><label for="erstellungsdatum">'.mi18n("Erstellungsdatum").'&nbsp; </label><input type="radio" name="CMS_VAR[8823]" value="modified" id="aenderungsdatum"><label for="aenderungsdatum">'.mi18n("&Auml;nderungsdatum").'&nbsp; </label>';
} else if ($Downloadsortierungnach == "created") {
   echo '<input type="radio" name="CMS_VAR[8823]" value="filename" id="dateiname"><label for="dateiname">'.mi18n("Dateiname").'&nbsp; </label><input type="radio" name="CMS_VAR[8823]" value="medianame" id="medienname"><label for="medienname">'.mi18n("Medienname").'&nbsp; </label><input type="radio" name="CMS_VAR[8823]" value="created" id="erstellungsdatum" checked><label for="erstellungsdatum">'.mi18n("Erstellungsdatum").'&nbsp; </label><input type="radio" name="CMS_VAR[8823]" value="modified" id="aenderungsdatum"><label for="aenderungsdatum">'.mi18n("&Auml;nderungsdatum").'&nbsp; </label>';
} else if ($Downloadsortierungnach == "modified"){
   echo '<input type="radio" name="CMS_VAR[8823]" value="filename" id="dateiname"><label for="dateiname">'.mi18n("Dateiname").'&nbsp; </label><input type="radio" name="CMS_VAR[8823]" value="medianame" id="medienname"><label for="medienname">'.mi18n("Medienname").'&nbsp; </label><input type="radio" name="CMS_VAR[8823]" value="created" id="erstellungsdatum"><label for="erstellungsdatum">'.mi18n("Erstellungsdatum").'&nbsp; </label><input type="radio" name="CMS_VAR[8823]" value="modified" id="aenderungsdatum" checked><label for="aenderungsdatum">'.mi18n("&Auml;nderungsdatum").'&nbsp; </label>';
}
echo '</td></tr>'."\n";
echo '<tr><td><br /><strong>Sortierung:</strong><br />'."\n";
if (($Downloadsortierung == "ASC") || ($Downloadsortierung == "")) {
   echo '<input type="radio" name="CMS_VAR[8824]" value="ASC" id="aufsteigend" checked><label for="aufsteigend">'.mi18n("Aufsteigend <em>(von alt nach neu, von A nach Z)</em>").'&nbsp; </label><input type="radio" name="CMS_VAR[8824]" value="DESC" id="absteigend"><label for="absteigend">'.mi18n("Absteigend <em>(von neu nach alt, von Z nach A)</em>").'&nbsp; </label><input type="radio" name="CMS_VAR[8824]" value="RAND" id="zufaellig"><label for="zufaellig">'.mi18n("Zuf&auml;llig").'&nbsp; </label>';
} else if ($Downloadsortierung == "DESC") {
   echo '<input type="radio" name="CMS_VAR[8824]" value="ASC" id="aufsteigend"><label for="aufsteigend">'.mi18n("Aufsteigend <em>(von alt nach neu, von A nach Z)</em>").'&nbsp; </label><input type="radio" name="CMS_VAR[8824]" value="DESC" id="absteigend" checked><label for="absteigend">'.mi18n("Absteigend <em>(von neu nach alt, von Z nach A)</em>").'&nbsp; </label><input type="radio" name="CMS_VAR[8824]" value="RAND" id="zufaellig"><label for="zufaellig">'.mi18n("Zuf&auml;llig").'&nbsp; </label>';
} else if ($Downloadsortierung == "RAND"){
   echo '<input type="radio" name="CMS_VAR[8824]" value="aufsteigend" id="aufsteigend"><label for="aufsteigend">'.mi18n("Aufsteigend <em>(von alt nach neu, von A nach Z)</em>").'&nbsp; </label><input type="radio" name="CMS_VAR[8824]" value="DESC" id="absteigend"><label for="absteigend">'.mi18n("Absteigend <em>(von neu nach alt, von Z nach A)</em>").'&nbsp; </label><input type="radio" name="CMS_VAR[8824]" value="RAND" id="zufaellig" checked><label for="zufaellig">'.mi18n("Zuf&auml;llig").'&nbsp; </label>';
}
echo '</td></tr>'."\n";
echo '</table>'."\n";
?>
Output:

Code: Alles auswählen

<?php
$Downloadzeigen="CMS_VALUE[8822]";
$Downloadsortierungnach="CMS_VALUE[8823]";
$Downloadsortierung="CMS_VALUE[8824]";

if ($Downloadzeigen== "") {
} else {

/***********************************************
* 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]");

// 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 DESC");
$dllist_collection->select($str_where_filenamefilter . $str_where_filetype . " dirname = '" . $dllist_path . "'","","$Downloadsortierungnach $Downloadsortierung");
	
// 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("file-name") );
$tpl->set("s","HEAD_FILETYPE", mi18n("file-typ") );
$tpl->set("s","HEAD_FILESIZE", mi18n("size") );
$tpl->set("s","HEAD_COUNTER", mi18n("<h3>downloads</h3>"));
$tpl->set("s","SUMMARY", mi18n("Table of Files and Folder for Download") );
$tpl->set("s","CAPTION", mi18n("downloadlist") );
$tpl->set("s","BACK", mi18n("&#171; back") );
$tpl->set("s","HEAD_FILECREATED", mi18n("Created") );
$tpl->set("s","HEAD_FILEMODIFIED", mi18n("Last edit") ); 

// run file list
$image_id = 0;
$filetypname = mi18n("file-type ");

while ($dllist_item = $dllist_collection->next() ) {
   $image_id++;
   
   // icon for file
   $obj_icon->setSrc( uplGetFileIcon($dllist_item->get("filename")) );
   $obj_icon->updateAttributes(array ("alt" => "$filetypname"));
   $obj_icon->setID("dlIco".$image_id);
   
   // file description
   $str_file_description = "";
   if (strlen($dllist_item->get("description"))> 0) {
      $obj_description->setContent($dllist_item->get("description"));
      $obj_description->setClass("fileDescription");
      $obj_description->removeAttribute("id"); 
      $obj_description->removeAttribute("class");
      $str_file_description = $obj_description->toHTML();      
   }
   
   // 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;
   }
   
   // VL Medienname auslesen ab 4.8.8
    $query= "SELECT medianame,description FROM " . $cfg["tab"]["upl_meta"] . " WHERE idupl = " . $dllist_item->get("idupl");
    $result = mysql_query($query);
    
    $medianame = "";
    if ($row= mysql_fetch_array($result)) {
    $medianame = $row['medianame'];
    $file_description = $row['description'];
    }
    if (strlen($medianame) > 0) {
    $str_file_name = htmlspecialchars(urldecode($medianame));
    }
    
    $medianame_old = "";
    $medianame_old = $obj_file_properties->getValue("upload", $dllist_item->get("dirname").$dllist_item->get("filename"), "file", "medianame");
    if (strlen($medianame_old) > 0) {
    $str_file_name = $medianame_old;
    }
   
   // 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") );
}

// file time
   $str_file_modified = "";
   $str_file_created = "";
   if ( file_exists($cfgClient[$client]["upl"]["path"] . $dllist_item->get("dirname") . $dllist_item->get("filename")) ) {
      // $str_file_modified = date("d.m.Y H:i", filemtime($cfgClient[$client]["upl"]["path"] . $dllist_item->get("dirname") . $dllist_item->get("filename") ));
      // $str_file_created  = date("d.m.Y H:i", filectime($cfgClient[$client]["upl"]["path"] . $dllist_item->get("dirname") . $dllist_item->get("filename") ));
	  $str_file_modified = date("d.m.Y", filemtime($cfgClient[$client]["upl"]["path"] . $dllist_item->get("dirname") . $dllist_item->get("filename") ));
      $str_file_created  = date("d.m.Y", filectime($cfgClient[$client]["upl"]["path"] . $dllist_item->get("dirname") . $dllist_item->get("filename") ));
   }
   
   // fill template
   $tpl->set("d", "FILE_ICON", $obj_icon->toHTML() . '&nbsp;');
   $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->set("d", "FILE_INFO1", mi18n("is a") );
   $tpl->set("d", "FILE_INFO2", mi18n("-file and") );
   $tpl->set("d", "FILE_INFO3", mi18n("large") );
   $tpl->set("d", "FILE_TYPE_INFO", mi18n("Info: File-Type") );
   $tpl->set("d", "FILE_SIZE_INFO", mi18n("File-Size") );
   $tpl->set("d", "FILE_COUNTER_INFO", mi18n("Downloads") );
   $tpl->set("d", "FILE_INFO0", mi18n("Please click to open / save") );
   $tpl->set("d", "FILE_FILECREATED", mi18n("Created") );
   $tpl->set("d", "FILE_FILEMODIFIED", mi18n("Last edit") );
   $tpl->set("d", "FILE_CREATED", $str_file_created);
   $tpl->set("d", "FILE_MODIFIED", $str_file_modified );  
   $tpl->set("d", "FILE_DATE", $str_filetime_modified ); 
   $tpl->set("d", "xxx", mi18n("xx") );

   
   $tpl->next();
}

// set template
$str_template_name = "download_list.html";
if ( isset($dllist_idart) && !empty($dllist_idart) && (int)$dllist_idart > 0 ) {
   $str_template_name = "download_list_counter.html";
}

// print template
print $tpl->generate($cfgClient[$client]["tpl"]["path"] . $str_template_name, 1, 0);
};
Achso: Läuft bei mir in einer 4.8.18 mit AMR!

MfG Steffen