[GH-ISSUE #184] View dirSize instead of word "Folder" #128

Closed
opened 2026-03-02 15:56:01 +03:00 by kerem · 1 comment
Owner

Originally created by @EV-soft on GitHub (Jun 7, 2019).
Original GitHub issue: https://github.com/prasathmani/tinyfilemanager/issues/184

I have some suggestions for improvement:

tinyfilemanager.php version 2.3.6:

A: Show dirsize & align-right: ---------------
Change line:
1709    <td><?php echo lng('Folder') ?></td>
to:
1709    <td style="text-align:right;" title= "<?php $inf= dirSize($path . '/' . $f); echo 'Total: '.$inf[1].' ',lng('Files'); ?>"> <?php echo fm_get_filesize($inf[0]) ?></td> 

and:
1758    <td><span title="<?php printf('%s bytes', $filesize_raw) ?>"><?php echo $filesize ?></span></td>
to:
1758    <td style="text-align:right;"><span title="<?php printf('%s bytes', $filesize_raw) ?>"><?php echo $filesize ?></span></td>

and add near file end:
function dirSize($directory) {
    $size = 0;  $count= 0;
    foreach(new RecursiveIteratorIterator(new RecursiveDirectoryIterator($directory)) as $file)
    if ($file->isFile())  // Added EV-soft
    {
        $size+=$file->getSize();
        $count++;
    }
    return [$size,$count];
}


B: Adding custom icon in navbar ---------------
Add before:
2811    <a class="navbar-brand" href=""> <?php echo lng('AppTitle') ?> </a>
so:
2811    <?php echo $cust_icon ?>  
2812    <a class="navbar-brand" href=""> <?php echo lng('AppTitle') ?> </a>
        

after:
72      $root_path = $_SERVER['DOCUMENT_ROOT'];
add new:
++:     // Insert custom text/icon in navbar before AppTitle:
++:     $cust_icon = '<img src= "'.substr($root_path,0,strpos($root_path,'_assets'))'/saldi-e/_assets/images/saldi-e50x170.png " alt="SALDI-€" height="20" style="top:-1px; position:absolute;" >';  //  Example

C: And here are a danish translation: ---------------
   {
     "name": "Dansk",
     "code": "da",
     "translation": {
       "AppName": "Tiny File Manager",
       "AppTitle": "Fil Manager",
       "Login": "Log ind",
       "Username": "Brugernavn",
       "Password": "Password",
       "Logout": "Log ud",
       "Move": "Flyt",
       "Copy": "Kopier",
       "Save": "Gem",
       "SelectAll": "Vælg alle",
       "UnSelectAll": "Fravælg alle",
       "File": "Fil",
       "Back": "Tilbage",
       "Size": "Størrelse",
       "Perms": "Tilladelser",
       "Modified": "Ændret",
       "Owner": "Ejer",
       "Search": "Søg filnavn",
       "NewItem": "Nyt Element",
       "Folder": "Mappe",
       "Delete": "Slet",
       "Rename": "Omdøb",
       "CopyTo": "Kopier til",
       "DirectLink": "Direkte link",
       "UploadingFiles": "Oploader filer",
       "ChangePermissions": "Ændre tilladelser",
       "Copying": "Kopierer",
       "CreateNewItem": "Opret nyt emne",
       "Name": "Navn",
       "AdvancedEditor": "Avanceret Editor",
       "RememberMe": "Husk mig",
       "Actions": "Handling",
       "Upload": "Opload",
       "Cancel": "Afbryd",
       "InvertSelection": "Omvend valg",
       "DestinationFolder": "Mål mappe",
       "ItemType": "Filtype",
       "ItemName": "Filnavn",
       "CreateNow": "Opret nu",
       "Download": "Download",
       "Open": "Åben",
       "UnZip": "Udpak",
       "UnZipToFolder": "Udpak i mappe",
       "Edit": "Rediger",
       "NormalEditor": "Standard Editor",
       "BackUp": "Backup",
       "SourceFolder": "Kilde mappe",
       "Files": "Filer",
       "Change": "Ændre",
       "Settings": "Indstillinger",
       "Language": "Sprog"
     }
   },

```

Remark:
I think the key "Search" should display: "File search", because it not works, when i am in the Advanced editor
Originally created by @EV-soft on GitHub (Jun 7, 2019). Original GitHub issue: https://github.com/prasathmani/tinyfilemanager/issues/184 I have some suggestions for improvement: tinyfilemanager.php version 2.3.6: ``` A: Show dirsize & align-right: --------------- Change line: 1709 <td><?php echo lng('Folder') ?></td> to: 1709 <td style="text-align:right;" title= "<?php $inf= dirSize($path . '/' . $f); echo 'Total: '.$inf[1].' ',lng('Files'); ?>"> <?php echo fm_get_filesize($inf[0]) ?></td> and: 1758 <td><span title="<?php printf('%s bytes', $filesize_raw) ?>"><?php echo $filesize ?></span></td> to: 1758 <td style="text-align:right;"><span title="<?php printf('%s bytes', $filesize_raw) ?>"><?php echo $filesize ?></span></td> and add near file end: function dirSize($directory) { $size = 0; $count= 0; foreach(new RecursiveIteratorIterator(new RecursiveDirectoryIterator($directory)) as $file) if ($file->isFile()) // Added EV-soft { $size+=$file->getSize(); $count++; } return [$size,$count]; } B: Adding custom icon in navbar --------------- Add before: 2811 <a class="navbar-brand" href=""> <?php echo lng('AppTitle') ?> </a> so: 2811 <?php echo $cust_icon ?> 2812 <a class="navbar-brand" href=""> <?php echo lng('AppTitle') ?> </a> after: 72 $root_path = $_SERVER['DOCUMENT_ROOT']; add new: ++: // Insert custom text/icon in navbar before AppTitle: ++: $cust_icon = '<img src= "'.substr($root_path,0,strpos($root_path,'_assets'))'/saldi-e/_assets/images/saldi-e50x170.png " alt="SALDI-€" height="20" style="top:-1px; position:absolute;" >'; // Example ``` ```` C: And here are a danish translation: --------------- { "name": "Dansk", "code": "da", "translation": { "AppName": "Tiny File Manager", "AppTitle": "Fil Manager", "Login": "Log ind", "Username": "Brugernavn", "Password": "Password", "Logout": "Log ud", "Move": "Flyt", "Copy": "Kopier", "Save": "Gem", "SelectAll": "Vælg alle", "UnSelectAll": "Fravælg alle", "File": "Fil", "Back": "Tilbage", "Size": "Størrelse", "Perms": "Tilladelser", "Modified": "Ændret", "Owner": "Ejer", "Search": "Søg filnavn", "NewItem": "Nyt Element", "Folder": "Mappe", "Delete": "Slet", "Rename": "Omdøb", "CopyTo": "Kopier til", "DirectLink": "Direkte link", "UploadingFiles": "Oploader filer", "ChangePermissions": "Ændre tilladelser", "Copying": "Kopierer", "CreateNewItem": "Opret nyt emne", "Name": "Navn", "AdvancedEditor": "Avanceret Editor", "RememberMe": "Husk mig", "Actions": "Handling", "Upload": "Opload", "Cancel": "Afbryd", "InvertSelection": "Omvend valg", "DestinationFolder": "Mål mappe", "ItemType": "Filtype", "ItemName": "Filnavn", "CreateNow": "Opret nu", "Download": "Download", "Open": "Åben", "UnZip": "Udpak", "UnZipToFolder": "Udpak i mappe", "Edit": "Rediger", "NormalEditor": "Standard Editor", "BackUp": "Backup", "SourceFolder": "Kilde mappe", "Files": "Filer", "Change": "Ændre", "Settings": "Indstillinger", "Language": "Sprog" } }, ``` Remark: I think the key "Search" should display: "File search", because it not works, when i am in the Advanced editor
kerem 2026-03-02 15:56:01 +03:00
  • closed this issue
  • added the
    Request
    label
Author
Owner

@prasathmani commented on GitHub (Jul 23, 2019):

added folder size, thanks for sharing code @EV-soft

<!-- gh-comment-id:514090941 --> @prasathmani commented on GitHub (Jul 23, 2019): added folder size, thanks for sharing code @EV-soft
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/tinyfilemanager#128
No description provided.