Exemplo n.º 1
0
function tcm_include_php($root)
{
    $h = opendir($root);
    $slash = substr($root, strlen($root) - 1);
    if ($slash != '/' && $slash != '\\') {
        $root .= '/';
    }
    while ($file = readdir($h)) {
        if (is_dir($root . $file) && $file != '.' && $file != '..') {
            tcm_include_php($root . $file);
        } elseif (strlen($file) > 5) {
            $ext = '.php';
            $length = strlen($ext);
            $start = $length * -1;
            //negative
            if (strcasecmp(substr($file, $start), $ext) == 0) {
                include_once $root . $file;
            }
        }
    }
}
Exemplo n.º 2
0
define('TCM_QUERY_POST_TYPES', 2);
define('TCM_QUERY_CATEGORIES', 3);
define('TCM_QUERY_TAGS', 4);
define('TCM_QUERY_CONVERSION_PLUGINS', 5);
define('TCM_INTELLYWP_SITE', 'http://www.intellywp.com/');
define('TCM_INTELLYWP_ENDPOINT', TCM_INTELLYWP_SITE . 'wp-content/plugins/intellywp-manager/data.php');
define('TCM_PAGE_FAQ', TCM_INTELLYWP_SITE . 'tracking-code-manager');
define('TCM_PAGE_PREMIUM', TCM_INTELLYWP_SITE . 'tracking-code-manager');
define('TCM_PAGE_MANAGER', admin_url() . 'options-general.php?page=' . TCM_PLUGIN_SLUG);
define('TCM_PLUGIN_URI', plugins_url('/', __FILE__));
define('TCM_POSITION_HEAD', 0);
define('TCM_POSITION_BODY', 1);
define('TCM_POSITION_FOOTER', 2);
define('TCM_POSITION_CONVERSION', 3);
define('TCM_TAB_EDITOR', 'editor');
define('TCM_TAB_EDITOR_URI', TCM_PAGE_MANAGER . '&tab=' . TCM_TAB_EDITOR);
define('TCM_TAB_MANAGER', 'manager');
define('TCM_TAB_MANAGER_URI', TCM_PAGE_MANAGER . '&tab=' . TCM_TAB_MANAGER);
define('TCM_TAB_SETTINGS', 'settings');
define('TCM_TAB_SETTINGS_URI', TCM_PAGE_MANAGER . '&tab=' . TCM_TAB_SETTINGS);
define('TCM_TAB_DOCS', 'docs');
define('TCM_TAB_DOCS_URI', 'https://intellywp.com/docs/category/tracking-code-manager/');
define('TCM_TAB_ABOUT', 'about');
define('TCM_TAB_ABOUT_URI', TCM_PAGE_MANAGER . '&tab=' . TCM_TAB_ABOUT);
define('TCM_TAB_WHATS_NEW', 'whatsnew');
define('TCM_TAB_WHATS_NEW_URI', TCM_PAGE_MANAGER . '&tab=' . TCM_TAB_WHATS_NEW);
include_once dirname(__FILE__) . '/autoload.php';
tcm_include_php(dirname(__FILE__) . '/includes/');
global $tcm;
$tcm = new TCM_Singleton();
$tcm->init();