Thread: Changed Files

Page 1 of 2 12 LastLast
Results 1 to 10 of 39

Hybrid View

  1. #1
    Join Date
    Dec 2009
    Location
    Amersfoort, The Netherlands
    Posts
    2,845
    Plugin Contributions
    25

    Default Re: Changed Files

    So far I like this simple plugin.
    I made some minor changes to admin/changed_files.php:
    - to the code to make the output more readable, the out put is shown in a table.
    - removed the include of the language file, as that is already done by Zen Cart

    PHP Code:
    <?php
    require('includes/application_top.php');
    $start_dir DIR_FS_CATALOG
    $it = new RecursiveDirectoryIterator($start_dir);
    $files = array(); 
    foreach(new 
    RecursiveIteratorIterator($it) as $file)
    {
        if (!
    is_dir($file)) { 
            
    $files[] = array('name' => $file
                             
    'mtime' => filemtime($file)); 
        }
    }
    usort($files"file_cmp");
    ?>
    <!doctype html>
    <html <?php echo HTML_PARAMS?>>
    <head>
    <meta charset="<?php echo CHARSET?>">
    <title><?php echo TITLE?></title>
    <link rel="stylesheet" href="includes/stylesheet.css">
    <link rel="stylesheet" href="includes/cssjsmenuhover.css" media="all" id="hoverJS">
    <link rel="stylesheet" href="includes/admin_access.css" />
    <script src="includes/menu.js"></script>
    <script src="includes/general.js"></script>
    <script>
      function init()
      {
        cssjsmenu('navbar');
        if (document.getElementById)
        {
          var kill = document.getElementById('hoverJS');
          kill.disabled = true;
        }
      }
    </script>
    </head>
    <body onload="init()">
    <!-- header //-->
    <?php require(DIR_WS_INCLUDES 'header.php'); ?>
    <!-- header_eof //-->


    <!-- body //-->
    <div class="container">
      <h1><?php echo HEADING_TITLE ?></h1>
      <table class="table">
    <?php 
    foreach ($files as $file) {
       
    $name str_replace(DIR_FS_CATALOG""$file['name']); 
       echo 
    '<tr>';
       echo 
    '<td>'.$name '</td><td>' date('Y-m-d H:i:s'$file['mtime']) . "</td>";
       echo 
    '</tr>';
    }
    ?>
    </table>
    </div>
    <!-- body_eof //-->


    <div class="bottom">
    <!-- footer //-->
    <?php require(DIR_WS_INCLUDES 'footer.php'); ?>
    <!-- footer_eof //-->
    </div>
    <br>
    </body>
    </html>
    <?php require(DIR_WS_INCLUDES 'application_bottom.php'); ?>
    <?php
    function file_cmp($a$b) {
       if (
    $a['mtime'] == $b['mtime'])
          return 
    0;
       if (
    $a['mtime'] < $b['mtime'])
          return 
    1;
       return -
    1;
    }
    It would be nice to be able to exclude some directories, like editors, or bmz_cache
    Last edited by Design75; 27 Mar 2018 at 03:21 PM.

  2. #2
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    10,532
    Plugin Contributions
    127

    Default Re: Changed Files

    Thanks for posting this modification and suggestions.
    That Software Guy. My Store: Zen Cart Support
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  3. #3
    Join Date
    Jul 2013
    Location
    Brisbane, Australia
    Posts
    39
    Plugin Contributions
    0

    Default Re: Changed Files

    Hi swguy. This plugin worked a treat! Thanks for your efforts.

    I successfully loaded your original version (incl Post #10 edit). When I incorporated Design75's suggested modification (post #15), I received an error "Content Encoding Error. The page you are trying to view cannot be shown because it uses an invalid or unsupported form of compression..." Design75's point re the table format is also valid for me, but - with my programming skills not up to the task - I'll look at manipulating your output data in, say Excel, to split each path into its constituent directories/filename to allow sorting.

    My system: Website in development so on WAMP+SSL; ZC1.5.5e + a swag of plugins; Template: Responsive Sheffield Blue 2.0 + recommended code changes from that thread e.g. for compatibility with ZC1.5.5.

    Thanks again.

  4. #4
    Join Date
    Jan 2014
    Location
    Lindenwood, Illinois
    Posts
    7
    Plugin Contributions
    0

    Default Re: Changed Files

    The suggested updated by Design75 does not close properly. I tried it and also got the same error. Restoring th the original it work perfectly.

  5. #5
    Join Date
    Dec 2009
    Location
    Amersfoort, The Netherlands
    Posts
    2,845
    Plugin Contributions
    25

    Default Re: Changed Files

    What do you mean by not closing properly? The only thing I changed is the layout, so I do not see how that affect any encoding problems.
    Quote Originally Posted by movieman61049 View Post
    The suggested updated by Design75 does not close properly. I tried it and also got the same error. Restoring th the original it work perfectly.

  6. #6
    Join Date
    Feb 2007
    Posts
    327
    Plugin Contributions
    0

    Default Re: Changed Files

    Quote Originally Posted by Design75 View Post
    It would be nice to be able to exclude some directories, like editors, or bmz_cache
    The plugin works as expected on Zen Cart v1.5.4, I think this feature will make the plugin more valuable

  7. #7
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    10,532
    Plugin Contributions
    127

    Default Re: Changed Files

    Nope. Trust me, you'd *want* to know if someone uploaded bmz_cache/badguy_backdoor.php.
    That Software Guy. My Store: Zen Cart Support
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  8. #8
    Join Date
    Dec 2009
    Location
    Amersfoort, The Netherlands
    Posts
    2,845
    Plugin Contributions
    25

    Default Re: Changed Files

    That's true, but right now the list of files is so long, it is impracticable to use.
    Quote Originally Posted by swguy View Post
    Nope. Trust me, you'd *want* to know if someone uploaded bmz_cache/badguy_backdoor.php.

  9. #9
    Join Date
    Dec 2007
    Location
    Payson, AZ
    Posts
    1,076
    Plugin Contributions
    15

    Default Re: Changed Files

    Quote Originally Posted by Design75 View Post
    That's true, but right now the list of files is so long, it is impracticable to use.
    Some ideas...
    I like your change to table, my brain seams to like line numbers... I know I have around 4082 files in there somewhere...

    I know date when I uploaded the files which sets the date of change I would want to flag from or I can set a date which would drop the 4082 list down to maybe 561 lines... Could add an input filed for the date and a refresh button maybe!

    Code:
    <!-- body //-->
    <div class="container">
      <h1><?php echo HEADING_TITLE ?></h1>
    <?php
      $maxdate = strtotime('2018-01-01');  //date changes after would be flagged  Y-m-d
      echo '<div>Files changed after: ' . date('Y-m-d H:i:s', $maxdate) . ' (or) ' . (string)$maxdate . '</div>'; 
    ?> 
    <br />
      <table class="table">
    <?php 
    $i = 0;
    foreach ($files as $file) {
       $i = $i + 1;
       if ($file['mtime'] > $maxdate) {
       $name = str_replace(DIR_FS_CATALOG, "", $file['name']); 
       echo '<tr>';
       echo '<td>' . (string)$i . '</td><td>'.$name . '</td><td>' . date('Y-m-d H:i:s', $file['mtime']) . "</td>";
       echo '</tr>';
       }
    }
    ?>
    </table>
    </div>
    <!-- body_eof //-->
    Dave
    Always forward thinking... Lost my mind!

  10. #10
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    10,532
    Plugin Contributions
    127

    Default Re: Changed Files

    Changed Files Report was just updated to prevent error-log-files being generated when files are unreadable because of permission issues.
    That Software Guy. My Store: Zen Cart Support
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Changed files from 1.3.8a to 1.3.9c?
    By Marg in forum Upgrading from 1.3.x to 1.3.9
    Replies: 3
    Last Post: 21 May 2010, 11:18 PM
  2. list of files changed frm 1.3.0.1
    By chac416 in forum Upgrading from 1.3.x to 1.3.9
    Replies: 1
    Last Post: 11 Jan 2007, 06:25 PM
  3. List of changed files?
    By Jan51 in forum Upgrading from 1.3.x to 1.3.9
    Replies: 3
    Last Post: 1 Jan 2007, 01:20 AM
  4. 1.3.5 Changed Files Only...
    By Alex Clarke in forum General Questions
    Replies: 2
    Last Post: 5 Sep 2006, 04:40 PM
  5. [done 1.3.5] changed files
    By swguy in forum Bug Reports
    Replies: 2
    Last Post: 4 Sep 2006, 03:34 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg