Seite 7 von 10

Verfasst: Di 10. Apr 2007, 22:41
von stese
djavet hat geschrieben:Wie kann ich die Dartum einfügen ins Tabelle?
Modul Output von "Download List":

Suche:

Code: Alles auswählen

 // fill template
$tpl->set("d", "FILE_ICON", $obj_icon->toHTML() . ' ');
$tpl->set("d", "FILE_NAME", $str_file_name );
Ersetze durch;

Code: Alles auswählen

 // 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") ));
   }
   
   // fill template
   $tpl->set("d", "FILE_CREATED", $str_file_created);
   $tpl->set("d", "FILE_MODIFIED", $str_file_modified );
   $tpl->set("d", "FILE_ICON", $obj_icon->toHTML() . ' ');
   $tpl->set("d", "FILE_NAME", $str_file_name );
und für die Template Generierung der Überschriften:
Suche:

Code: Alles auswählen

// add head description
$tpl->set("s","HEAD_NAME", mi18n("Dateiname") );
$tpl->set("s","HEAD_FILETYPE", mi18n("Dateityp") );
Ersetze:

Code: Alles auswählen

// add head description
$tpl->set("s","HEAD_NAME", mi18n("Dateiname") );
$tpl->set("s","HEAD_FILETYPE", mi18n("Dateityp") );
$tpl->set("s","HEAD_FILECREATED", mi18n("Erstellt am") );
$tpl->set("s","HEAD_FILEMODIFIED", mi18n("Bearbeitet am") );
jetzt noch im HTML Template die beiden Platzhalter FILE_CREATED und FILE_MODIFIED hinzufügen (oder nur einen von beiden) und fertig:

Code: Alles auswählen

<!-- download module for contenido 4.6.x - for download visit www.polycoder.de -->
<table border="1">
   <thead>
      <tr>
      <th align="left">{HEAD_NAME}</th>
      <th>{HEAD_FILETYPE}</th>
      <th>{HEAD_FILESIZE}</th>
      <th>{HEAD_FILECREATED}</th>
      <th>{HEAD_FILEMODIFIED}</th>
      <th>{HEAD_COUNTER}</th>
      </tr>
   </thead>
   
   <tbody>
      <!-- BEGIN:BLOCK -->   
      <tr>
         <td>{FILE_ICON}<a href="{FILE_URL}">{FILE_NAME}</a>{FILE_DESCRIPTION}</td>
         <td>{FILE_TYPE}</td>
         <td>{FILE_SIZE}</td>
         <td>{FILE_CREATED}</td>
         <td>{FILE_MODIFIED}</td>
         <td>{FILE_COUNTER}</td>
      </tr>
      <!-- END:BLOCK -->
   </tbody>
   <tfoot></tfoot>
</table>

Verfasst: Mi 11. Apr 2007, 10:53
von djavet
Super! Danke vielmal.

Gruss, DOm

last_modified bei DBFS-Dateien

Verfasst: Do 12. Apr 2007, 11:11
von Thorsten G.
Hallo Stese,
ich hatte mich - so glaube ich - schon mal in diesem Thread für das tolle Modul bedankt.

Ich habe ein angepasstes Modul im Einsatz, das mir eine Downloadliste aus der DBFS generiert:

Code: Alles auswählen

// file url
   $str_file_url = "http://domain.de/dbfs.php?file=" . $dllist_item->get("dirname") . $dllist_item->get("filename");
   if ( isset($dllist_idart) && !empty($dllist_idart) && (int)$dllist_idart > 0 ) {
      $str_file_url = $sess->url("dbfs.php?idart=" . $dllist_idart . "&changelang=" . $lang .  "&client=" . $client . "&sse_idupl=" . $dllist_item->get("idupl") );
   }
Mit dieser Methode, das Datum abzufragen,

Code: Alles auswählen

// file time
   $str_file_modified = "";
   $str_file_created = "";
      $str_file_modified = date("d.m.Y H:i", filemtime($str_file_url));
      $str_file_created  = date("d.m.Y H:i", filectime($str_file_url));
bekomme ich diese Fehlermeldung

Code: Alles auswählen

Warning: filemtime(): Stat failed for http://domain.de/dbfs.php?file=dbfs:/dir/file.pdf (errno=2 - No such file or directory) in xxx
obwohl der String "http:// .... file.pdf" schon richtig ist. Liegt ja sicher daran, dass es ja gar kein physisches File ist!? Kann ich das Änderungsdatum unkompliziert aus der DB abfragen? Gibt es eine andere Möglichkeit? Hat da zufällig jemand ein schon fertiges Code-Schnippselchen für mich ... ? :roll:

Danke und Gruß

Problem Weise Seite !

Verfasst: Do 24. Mai 2007, 08:25
von cosmic
Moin ,

ansich echt nen schickes Modul aber leider rockt es bei mir nicht ganz. Die Fileliste wird zwar angezeigt aber wenn ich daraufklicke wird nur ne leere weise Seite angezeigt anstatt das file zu öffnen.

das Problem koennt ihr hier bestaunen :

http://www.auflegware.de/auflegware/cms ... 2&idart=41

I need dringend Help !

Verfasst: Di 11. Sep 2007, 16:01
von stefkey
Hallo,

wenn ich auf eine Datei zum downloaden klicke kommt nur die Fehlerseite.

Der Link in der Statuszeile ist zB:

front_content.php?idart=197&changelang=12&client=12&sse_idupl=548&contenido=b6779ed331


Was könnte der Fehler sein?

Grüße
stefkey

Verfasst: Mo 17. Sep 2007, 08:41
von derSteffen
Hallo stese,

ich habe dein Download-Modul im Einsatz. Klappt toll - Danke nochmal. So nun habe ich hier ( http://www.contenido.org/forum/viewtopi ... 6&start=30 ) ein Downloadmodul gefunden, welches die Ordnerstruktur eines Verzeichnisses in der Dateiverwaltung auflistet. Dadurch kann man sich durchklicken bis zum gewünschten Dokument. Leider funktioniert dies nicht mit ModRewrite. Ich habe nun schon eine Woche hin und her getstest und versucht deine Version mit dieser zu koppeln. Leider ohne Erfolg. Dabei sind mir allerdings bei dem Modul von rok° aufgefallen, das die Leerzeichen in Dateinamen mit Underscores ausgefüllt werden und nicht wie bei dir optimal die Beschreibung ausgegeben wird. Desweiteren wird leider in der Auflistung der Downloadliste eine Datei (z.B. PDF) mitten zwischen den Ordnern aufgelistet, da die Sortierung alphabetisch erfolgt. das ist leider verwirrend, weil man dann denken könnte, dass das PDF zu dem Ordner gehört welches direkt über Ihm ist. Schöner wäre es, wenn alle Dokument getrennt von der Ordnerstruktur aufgelistet werden, zum Beispiel über allen Ordnern oder unter allen Ordner. Deswegen dachte ich mir wäre es vielleicht günstiger zu versuchen dein Modul soweit zu erweitern. Allerdings fehlt mir dazu das nötige KnowHow. Wäre denn diese Umsetzung realisierbar? Oder hat schon jemand eine Lösung?

Vielen Dank im Vorraus schonmal

MfG Steffen

Weder Download noch Öffnen bei Download-Klick

Verfasst: Mo 1. Okt 2007, 18:41
von refalo
Hallo stese!

Das Uploaden über die Dateiverwaltung (Contenido 4.6.15), eingeloggt als 2. Mandant (ins upload/-Verzeichnis des 2. Mandanten) funktioniert bei mir: Über FTP sehe ich, dass die entsprechende Datei auf dem Server im richtigen Verzeichnis (?) angekommen ist: .../mandant2/upload/test.txt.
Ich gebe der Datei auch noch volle Linux-Rechte. Ich kann sie auch in der Vorschau dort anzeigen/öffnen. :!:

Die hochgeladene .txt-Datei wird in der Downloadliste (MIT COunterspalte) im Frontend angezeigt (Firefox 2.0.0.6). Aber: Wenn ich draufklicke, passiert nix, d.h. es wurde keine Datei heruntergeladen und auch nicht versucht, sie zu öffnen.

Der Download-Link sieht etwa so aus:
http://meine.domain.de/front_content.ph ... _idupl=230

Der Link verweist "im Prinzip" wieder auf die gleiche Seite (wie man in einem neuen FF-Tabulator-Fenster sehen kann).

Hast Du eine Idee, woran das liegen könnte? Lässt man die Counter-Spalte weg (also ohne idart in der entsprechenden Artikel-Konfiguration), werden andere, intuitiv richtige Links erzeugt (welche funktionieren). Sie sehen etwa so aus:
http://meine.domain.de/upload/test.txt

Danke für Hilfe und Gruß, refalo.

Sorry! Bedieunungsanleitung lesen lohnt oft!!!

Verfasst: Mi 3. Okt 2007, 15:05
von refalo
Das war's!!!
:oops:

Nachdem ich einen weiteren Artikel mit dem Template "Download File" (mit dem "Download File"-Layout samt "Download File"-Container drin) in dieselbe Kategorie (also mit dem "Download List"-Artikel drin) hinzugefügt habe und die idart des "Download File"-Artikels in die Konfiguration des "Download List"-Artikels hinzugefügt habe, geht alles.
:D :o 8) :lol: :P :wink: :!: :idea:

Sorry, Danke und Gruß, refalo.
:oops:

Verfasst: Mo 7. Jan 2008, 20:03
von Averna
Hallo an alle,

also ich habe heute vergeblich versucht das Modul zum Fliegen zu bringen.
Alles funktioniert prima bis zu dem Zeitpunkt, an dem ich eine Datei aus der Liste anklicke. Dann erscheint bloß eine schneeweise Seite und IE / FF melden "fertig".

Testdatei habe ich im "downloads"-Ordner sowohl auf dem FTP als auch as dbfs angelegt. chmod auch schon auf 777 gesetzt. Weiss keinen Rat mehr...

(Contenido Release 4.6.23)

Hat jemand eine Idee woran das liegen könnte?

Viele Güße und frohes neues Jahr :-)

Re: last_modified bei DBFS-Dateien

Verfasst: Mi 9. Jan 2008, 23:07
von OliverL
Thorsten G. hat geschrieben: $str_file_modified = date("d.m.Y H:i", filemtime($str_file_url));
$str_file_created = date("d.m.Y H:i", filectime($str_file_url));[/code]
filemtime() ist natürlich eine File-Funktion die auf DB-Daten nicht funktioniert.

Liste funktioniert bei mir unter 4.6.23


1. Habe mal dem Input einen kleinen Design-Flash gegeben
2. Liste mit Login-Schutz mit rechte übergabe durch Gruppen
3. modified & created-date aus der Datenbank um DBFS zunutzen
4. Verlinkung über dbfs.php (Download File nicht getestet)

Beschreibung

Code: Alles auswählen

Download List
Generate a List of all downloadable files in a custom "upload"-dir based directory

Autor: Stefan Seifarth <info@polycoder.de>
Version: 1.2
Modified: 2008-01-09, Oliver Lohkemper (Login-Check)
Features:
- set download directory with simple drop down
- count downloads (see module "Download File")
- you can define file extensions which are be visible,
  all other files in this directory won't be shown.
- you can use windows wildcard filter for different selection of files
- get specific download information such metaname and description
- set Display-Typ: display, hidden and after login

Important:
Modul use the database entries from the contenido file-management
and don't search physical webspace!
Eingabe

Code: Alles auswählen

?>
<?php
/***********************************************
* CONTENIDO MODUL - INPUT
*
* Modulname  :    Download List
* Author(s)  :    Stefan Seifarth <info@polycoder.de>
* Copyright  :    www.polycoder.de / www.htcm.de
* Created    :    2006-01-07
* Modified   :    2008-01-09, Oliver Lohkemper (Login-Check)
************************************************/

# CMS VAR  1 = Display-Typ
# CMS VAR  2 = fegroup

cInclude("classes", "class.frontend.groups.php");
cInclude ("classes", "class.upload.php");

$fegroups = new FrontendGroupCollection;
$fegroups->select("idclient = '$client'","", "groupname ASC");


// get all directories from database
$dllist_collection = new UploadCollection ();
$dllist_collection->select("idclient='".$client."'","dirname","dirname ASC");

$arr_found_dirs = array();
$arr_dirs = array();
while ( $dllist_item = $dllist_collection->next() ) {
   $arr_found_dirs[] = $dllist_item->get("dirname");
}

$i = 0;
foreach ($arr_found_dirs as $str_dir) {
   $arr_current_dir =  explode("/",$str_dir );
   array_pop($arr_current_dir);
   
   $depth = count($arr_current_dir);
   
   if ( $depth == 0 ) {
      $arr_dirs[$i]["name"] = str_replace("/", "", $cfgClient[$client]["upload"]);
   } else {
      $arr_dirs[$i]["name"] = $arr_current_dir[$depth-1];
   }
   $arr_dirs[$i]["depth"] = $depth;
   $arr_dirs[$i]["path"] = $str_dir;
   $arr_dirs[$i]["indent"] = "";
   
   for ($z = 1; $z <= $depth; $z ++) {
      # 3 blanks for every level
      $arr_dirs[$i]["indent"] .= "&nbsp;&nbsp;&nbsp;";
   }
   
   $i++;
}
?>



<table cellspacing="0" cellpadding="2" border="0" width="100%">

<!-- directory selectbox -->
  <tr>
    <td style="padding-top: 2px; width: 50px;" class="text_medium"><b><?php echo mi18n("Verzeichnis:"); ?></b></td>
    <td style="padding-top: 2px;">
    <?php
        // print out directory selectbox
        $str_predefined = trim("CMS_VALUE[110]");
        print '<select name="CMS_VAR[110]" class="text_medium" style="width: 100%;">' . "\n";
        // output of all found directories
        foreach ( $arr_dirs  as $arr_dir ) {
           $str_selected = "";
           if ( $str_predefined == $arr_dir["path"] ) $str_selected = ' selected="selected"';
   
           print '<option value="' . $arr_dir["path"] . '"' . $str_selected . '>' . $arr_dir["indent"] . $arr_dir["name"] . '</option>' . "\n";
        }
        print '</select>' . "\n";
        ?>
    </td>
  </tr>
  <tr>
    <td style="padding-top: 2px;" colspan="2" class="text_medium">
       <?php echo mi18n("Verzeichnis für Downloads auswählen."); ?>
    </td>
  </tr>
  <tr>
    <td style="padding-top: 2px;" colspan="2" class="text_medium">&nbsp;</td>
  </tr>

<!-- fileextensions -->
  <tr>
    <td style="padding-top: 2px;" class="text_medium"><b><?php echo mi18n("Dateiendungen:"); ?></b></td>
    <td style="padding-top: 2px;"><input type="text" name="CMS_VAR[111]" value="CMS_VALUE[111]" style="width: 100%;" class="text_medium"></td>
  </tr>
  <tr>
    <td style="padding-top: 2px;" colspan="2" class="text_medium">
       <?php echo mi18n("leergelassen = alle Dateien"); ?><br>
       <?php echo mi18n("mehrere Dateitypen durch Komma abtrennen"); ?><br>
       <?php echo mi18n("z.B.:"); ?> pdf,jpg,txt
    </td>
  </tr>
  <tr>
    <td style="padding-top: 2px;" colspan="2" class="text_medium">&nbsp;</td>
  </tr>

<!-- Filter -->
  <tr>
    <td style="padding-top: 2px;" class="text_medium"><b><?php echo mi18n("Dateifilter:"); ?></b></td>
    <td style="padding-top: 2px;"><input type="text" name="CMS_VAR[113]" value="CMS_VALUE[113]" style="width: 100%;" class="text_medium"></td>
  </tr>
  <tr>
    <td style="padding-top: 2px;" colspan="2" class="text_medium">
       <?php echo mi18n("leergelassen = alle Dateien"); ?><br>
       <?php echo mi18n("Filter wie unter Windows nutzen."); ?><br>
       * = <?php echo mi18n("mehrere Zeichen"); ?><br>
       ? = <?php echo mi18n("ein Zeichen"); ?><br>
       ; = <?php echo mi18n("Trennzeichen für mehrere Filter"); ?><br>
       <?php echo mi18n("z.B.:"); ?> ?datei*.*;datei_00?.*
    </td>
  </tr>
  <tr>
    <td style="padding-top: 2px;" colspan="2" class="text_medium">&nbsp;</td>
  </tr>

<!-- download article -->
  <tr>
    <td style="padding-top: 2px;" class="text_medium"><b><?php echo mi18n("Downloadzähler:"); ?></b></td>
    <td style="padding-top: 2px;"><input type="text" name="CMS_VAR[112]" value="CMS_VALUE[112]" style="width: 30px;" class="text_medium"></td>
  </tr>
  <tr>
    <td style="padding-top: 2px;" colspan="2">
       <?php echo mi18n("idart = idart des Downloadzähler-Artikel (inkl. Download-File-Modul)"); ?><br>
       <?php echo mi18n("leergelassen = Download ohne Zähler"); ?>
    </td>
  </tr>
  <tr>
    <td style="padding-top: 2px;" colspan="2" class="text_medium">&nbsp;</td>
  </tr>

<!-- login check or not -->
  <tr>
    <td style="padding-top: 2px;"><b><?php echo mi18n("Display:"); ?></b></td>
    <td>
        <select name="CMS_VAR[1]" class="text_medium" style="width: 100%;">
          <option onClick="document.getElementById('komentar_feu_group').style.display = 'none';" value="1"<?php  echo ("CMS_VALUE[1]"=='1' ? ' selected' : ''); ?>><?php echo mi18n("Hidden"); ?></option>
          <option onClick="document.getElementById('komentar_feu_group').style.display = 'none';" value="2"<?php  echo ("CMS_VALUE[1]"=='2' ? ' selected' : ''); ?>><?php echo mi18n("Display"); ?></option>
          <option onClick="document.getElementById('komentar_feu_group').style.display = 'block';" value="3"<?php  echo ("CMS_VALUE[1]"=='3' ? ' selected' : ''); ?>><?php echo mi18n("FEU"); ?></option>
        </select>
      <div id="komentar_feu_group" style="display: <?php echo ("CMS_VALUE[1]"== "3" ? 'block' : 'none'); ?>;">
      <table width="100%"  border="0" cellspacing="0" cellpadding="0">
         <tr>
            <td><?php echo mi18n("Frontendgroup"); ?>:</td>
         </tr>
        <tr>
         <td>
              <select size="5" onchange="var myValue = ''; for( i = 0; i < this.options.length; i++ ) { if( this.options[i].selected ) myValue += ','+this.options[i].value; } document.getElementById('cmsVar2').value = myValue.substr(1);" class="text_medium" style="width: 100%;" multiple="multiple">
            <?php
            $mySelectedGroups = explode(',', "CMS_VALUE[2]");
            while ($fegroup = $fegroups->next()) {
               $groupname = $fegroup->get("groupname");
               $idfegroup = $fegroup->get("idfrontendgroup");
               echo '<option value="'.$idfegroup.'"'.( in_array($idfegroup, $mySelectedGroups) ? ' selected' : '' ).'>'.$groupname.'</option>';
            }
            ?>
            </select>
         <input id="cmsVar2" name="CMS_VAR[2]" type="hidden" value="CMS_VALUE[2]">
         </td>
        </tr>
      </table>
      </div>
    </td>
  </tr>
</table>

<?php
Ausgabe

Code: Alles auswählen

<?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   :    2008-01-09, Oliver Lohkemper (Login-Check)
************************************************/
cInclude ("classes", "class.upload.php");
cInclude ("classes", "class.properties.php");
cInclude ("classes", "class.htmlelements.php");
cInclude ("includes", "functions.upl.php");
cInclude("classes", "class.frontend.groups.php");
cInclude('classes', 'class.template.php');


$tpl = new Template;
$feuser = new FrontendUser;
$feuser->loadByPrimaryKey($auth->auth['uid']);

$Settings = array();
$Settings['viewtyp'] = "CMS_VALUE[1]";
$Settings['access_groups'] = explode(',', "CMS_VALUE[2]");
$Settings['feuser_groups'] = $feuser->getGroupsForUser();
$Settings['access'] = "0";
$Settings['feuser']['name'] = $feuser->getField('username');

if( !$Settings['viewtyp'] ) {
   // Default für alle Artikel die keine Settings haben
   $Settings['viewtyp'] = 2;
}
elseif( $Settings['viewtyp'] == 3 ) {
   // Prüfen ob der User in einer er ausgewählten Gruppen ist
   $Settings['access'] = (count( array_intersect( $Settings['feuser_groups'], $Settings['access_groups'] ) ) ? 1 : 0);
}

if(    $Settings['viewtyp'] == 2
   OR ( $Settings['viewtyp'] == 3 AND $Settings['access'] == 1 ) ) {


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

// 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") );
$tpl->set("s","HEAD_FILECREATED", mi18n("Erstellt am") );
$tpl->set("s","HEAD_FILEMODIFIED", mi18n("Bearbeitet am") ); 

// 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);
   
   // file description
   $str_file_description = "";
   if (strlen($dllist_item->get("description"))> 0) {
      $obj_description->setContent($dllist_item->get("description"));
      $obj_description->setClass("fileDescription");
      $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;
   }
   
   // 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
   if(substr($dllist_item->get("dirname"), 0,5) != "dbfs:") {
      $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") );
      }
   }
   else {
      $str_file_url = $cfgClient[$client]["path"]["htmlpath"] . "dbfs.php?file=" . substr($dllist_item->get("dirname"),6) . $dllist_item->get("filename");
      if ( isset($dllist_idart) && !empty($dllist_idart) && (int)$dllist_idart > 0 ) {
         $str_file_url = $sess->url("dbfs.php?idart=" . $dllist_idart . "&changelang=" . $lang .  "&client=" . $client . "&sse_idupl=" . $dllist_item->get("idupl") );
      }
   } 

 // file time   
   $str_file_modified = "";
   $str_file_created = "";

      $str_file_modified = split( "[- :]", $dllist_item->get("created") );
      $str_file_created  = split( "[- :]", $dllist_item->get("lastmodified") );
      
      $str_file_modified = mktime($str_file_modified[3], $str_file_modified[4], $str_file_modified[5], $str_file_modified[2], $str_file_modified[1], $str_file_modified[0] );
      $str_file_created  = mktime($str_file_created[3], $str_file_created[4], $str_file_created[5], $str_file_created[2], $str_file_created[1], $str_file_created[0] );
      
      $str_file_modified = date("d.m.Y H:i", $str_file_created);
      $str_file_created  = date("d.m.Y H:i", $str_file_modified);

   
   // 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_CREATED", $str_file_created);
   $tpl->set("d", "FILE_MODIFIED", $str_file_modified ); 
   
   $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);




}
elseif( $Settings['viewtyp'] == 3 ) {
   echo mi18n("Bitte einloggen.");
} 
?>
download_list.html

Code: Alles auswählen

<!-- download module for contenido 4.6.x - for download visit www.polycoder.de -->
<table border="1">
   <thead>
      <tr>
      <th align="left">{HEAD_NAME}</th>
      <th>{HEAD_FILETYPE}</th>
      <th>{HEAD_FILESIZE}</th>
      <th>{HEAD_FILECREATED}</th>
      <th>{HEAD_FILEMODIFIED}</th>
      </tr>
   </thead>
   
   <tbody>
      <!-- BEGIN:BLOCK -->   
      <tr>
         <td>{FILE_ICON}<a href="{FILE_URL}">{FILE_NAME}</a>{FILE_DESCRIPTION}</td>
         <td>{FILE_TYPE}</td>
         <td>{FILE_SIZE}</td>
         <td>{FILE_CREATED}</td>
         <td>{FILE_MODIFIED}</td>
      </tr>
      <!-- END:BLOCK -->
   </tbody>
   <tfoot></tfoot>
</table>

wenn stese die Änderunge an nimmt (publiziertz)
entferne ich den Code um diesen wichtigen Beitrag nicht zuzumüllen

mfg oli

Verfasst: Mo 21. Jan 2008, 13:49
von stefkey
hier die Modifikation vom Modul "Download List" für eine Sortierung nach Erstelldatum:

statt filename -> created :

// get list of all files
$dllist_collection = new UploadCollection ();
if (CMS_VALUE[114] == 0){
$dllist_collection->select($str_where_filenamefilter . $str_where_filetype . " dirname = '" . $dllist_path . "'","","created ASC");
}else{
$dllist_collection->select($str_where_filenamefilter . $str_where_filetype . " dirname = '" . $dllist_path . "'","","created DESC");
}


Besten Dank an mauskugel !
stefkey

Verfasst: Mi 20. Feb 2008, 10:20
von stefkey
Hallo,

ich habe in meiner Downloadliste auch das Erstelldatum angezeigt. Nach einem Server Wechsel und erfolgreicher Migration ist das Datum allerdings das Datum wo ich die Datei auf den neuen Server hochgeladen habe.

Gibt es eine Möglichkeit das Datum das zu manipulieren? Oder ist vielleicht das Datum in der Datenbank abgelegt?


Grüße
stefkey

Verfasst: Mi 20. Feb 2008, 10:36
von OliverL
Soaaa!

Die Daten werden aus der DB genommen, ist aber nicht gut die Daten nur in der DB zuändern, hab keine Ahnung was die Datei-synkronisierung (in der Dateiverwaltung des Backend's) macht.

Du solltest dir mal den Befehl touch() anschauen und nach dem touch die DB anpassen.

touch() - http://de3.php.net/touch
(PHP 4, PHP 5)
touch — Setzt die Zugriffs- und Modifizierungszeit einer Datei
Beschreibung
int touch ( string $filename [, int $time [, int $atime ]] )
...
Wenn die Datei nicht existiert, wird sie erzeugt.
...

Verfasst: Fr 21. Mär 2008, 13:58
von alderim
Hallo Zusammen,
erstmal DANKE für das Modul, es funzt super!

Frage:
Kann ich dem Download-Admin in der Dateierwaltung im Backend ausschließlich die Datei-Ordner anzeigen lassen, in die er auch Dateien hochladen darf?

Danke für einen Hinweis und frohe Ostern,
A.

DANKE ERLEDIGT, osternest gefunden:
http://contenido.org/forum/viewtopic.php?t=12943

Verfasst: Sa 22. Mär 2008, 18:35
von alderim
eine Frage noch:

Wenn ich Download-Ordner per FTP anlege (safe_mode on), erscheinen diese nicht im Konfigurations-dropdown des Moduls.
Wie kann ich diese Ordnerstruktur re-setten bzw. neu generieren lassen, damit ich die neu anglegeten Ordner nutzen kann?

danke für einen Tipp,
A.