Results 1 to 6 of 6
  1. #1
    Join Date
    Jun 2008
    Location
    Osprey, Florida
    Posts
    151
    Plugin Contributions
    14

    Default Adding a file to the includes > classes > db > mysql folder.

    I'm trying to add a define_queries_XXX.php file to the mysql folder. The define I'm adding is:
    Code:
    DEFINE('SQL_SHOW_PRODUCT_PAGE_TABS',"select configuration_key, configuration_value from " . TABLE_CONFIGURATION . " where configuration_key RLIKE 'SHOW_PRODUCT_PAGE_TABS' and configuration_value > 0 order by configuration_value");
    Adding the line to define_queries.php works but I don't want to modify that file. I would rather add an additional file to that folder but doing so does not work.

    The code for my file is:
    Code:
    if (!defined('IS_ADMIN_FLAG')) {
        die('Illegal Access');
    }
    DEFINE('SQL_SHOW_PRODUCT_PAGE_TABS',"select configuration_key, configuration_value from " . TABLE_CONFIGURATION . " where configuration_key RLIKE 'SHOW_PRODUCT_PAGE_TABS' and configuration_value > 0 order by configuration_value");
    Is this something that can be done with an additional file?

  2. #2
    Join Date
    Jul 2012
    Posts
    16,813
    Plugin Contributions
    17

    Default Re: Adding a file to the includes > classes > db > mysql folder.

    You could just place it in includes/extra_configures

    Otherwise may have to modify other core code in order to use additional files within that directory. :/
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3
    Join Date
    Jun 2008
    Location
    Osprey, Florida
    Posts
    151
    Plugin Contributions
    14

    Default Re: Adding a file to the includes > classes > db > mysql folder.

    Quote Originally Posted by mc12345678 View Post
    You could just place it in includes/extra_configures
    Thanks. That didn't work but includes/extra_datafiles did.
    You pointed me in the right direction.

  4. #4
    Join Date
    Jul 2012
    Posts
    16,813
    Plugin Contributions
    17

    Default Re: Adding a file to the includes > classes > db > mysql folder.

    Quote Originally Posted by ultimate_zc View Post
    Thanks. That didn't work but includes/extra_datafiles did.
    You pointed me in the right direction.
    Not sure why that was so: In a default ZC store, in includes/application_top.php the folder includes/extra_configures is loaded just after the includes/configure.php file and before getting into the includes/auto_loaders/config.core.php file where eventually the includes/extra_datafiles folder is loaded.

    I mean sure, if it is not defined before loading the extra_datafiles file/folder it could go in that folder, it is even possible to put it in the includes/functions/extra_functions folder, though that doesn't make much sense as its neither a function nor an extra function. :) but files with a php extension in that folder do get loaded.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  5. #5
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,699
    Plugin Contributions
    95

    Default Re: Adding a file to the includes > classes > db > mysql folder.

    Quote Originally Posted by ultimate_zc View Post
    Thanks. That didn't work but includes/extra_datafiles did.
    You pointed me in the right direction.
    Quote Originally Posted by mc12345678 View Post
    Not sure why that was so: In a default ZC store, in includes/application_top.php the folder includes/extra_configures is loaded just after the includes/configure.php file and before getting into the includes/auto_loaders/config.core.php file where eventually the includes/extra_datafiles folder is loaded.

    I mean sure, if it is not defined before loading the extra_datafiles file/folder it could go in that folder, it is even possible to put it in the includes/functions/extra_functions folder, though that doesn't make much sense as its neither a function nor an extra function. :) but files with a php extension in that folder do get loaded.
    The reason that the file worked when placed in the /extra_datafiles subdirectory and didn't when in /extra_configures is the nature of the definition being made.

    Code:
    if (!defined('IS_ADMIN_FLAG')) {     die('Illegal Access'); } 
    DEFINE('SQL_SHOW_PRODUCT_PAGE_TABS',"select configuration_key, configuration_value from " . TABLE_CONFIGURATION . " where configuration_key RLIKE 'SHOW_PRODUCT_PAGE_TABS' and configuration_value > 0 order by configuration_value");

    The database-related names (like the table names) are initialized during the auto-load process, so are available when the /extra_datafiles directory's files are loaded. Files in the /extra_configures directory are loaded prior to the auto-load process, so don't have access to the file/database name definitions.

  6. #6
    Join Date
    Jul 2012
    Posts
    16,813
    Plugin Contributions
    17

    Default Re: Adding a file to the includes > classes > db > mysql folder.

    Ah yes, and then the TABLE_CONFIGURATION "segment" being assumed as literally the text 'TABLE_CONFIGURATION' when the file is placed in extra_configures. Details!
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

 

 

Similar Threads

  1. Replies: 3
    Last Post: 29 Aug 2012, 02:57 PM
  2. What does this (admin/includes/classes/transliteration/) folder do?
    By mikecnz in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 4 Nov 2010, 02:17 AM
  3. Override for /includes/classes folder?
    By chadderuski in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 10 May 2010, 07:09 PM
  4. How to require a /includes/classes file from admin page?
    By neekfenwick in forum General Questions
    Replies: 2
    Last Post: 10 Nov 2009, 08:29 AM

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