} elseif (!empty($fileobj->fileinfo['desc'])) { $systemdesc = $fileobj->fileinfo['desc']; } # Stop JS/HTML insertion $systemdesc = strip_tags($systemdesc); # Get thumbnail $thumbpath = bh_thumbnail($file['filepath'], 128); if ($thumbpath == false) { $thumbpath = $this->geticon($file['filepath'], 128); } if (empty($bhconfig['defaultfilemodule'])) { $defaultfilemodule = "viewfile"; } else { $defaultfilemodule = $bhconfig['defaultfilemodule']; } if ($fileobj->is_dir() == true) { $str .= "<td align='center'>\n\t\t\t<table><tr height='128'><td style='border: 1px solid gray;' width='128' valign='middle' align='center'><a href='index.php?page=viewdir&filepath=" . $file['filepath'] . "'><img src='" . $thumbpath . "' border='0'></a></td></tr>\n\t\t\t<tr><td align='center' width='128'><a href='index.php?page=viewdir&filepath=" . $file['filepath'] . "' class='filenamelink'>" . $file['filename'] . "</a><br><font color='gray'>" . $systemdesc . "<br>" . $fileobj->numberfiles() . $bhlang['label:_files'] . "<br></font></td></tr></table></td>"; } else { $str .= "<td align='center'>\n\t\t\t<table><tr height='128'><td style='border: 1px solid gray;' width='128' valign='middle' align='center'><a href='index.php?page={$defaultfilemodule}&filepath=" . $file['filepath'] . "'><img src='" . $thumbpath . "' border='0'></a></td></tr>\n\t\t\t<tr><td align='center' width='128'><a href='index.php?page={$defaultfilemodule}&filepath=" . $file['filepath'] . "' class='filenamelink'>" . $file['filename'] . "</a><br><font color='gray'>" . $systemdesc . "<br>" . bh_humanfilesize($file['filesize']) . "<br></font></td></tr></table></td>"; } if ($even == 2) { $str .= "</tr>"; $even = -1; } $even++; } } if ($even = 0) { $str .= "<td width='50'></td><td></td></tr>"; } $str .= "\t\t</table><br>\n\t\t</td>\n\t\t<td width='10' background='" . $this->skinpath . "images/sidebar/rc.png'> </td>\n\t</tr>\n\t<tr height='10'>\n\t\t<td width='10'><img src='" . $this->skinpath . "images/sidebar/bl.png'></td>\n\t\t<td background='" . $this->skinpath . "images/sidebar/bc.png'></td>\n\t\t<td width='10'><img src='" . $this->skinpath . "images/sidebar/br.png'></td>\n\t</tr>\n</table>\n";
# Get system's description of file on *nix systems. if (bh_os() == "nix") { $cmdstr = "file -b " . escapeshellarg($fileobj->absfilepath); $systemdesc2 = `{$cmdstr}`; $systemdescarray = explode(",", $systemdesc2); $systemdesc = $systemdescarray[0]; $systemdesc[0] = strtoupper($systemdesc[0]); } else { $systemdesc = strtoupper(bh_get_extension($file['filepath'])) . " file"; } # Get any possible description from metadata if (!empty($fileobj->fileinfo['description'])) { $systemdesc = $fileobj->fileinfo['description']; } elseif (!empty($fileobj->fileinfo['desc'])) { $systemdesc = $fileobj->fileinfo['desc']; } # Stop JS/HTML insertion $systemdesc = strip_tags($systemdesc); if (empty($bhconfig['defaultfilemodule'])) { $defaultfilemodule = "viewfile"; } else { $defaultfilemodule = $bhconfig['defaultfilemodule']; } if ($fileobj->is_dir() == true) { $str .= "<tr><td width='20'><a href='index.php?page=viewdir&filepath=" . $file['filepath'] . "'><img src='" . $this->geticon($file['filepath'], 16) . "' border='0'></a></td><td><a href='index.php?page=viewdir&filepath=" . $file['filepath'] . "' class='filenamelink'>" . $file['filename'] . "</a></td><td>" . $systemdesc . "</td><td>" . $fileobj->numberfiles() . $bhlang['label:_files'] . "</td></tr>"; } else { $str .= "<tr><td width='20'><a href='index.php?page={$defaultfilemodule}&filepath=" . $file['filepath'] . "'><img src='" . $this->geticon($file['filepath'], 16) . "' border='0'></a></td><td><a href='index.php?page={$defaultfilemodule}&filepath=" . $file['filepath'] . "' class='filenamelink'>" . $file['filename'] . "</a></td><td>" . $systemdesc . "</td><td>" . bh_humanfilesize($file['filesize']) . "</td></tr>"; } } } $str .= "\t\t</table><br>\n\t\t</td>\n\t\t<td width='10' background='" . $this->skinpath . "images/sidebar/rc.png'> </td>\n\t</tr>\n\t<tr height='10'>\n\t\t<td width='10'><img src='" . $this->skinpath . "images/sidebar/bl.png'></td>\n\t\t<td background='" . $this->skinpath . "images/sidebar/bc.png'></td>\n\t\t<td width='10'><img src='" . $this->skinpath . "images/sidebar/br.png'></td>\n\t</tr>\n</table>\n";