コード例 #1
0
ファイル: wfsfilesshow.php プロジェクト: severnaya99/Sg-2010
        while (list($fileid, $filerealname, $filetext, $articleid, $fileshowname, $date, $ext, $minetype, $downloadname, $counter, $filedescript) = $xoopsDB->fetchRow($result)) {
            $icon = get_icon(XOOPS_ROOT_PATH . "/" . $wfsConfig['filesbasepath'] . "/" . $filerealname);
            $iconshow = "<img src=" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/images/icon/" . $icon . " align = absmiddle>";
            $mimeshow = $mimetype->getType(XOOPS_ROOT_PATH . "/" . $wfsConfig['filesbasepath'] . "/" . $filerealname);
            $editlink = "<a href='index.php?op=fileedit&amp;fileid=" . $fileid . "'>" . _AM_EDIT . "</a>";
            $dellink = "<a href='index.php?op=delfile&amp;fileid=" . $fileid . "'>" . _AM_DELETE . "</a>";
            if (!is_file(XOOPS_ROOT_PATH . "/" . $wfsConfig['filesbasepath'] . "/" . $filerealname)) {
                $filerealname = "Error!";
            }
            if (is_file(XOOPS_ROOT_PATH . "/" . $wfsConfig['filesbasepath'] . "/" . $filerealname)) {
                $size = Prettysize(filesize(XOOPS_ROOT_PATH . "/" . $wfsConfig['filesbasepath'] . "/" . $filerealname));
            } else {
                $size = '0';
            }
            $article = new WfsArticle($articleid);
            $articlelink = "<a href='" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/article.php?articleid=" . $articleid . "'>" . $article->textLink() . "</a>";
            echo "<tr>";
            echo "<td class='head' align = 'center' >{$fileid}</td>";
            echo "<td align='center' class='even'>{$articlelink}</td>";
            echo "<td class='even' align = 'center' nowrap='nowrap'>{$filerealname}</a></td>";
            echo "<td class='even' align = 'center'>{$fileshowname}</td>";
            echo "<td class='even' align = 'center' nowrap='nowrap' >{$iconshow} ({$ext})</a></td>";
            echo "<td align='center' class='even'>{$mimeshow}</td>";
            echo "<td align='center' class='even'>{$size}</td>";
            echo "<td align='center' class='even'>{$editlink} {$dellink}</td>";
            echo "</tr>";
        }
        echo "</table>";
        wfsfooter();
        xoops_cp_footer();
}