Example #1
0
    <table id="preview_img" border="0" cellspacing="0" cellpadding="0" style="width:100%;height:100%;margin:0;padding:0;"><tr><td align="center" valign="middle">
      <img src="<?php 
    echo fm_geturl($d);
    ?>
" class="image" style="border:1px solid #000000;background:#FFFFFF url(fileman_img/transp.gif);" />
    </td></tr></table>
  </body>
</html>
<?php 
} else {
    ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
    <title><?php 
    echo htmlentities($file);
    ?>
 - Text Editor</title>
    <link rel="stylesheet" href="fileman.css" type="text/css" media="screen" />
  </head>
  <body>
    <pre><?php 
    echo htmlspecialchars(fm_contents($d));
    ?>
</pre>
  </body>
</html>
<?php 
}
Example #2
0
    echo fticon($fileext);
    ?>
.gif)"><?php 
    echo $fullurl;
    ?>
</div><?php 
}
?>
</div></div>
        <div id="valbar"><textarea name="val" onkeyup="change(event)" id="val" rows="30" cols="80"<?php 
if (fm_isfile($d)) {
    echo ($writable ? '>' : ' disabled="disabled">
Warning: This file is read-only. You will not be able to edit it unless you CHMOD it to something like 644.

================================
') . str_replace('\\n', '\\r\\n', str_replace('\\r\\n', '\\n', htmlentities(isset($filecontents) ? $filecontents : ($filecontents = fm_contents($d)))));
} else {
    echo ' disabled="disabled">


    Error: File doesn\'t exist';
}
?>
</textarea></div>
      </form>
<?php 
if ($ext_codemirror && $writable) {
    if (ft($fileext) == 2 || ft($fileext) == 3 || $fileext == 'phps') {
        ?>
      <script type="text/javascript" src="addons/codemirror/codemirror.js"></script>
      <script type="text/javascript">
Example #3
0
                                } else {
                                    if ($vmode == 'vimg') {
                                        ?>
    <table class="vimg" border="0" cellspacing="0" cellpadding="0"><tr><td valign="middle">
      <div><img src="<?php 
                                        echo fm_geturl($d);
                                        ?>
" alt="" /></div>
    </td></tr></table>
<?php 
                                    } else {
                                        if ($vmode == 'txt') {
                                            ?>
    <div class="txt"><div class="fsub">
      <div class="pre"><?php 
                                            echo str_replace(array('  ', "\n", "\t"), array('&nbsp;', "\n<br />", '&nbsp;&nbsp;&nbsp;&nbsp;'), str_replace("\n ", "\n&nbsp;", htmlspecialchars(fm_contents($d, "\r\n"))));
                                            ?>
</div>
    </div></div>
<?php 
                                        } else {
                                            if ($vmode == 'e_txt' || $vmode == 'e_html') {
                                                ?>
    <form class="t_ed" name="textedit" action="index.php?d=<?php 
                                                echo $hd, $havmode, $hasid;
                                                ?>
" target="_top" method="post">
      <div class="fullscr_btns">
        <input type="submit" name="submit" value="Save" />
        <input type="reset" name="reset" value="Revert" onclick="return confirm('Are you sure you want to revert to the last saved state?');" />
        <input type="hidden" name="act" value="textedit" />
Example #4
0
} else {
    include_once 'session.lib.php';
}
//====================
// Frame
//====================
//if it's being used as a frame, we'll need to do some more stuff.
if (isset($_REQUEST['frame'])) {
    if (isset($_POST['act'])) {
        switch ($_POST['act']) {
            case 'textedit':
                if (fm_iswritable($d)) {
                    if (!is_string($_POST['val'])) {
                        die('<!DOCTYPE html><script language="javascript">parent.fmf_error("Malformed request.");</script>');
                    }
                    if (strpos(fm_contents($d), "\r\n") === false) {
                        $_POST['val'] = str_replace("\r\n", "\n", $_POST['val']);
                    }
                    if (!fm_editfile($d, $_POST['val'])) {
                        fm_close();
                        die('<!DOCTYPE html><script language="javascript">parent.fmf_error("Cannot edit file \'' . basename($d) . '\'.");</script>');
                    }
                } else {
                    die('<!DOCTYPE html><script language="javascript">parent.fmf_error("File \'' . basename($d) . '\' is not writable.");</script>');
                }
        }
    }
    // Written in HTML 5 because I'm too lazy to write XHTML
    ?>
<!DOCTYPE html>
<html style="margin:0;padding:0;">
Example #5
0
<?php

/*
 *
 * Filecharger
 * by Zarel of Novawave
 *
 */
include_once 'config.inc.php';
require_once 'fileman.lib.php';
if ($ftpmode) {
    include_once 'ftpsession.lib.php';
} else {
    include_once 'session.lib.php';
}
if (fm_contenttype(fext($d))) {
    header('Content-Type: ' . fm_contenttype(fext($d)));
}
echo fm_contents($d);