Results 1 to 10 of 10
  1. #1
    Join Date
    Jul 2009
    Posts
    402
    Plugin Contributions
    0

    Default Can I modify Developers Toolkit to search files in other directories outside just ZC?

    Hi,
    I may sound crazy but I am using the developers tool kit to look up for specific strings like for instance $xxxvvv but it returns 0 results.
    The php file were $xxxvvv is located is in a dir that is not part of the orginal zen cart dir set, I can open it and see the $xxxvvv written in the code.
    Another question is: If I want to look up something in a file that has tpl as extension is it possible?
    thanks
    ciao from Italy.
    enzo

  2. #2
    Join Date
    Feb 2005
    Location
    Lansing, Michigan USA
    Posts
    20,024
    Plugin Contributions
    3

    Default Re: Search specific word in files that are not the original zen cart directories

    You might try just looking up part of the string, like 'xxvv'. I don't believe the DTK will search in files with a .tpl extension.

  3. #3
    Join Date
    Jul 2009
    Posts
    402
    Plugin Contributions
    0

    Default Re: Search specific word in files that are not the original zen cart directories

    Thank Steve but I have already tried all the possible combinations, but no way. I came to the conclusion that maybe the particular dir is somehow protected in order to avoid reverse engineering on the code.
    What do you think about?
    ciao form Italy
    enzo

  4. #4
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,401
    Plugin Contributions
    87

    Default Re: Search specific word in files that are not the original zen cart directories

    I've not looked at adding file extensions to the search, but I've got an imbedded WordPress blog on my site and wanted to use the DTK to search in the WordPress files too. I made the following change to /YOUR_ADMIN/developers_tool_kit.php to accomplish that:
    Code:
    /// all files
        case ('locate_all_files'):
          $zv_check_root = false;
          if ($configuration_key_lookup == '') {
            $messageStack->add_session(ERROR_CONFIGURATION_KEY_NOT_ENTERED, 'caution');
            zen_redirect(zen_href_link(FILENAME_DEVELOPERS_TOOL_KIT));
          }
          $found = 'false';
          $zv_files_group = $_POST['zv_files'];
          $zv_filestype_group = $_POST['zv_filestype'];
    //echo 'settings: ' . '$zv_files_group: ' . $zv_files_group . '$zv_filestype_group: ' . $zv_filestype_group . '<br>';
    //echo 'Who am I template ' . $template_dir . ' sess lang ' . $_SESSION['language'];
          switch ($zv_files_group) {
            case (0): // none
              $filename_listing = '';
              break;
            case (1): // all
              $zv_check_root = true;
              $filename_listing = '';
    
              $check_directory = array();
    
    // get includes
              $sub_dir_files = array();
              getDirList(DIR_FS_CATALOG . DIR_WS_INCLUDES, $zv_filestype_group);
              $sub_dir_files_catalog = $sub_dir_files;
    
    // get email
              $sub_dir_files = array();
              getDirList(DIR_FS_EMAIL_TEMPLATES, $zv_filestype_group);
              $sub_dir_files_email = $sub_dir_files;
    
    // get admin
              $sub_dir_files = array();
              getDirList(DIR_FS_ADMIN, $zv_filestype_group);
              $sub_dir_files_admin= $sub_dir_files;
    
              $check_dir = array_merge($sub_dir_files_catalog, $sub_dir_files_email, $sub_dir_files_admin);
              for ($i = 0, $n = sizeof($check_dir); $i < $n; $i++) {
                $check_directory[] = $check_dir[$i] . '/';
              }
              break;
    
            case (2): // all catalog
              $zv_check_root = true;
              $filename_listing = '';
    
              $check_directory = array();
    
              $sub_dir_files = array();
              getDirList(DIR_FS_CATALOG . DIR_WS_INCLUDES, $zv_filestype_group);
              $sub_dir_files_catalog = $sub_dir_files;
    
    // get email
              $sub_dir_files = array();
              getDirList(DIR_FS_EMAIL_TEMPLATES, $zv_filestype_group);
              $sub_dir_files_email = $sub_dir_files;
    
    // get wordpress
              $sub_dir_files = array();
              getDirList(DIR_FS_CATALOG . 'wordpress/', $zv_filestype_group);
              $sub_dir_files_wp = $sub_dir_files;
    
              $check_dir = array_merge($sub_dir_files_catalog, $sub_dir_files_email, $sub_dir_files_wp);
              for ($i = 0, $n = sizeof($check_dir); $i < $n; $i++) {
                $zv_add_dir= str_replace('//', '/', $check_dir[$i] . '/');
                if (strstr($zv_add_dir, DIR_WS_ADMIN) == '') {
                  $check_directory[] = $zv_add_dir;
                }
              }
              break;
    
            case (3): // all admin
              $zv_check_root = false;
              $filename_listing = '';

  5. #5
    Join Date
    Jul 2009
    Posts
    402
    Plugin Contributions
    0

    Default Re: Search specific word in files that are not the original zen cart directories

    Thanks lat9
    I have added the code in this way_

    // get mydir
    $sub_dir_files = array();
    getDirList(DIR_FS_CATALOG . 'mydir/', $zv_filestype_group);
    $sub_dir_files_mydir = $sub_dir_files;

    but it does not work.

    I think that the problem stays in this part:

    $sub_dir_files_mydir = $sub_dir_files;

    but I do not know what to put in place of mydir.

    Thanks again for your help.
    ciao from Italy
    enzo

  6. #6
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,401
    Plugin Contributions
    87

    Default Re: Search specific word in files that are not the original zen cart directories

    Quote Originally Posted by enzo-ita View Post
    Thanks lat9
    I have added the code in this way_

    // get mydir
    $sub_dir_files = array();
    getDirList(DIR_FS_CATALOG . 'mydir/', $zv_filestype_group);
    $sub_dir_files_mydir = $sub_dir_files;

    but it does not work.

    I think that the problem stays in this part:

    $sub_dir_files_mydir = $sub_dir_files;

    but I do not know what to put in place of mydir.

    Thanks again for your help.
    ciao from Italy
    enzo
    That's because (duh!) I didn't highlight all of the changed lines. I've highlighted below in bold the one I missed above. Sorry about that.
    Code:
    /// all files
        case ('locate_all_files'):
          $zv_check_root = false;
          if ($configuration_key_lookup == '') {
            $messageStack->add_session(ERROR_CONFIGURATION_KEY_NOT_ENTERED, 'caution');
            zen_redirect(zen_href_link(FILENAME_DEVELOPERS_TOOL_KIT));
          }
          $found = 'false';
          $zv_files_group = $_POST['zv_files'];
          $zv_filestype_group = $_POST['zv_filestype'];
    //echo 'settings: ' . '$zv_files_group: ' . $zv_files_group . '$zv_filestype_group: ' . $zv_filestype_group . '<br>';
    //echo 'Who am I template ' . $template_dir . ' sess lang ' . $_SESSION['language'];
          switch ($zv_files_group) {
            case (0): // none
              $filename_listing = '';
              break;
            case (1): // all
              $zv_check_root = true;
              $filename_listing = '';
    
              $check_directory = array();
    
    // get includes
              $sub_dir_files = array();
              getDirList(DIR_FS_CATALOG . DIR_WS_INCLUDES, $zv_filestype_group);
              $sub_dir_files_catalog = $sub_dir_files;
    
    // get email
              $sub_dir_files = array();
              getDirList(DIR_FS_EMAIL_TEMPLATES, $zv_filestype_group);
              $sub_dir_files_email = $sub_dir_files;
    
    // get admin
              $sub_dir_files = array();
              getDirList(DIR_FS_ADMIN, $zv_filestype_group);
              $sub_dir_files_admin= $sub_dir_files;
    
              $check_dir = array_merge($sub_dir_files_catalog, $sub_dir_files_email, $sub_dir_files_admin);
              for ($i = 0, $n = sizeof($check_dir); $i < $n; $i++) {
                $check_directory[] = $check_dir[$i] . '/';
              }
              break;
    
            case (2): // all catalog
              $zv_check_root = true;
              $filename_listing = '';
    
              $check_directory = array();
    
              $sub_dir_files = array();
              getDirList(DIR_FS_CATALOG . DIR_WS_INCLUDES, $zv_filestype_group);
              $sub_dir_files_catalog = $sub_dir_files;
    
    // get email
              $sub_dir_files = array();
              getDirList(DIR_FS_EMAIL_TEMPLATES, $zv_filestype_group);
              $sub_dir_files_email = $sub_dir_files;
    
    // get wordpress
              $sub_dir_files = array();
              getDirList(DIR_FS_CATALOG . 'wordpress/', $zv_filestype_group);
              $sub_dir_files_wp = $sub_dir_files;
    
              $check_dir = array_merge($sub_dir_files_catalog, $sub_dir_files_email, $sub_dir_files_wp);
              for ($i = 0, $n = sizeof($check_dir); $i < $n; $i++) {
                $zv_add_dir= str_replace('//', '/', $check_dir[$i] . '/');
                if (strstr($zv_add_dir, DIR_WS_ADMIN) == '') {
                  $check_directory[] = $zv_add_dir;
                }
              }
              break;
    
            case (3): // all admin
              $zv_check_root = false;
              $filename_listing = '';

  7. #7
    Join Date
    Jul 2009
    Posts
    402
    Plugin Contributions
    0

    Default Re: Search specific word in files that are not the original zen cart directories

    Hi,
    I notced that part of the mod was not higligted and what I did is:

    // get mydir
    $sub_dir_files = array();
    getDirList(DIR_FS_CATALOG . 'mydir/', $zv_filestype_group);
    $sub_dir_files_mydir = $sub_dir_files;
    $check_dir = array_merge($sub_dir_files_catalog, $sub_dir_files_email, $sub_dir_files_mydir);

    but is does not work.
    ciao

  8. #8
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,401
    Plugin Contributions
    87

    Default Re: Search specific word in files that are not the original zen cart directories

    Where in your Zen Cart directory is mydir? With the sample construct, it should be at the same level as the includes and YOUR_ADMIN directories.

  9. #9
    Join Date
    Jul 2009
    Posts
    402
    Plugin Contributions
    0

    Default Re: Search specific word in files that are not the original zen cart directories

    Yes it is under public_html exactly like the includes.
    Thanks
    ciao
    enzo

  10. #10
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,401
    Plugin Contributions
    87

    Default Re: Search specific word in files that are not the original zen cart directories

    Possibly .htaccess restrictions blocking the access?

 

 

Similar Threads

  1. v151 Developers Tool Kit: Search results outside of <html>
    By lat9 in forum Bug Reports
    Replies: 0
    Last Post: 23 May 2013, 02:09 PM
  2. 1.3.9b developers toolkit
    By buildingblocks in forum General Questions
    Replies: 1
    Last Post: 9 May 2010, 01:41 AM
  3. Developers Toolkit
    By wlmartin in forum General Questions
    Replies: 6
    Last Post: 28 Jun 2008, 03:00 PM
  4. Developers Toolkit
    By wlmartin in forum General Questions
    Replies: 1
    Last Post: 28 Jun 2008, 02:48 PM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR