View function fix

  • Evan

    Evan - 2009-04-17

    I just downloaded the newest version of PHPFM, and I tried to click "view", but what seemed to happen was, instead of taking me to where the file was located, it jumbled the filename and the host together. So I made a quick fix until an official fix has been put into place.

    Create a new PHP function:
    function dircorrect($vardir) {
      $vardir = str_replace('/var/www', '', $vardir);
      return $vardir;

    and then change the actual view function for javascript to:

            function view(arg){
                    var w = 800;
                    var h = 600;
          '".dircorrect($dir_atual)."'+escape(arg) , '',  'width='+w+',height='+h+',fullscreen=no,scrollbars=yes,resizable=yes,status=yes,toolbar=no,menubar=no,location=yes');

    I hope this was helpful to somebody.

    • Evan

      Evan - 2009-04-17

      Sorry, I forgot to add that you should replace /var/www with whatever your webserver's root directory is.


Log in to post a comment.