/**
  * init base variables of the globals
  */
 public static function initGlobalsBase($pluginFolder)
 {
     global $wpdb;
     GlobalsUG::$isScriptsInFooter = true;
     $tablePrefix = $wpdb->prefix;
     GlobalsUG::$table_galleries = $tablePrefix . GlobalsUG::TABLE_GALLERIES_NAME;
     GlobalsUG::$table_categories = $tablePrefix . GlobalsUG::TABLE_CATEGORIES_NAME;
     GlobalsUG::$table_items = $tablePrefix . GlobalsUG::TABLE_ITEMS_NAME;
     $pluginName = "unitegallery";
     GlobalsUG::$pathPlugin = realpath($pluginFolder) . "/";
     GlobalsUG::$path_media_ug = GlobalsUG::$pathPlugin . "unitegallery-plugin/";
     GlobalsUG::$path_base = ABSPATH;
     $arrUploadDir = wp_upload_dir();
     $pathImages = $arrUploadDir["basedir"];
     GlobalsUG::$path_images = realpath($pathImages) . "/";
     GlobalsUG::$path_cache = GlobalsUG::$pathPlugin . "cache/";
     GlobalsUG::$urlPlugin = plugin_dir_url($pluginFolder . "/unitegallery.php");
     GlobalsUG::$url_component_client = "";
     GlobalsUG::$url_component_admin = admin_url() . "admin.php?page={$pluginName}";
     GlobalsUG::$url_base = site_url() . "/";
     GlobalsUG::$url_media_ug = GlobalsUG::$urlPlugin . "unitegallery-plugin/";
     GlobalsUG::$url_images = content_url() . "/";
     GlobalsUG::$url_ajax = admin_url() . "/admin-ajax.php";
     GlobalsUG::$url_ajax_front = GlobalsUG::$url_ajax;
 }
 public function register()
 {
     $local_test = false;
     $fpd_css_url = $local_test ? 'http://radykal.dev/fpd3/css/jquery.fancyProductDesigner.css' : plugins_url('/css/jquery.fancyProductDesigner.min.css', FPD_PLUGIN_ROOT_PHP);
     $fpd_js_url = $local_test ? 'http://radykal.dev/fpd3/js/jquery.fancyProductDesigner.js' : plugins_url('/js/jquery.fancyProductDesigner.min.js', FPD_PLUGIN_ROOT_PHP);
     $fpd_js_url = get_option('fpd_debug_mode') == 'yes' ? plugins_url('/js/jquery.fancyProductDesigner.js', FPD_PLUGIN_ROOT_PHP) : $fpd_js_url;
     //register css files
     wp_register_style('fpd-icon-font', plugins_url('/css/icon-font.css', FPD_PLUGIN_ROOT_PHP), false, Fancy_Product_Designer::FPD_VERSION);
     $fonts_dir = WP_CONTENT_DIR . '/uploads/fpd_fonts';
     $fonts_css = $fonts_dir . '/jquery.fancyProductDesigner-fonts.css';
     if (!file_exists($fonts_css)) {
         if (!file_exists($fonts_dir)) {
             wp_mkdir_p($fonts_dir);
         }
         $handle = @fopen($fonts_css, 'w') or print 'Cannot open file:  ' . $fonts_css;
         fclose($handle);
     }
     wp_register_style('fpd-fonts', content_url('/uploads/fpd_fonts/jquery.fancyProductDesigner-fonts.css', FPD_PLUGIN_ROOT_PHP), false, Fancy_Product_Designer::FPD_VERSION);
     wp_register_style('fpd-plugins', plugins_url('/css/plugins.min.css', FPD_PLUGIN_ROOT_PHP), false, Fancy_Product_Designer::FPD_VERSION);
     wp_register_style('fpd-jquery-ui', plugins_url('/css/jquery-ui.css', FPD_PLUGIN_ROOT_PHP), false, Fancy_Product_Designer::FPD_VERSION);
     wp_register_style('jquery-fpd', $fpd_css_url, array('fpd-fonts', 'fpd-jquery-ui'), Fancy_Product_Designer::FPD_VERSION);
     wp_enqueue_style('font-awesome-4', '//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css', false, '4.3.0');
     wp_register_style('fpd-jssocials-theme', plugins_url('/assets/jssocials/jssocials-theme-flat.css', FPD_PLUGIN_ROOT_PHP), false, '0.2.0');
     wp_register_style('fpd-jssocials', plugins_url('/assets/jssocials/jssocials.css', FPD_PLUGIN_ROOT_PHP), array('font-awesome-4', 'fpd-jssocials-theme'), '0.2.0');
     wp_register_script('fpd-jssocials', plugins_url('/assets/jssocials/jssocials.min.js', FPD_PLUGIN_ROOT_PHP), false, '0.2.0');
     //register js files
     wp_register_script('fpd-plugins', plugins_url('/js/plugins.js', FPD_PLUGIN_ROOT_PHP), false, Fancy_Product_Designer::FPD_VERSION);
     wp_register_script('fabric', plugins_url('/js/fabric.js', FPD_PLUGIN_ROOT_PHP), false, Fancy_Product_Designer::FPD_VERSION);
     wp_register_script('fpd-jquery-form', plugins_url('/js/jquery.form.min.js', FPD_PLUGIN_ROOT_PHP));
     $fpd_dep = array('jquery', 'jquery-ui-draggable', 'jquery-ui-resizable', 'jquery-ui-sortable', 'jquery-ui-slider', 'fabric');
     if (get_option('fpd_debug_mode') == 'yes' || $local_test) {
         array_push($fpd_dep, 'fpd-plugins');
     }
     wp_register_script('jquery-fpd', $fpd_js_url, $fpd_dep, Fancy_Product_Designer::FPD_VERSION);
 }
Пример #3
0
 function Init()
 {
     // We reach here for main site blog admin AND network admin, even if multisite enabled
     // This is because in multisite there is no network admin AJAX, so we need to utilise the admin AJAX
     // So if we're is_admin and not network admin (or not multisite), do the AJAX, and then quit if we're multisite (since we only want to show stuff in network_admin)
     if (is_admin() && (!$this->WPOnlineBackup->multisite || !is_network_admin())) {
         // Register AJAX action for dynamic manual backup.
         add_action('wp_ajax_wponlinebackup_progress', array(&$this, 'AJAX_Progress'));
         add_action('wp_ajax_wponlinebackup_kick_start', array(&$this, 'AJAX_Kick_Start'));
         // If we're multisite, we're done!
         if ($this->WPOnlineBackup->multisite) {
             return;
         }
     }
     // Only load if we have permission
     if (!$this->WPOnlineBackup->multisite && current_user_can('install_plugins') || $this->WPOnlineBackup->multisite && current_user_can('manage_sites')) {
         // Define WPONLINEBACKUP_URL using plugin_dir_url - we have to do this here because plugin_dir_url uses filters and therefore we need to wait for wordpress to load before using it
         define('WPONLINEBACKUP_URL', preg_replace('#/$#', '', plugin_dir_url(WPONLINEBACKUP_FILEPATH)));
         // BTL code styling requires we do not have forward slash!
         define('WPONLINEBACKUP_LOCALBACKUPURL', content_url() . '/backups');
         // Plugin links...
         add_filter(($this->WPOnlineBackup->multisite ? 'network_admin_' : '') . 'plugin_action_links_' . WPONLINEBACKUP_FILE, array(&$this, 'Plugin_Actions'));
         // Queue CSS we use for our menu item
         add_action('admin_head', array(&$this, 'Admin_Menu_Head'));
         // Adding the navigation entries...
         add_action(($this->WPOnlineBackup->multisite ? 'network_admin_' : 'admin_') . 'menu', array(&$this, 'Admin_Menu'));
         // Grab formatting functions
         require_once WPONLINEBACKUP_PATH . '/include/formatting.php';
         $this->WPOnlineBackup->Load_Language();
     }
 }
Пример #4
0
function micro_themes_dir_best_guess()
{
    $wp_content_dir = str_replace(site_url(), ABSPATH, content_url());
    // if it still has http, use fallback dir method
    if (strpos($wp_content_dir, 'http') !== false) {
        $wp_content_dir = WP_CONTENT_DIR;
    }
    // now for the micro-themes dir
    $micro_root_dir = $wp_content_dir . '/micro-themes/';
    // exception for multisite
    global $wp_version;
    global $blog_id;
    if ($wp_version >= 3 and is_multisite()) {
        $filename = $wp_content_dir . "/blogs.dir/";
        if (file_exists($filename)) {
            if ($blog_id == '1') {
                $micro_root_dir = $wp_content_dir . '/blogs.dir/micro-themes/';
            } else {
                $micro_root_dir = $wp_content_dir . '/blogs.dir/' . $blog_id . '/micro-themes/';
            }
        } else {
            if ($blog_id == '1') {
                $micro_root_dir = $wp_content_dir . '/uploads/sites/micro-themes/';
            } else {
                $micro_root_dir = $wp_content_dir . '/uploads/sites/' . $blog_id . '/micro-themes/';
            }
        }
    }
    return $micro_root_dir;
}
 function getFeedData($category, $remote_category, $file_name, $saved_feed = null)
 {
     $this->logActivity('Initializing...');
     global $message;
     global $pfcore;
     $providers = new PProviderList();
     $this->logActivity('Loading paths...');
     if (!$this->checkFolders()) {
         return;
     }
     $file_url = PFeedFolder::uploadFolder() . $this->providerName . '/' . $file_name . '.' . $this->fileformat;
     $file_path = PFeedFolder::uploadURL() . $this->providerName . '/' . $file_name . '.' . $this->fileformat;
     //Special (WordPress): where admin is https and site is http, path to wp-uploads works out incorrectly as https
     //  we check the content_url() for https... if not present, patch the file_path
     if ($pfcore->cmsName == 'WordPress' && strpos($file_path, 'https://') !== false && strpos(content_url(), 'https') === false) {
         $file_path = str_replace('https://', 'http://', $file_path);
     }
     //Create the Feed
     $this->logActivity('Creating feed data');
     $this->filename = $file_url;
     $this->productCount = 0;
     $content = 'Place-Holder File, This file will be replaced next refresh, To manually fill this data, go to manage feeds and click [Update Now]';
     file_put_contents($this->filename, $content);
     $this->logActivity('Updating Feed List');
     PFeedActivityLog::updateFeedList($category, $remote_category, $file_name, $file_path, $this->providerName, $this->productCount);
     //Save the feedlist
     $id = PFeedActivityLog::feedDataToID($file_name, $this->providerName);
     $pfcore->settingSet('cpf_aggrfeedlist_' . $id, implode(',', $this->feed_list));
     if ($this->productCount == 0) {
         //$this->message .= '<br>No products returned';
         //return;
     }
     $this->success = true;
 }
 /**
  * Guess absolute path from file URL
  *
  * @param string $file_url File's url
  * @return string
  */
 public function guessPath($file_url)
 {
     $components = parse_url($file_url);
     // Check we have at least a path
     if (!isset($components['path'])) {
         return false;
     }
     $file_path = false;
     $wp_plugin_url = plugins_url();
     $wp_content_url = content_url();
     // Script is enqueued from a plugin
     $url_regex = $this->getUrlRegex($wp_plugin_url);
     if (preg_match($url_regex, $file_url) > 0) {
         $file_path = WP_PLUGIN_DIR . preg_replace($url_regex, '', $file_url);
     }
     // Script is enqueued from a theme
     $url_regex = $this->getUrlRegex($wp_content_url);
     if (preg_match($url_regex, $file_url) > 0) {
         $file_path = WP_CONTENT_DIR . preg_replace($url_regex, '', $file_url);
     }
     // Script is enqueued from wordpress
     if (strpos($file_url, WPINC) !== false) {
         $file_path = untrailingslashit(ABSPATH) . $file_url;
     }
     return $file_path;
 }
Пример #7
0
/**
 * Read or enqueue Java script files listed in $jss.
 * @since 3.3.2
 */
function qtranxf_loadfiles_js($jss, $enqueue_script)
{
    $cnt = 0;
    $deps = array();
    foreach ($jss as $k => $js) {
        if (isset($js['javascript']) && !empty($js['javascript'])) {
            echo $js['javascript'];
        } else {
            if (isset($js['src'])) {
                $src = $js['src'];
                if ($enqueue_script) {
                    $handle = isset($js['handle']) ? $js['handle'] : (is_string($k) ? $k : 'qtranslate-admin-js-' . ++$cnt);
                    $ver = isset($js['ver']) ? $js['ver'] : QTX_VERSION;
                    $url = content_url($src);
                    wp_register_script($handle, $url, $deps, $ver, true);
                    wp_enqueue_script($handle);
                    $deps[] = $handle;
                } else {
                    $fp = WP_CONTENT_DIR . '/' . $src;
                    readfile($fp);
                }
            }
        }
    }
}
Пример #8
0
function seller_profile($atts)
{
    global $wpdb;
    $obj_mp20 = new MP_Form_Handler();
    $obj_mp20->profile_edit_redirection();
    $current_user = wp_get_current_user();
    $table_users = $wpdb->prefix . "users";
    $table_seller = $wpdb->prefix . "mpsellerinfo";
    $myrows = $wpdb->get_results("SELECT u.*,s.* FROM " . $table_users . " u join " . $table_seller . " s on s.user_id=u.ID where u.ID='{$current_user->ID}'");
    $user_rows = $wpdb->get_results("select um.meta_key,um.meta_value from {$wpdb->usermeta} um where um.user_id='{$current_user->ID}'");
    $user_meta = array();
    foreach ($user_rows as $value) {
        $user_meta[$value->meta_key] = $value->meta_value;
    }
    $avatar = $obj_mp20->get_user_avatar($current_user->ID, 'avatar');
    echo '<section id="contentForm">';
    echo '<form method="post"><h1>Profile</h1>';
    echo '<div><img src="' . content_url() . '/uploads/' . $avatar[0]->meta_value . '" width="50" height="50"></div> <br />';
    echo '<div>Username: '******'</div><br />';
    echo '<div>User email: ' . $current_user->user_email . '</div><br />';
    echo '<div>User first name: ' . $current_user->user_firstname . '</div><br />';
    echo '<div>User last name: ' . $current_user->user_lastname . '</div><br />';
    echo '<div>User display name: ' . $current_user->display_name . '</div><br />';
    echo '<div><a class="button" href="' . get_permalink() . '?page=pedit" title="Edit Profile">Edit</a>&nbsp;&nbsp;<a class="button" href="' . wp_logout_url() . '" title="Logout">Logout</a><br /></div></form>';
    echo '</section>';
}
Пример #9
0
 public function getBaseUrl()
 {
     $dirFromFile = dirname(dirname(__FILE__));
     $dirFromFile = str_replace('\\', '/', $dirFromFile);
     $pos = strpos($dirFromFile, 'wp-content') + strlen('wp-content');
     return content_url() . '/' . substr($dirFromFile, $pos);
 }
Пример #10
0
 public static function init()
 {
     global $wp_filesystem;
     // Windows-proof constants: replace backward by forward slashes. Thanks to: @peterbouwmeester
     self::$_dir = trailingslashit(Redux_Helpers::cleanFilePath(dirname(__FILE__)));
     $wp_content_dir = trailingslashit(Redux_Helpers::cleanFilePath(WP_CONTENT_DIR));
     $wp_content_dir = trailingslashit(str_replace('//', '/', $wp_content_dir));
     $relative_url = str_replace($wp_content_dir, '', self::$_dir);
     self::$wp_content_url = trailingslashit(Redux_Helpers::cleanFilePath(is_ssl() ? str_replace('http://', 'https://', WP_CONTENT_URL) : WP_CONTENT_URL));
     self::$_url = self::$wp_content_url . $relative_url;
     // See if Redux is a plugin or not
     if (strpos(Redux_Helpers::cleanFilePath(__FILE__), Redux_Helpers::cleanFilePath(get_stylesheet_directory())) !== false) {
         self::$_is_plugin = false;
     }
     // Create our private upload directory
     Redux_Functions::initWpFilesystem();
     self::$_upload_dir = trailingslashit($wp_filesystem->wp_content_dir()) . '/redux/';
     self::$_upload_url = trailingslashit(content_url()) . '/redux/';
     if (function_exists('sys_get_temp_dir')) {
         $tmp = sys_get_temp_dir();
         if (empty($tmp)) {
             $tmpDir = self::$_upload_url . 'tmp';
             if (file_exists($tmpDir)) {
                 Redux_Helpers::rmdir($tmpDir);
             }
             putenv('TMPDIR=' . self::$_upload_dir . 'tmp');
         }
     }
     // Ensure it exists
     if (!is_dir(self::$_upload_dir)) {
         // Create the directory
         $wp_filesystem->mkdir(self::$_upload_dir);
     }
 }
Пример #11
0
function get_theme_root_uri($stylesheet_or_template = false, $theme_root = false)
{
    if ($stylesheet_or_template && !$theme_root) {
        $theme_root = get_raw_theme_root($stylesheet_or_template);
    }
    if ($stylesheet_or_template && $theme_root) {
        if (in_array($theme_root, (array) $wp_theme_directories)) {
            // Absolute path. Make an educated guess. YMMV -- but note the filter below.
            if (0 === strpos($theme_root, WP_CONTENT_DIR)) {
                $theme_root_uri = content_url(str_replace(WP_CONTENT_DIR, '', $theme_root));
            } elseif (0 === strpos($theme_root, ABSPATH)) {
                $theme_root_uri = site_url(str_replace(ABSPATH, '', $theme_root));
            } elseif (0 === strpos($theme_root, WP_PLUGIN_DIR) || 0 === strpos($theme_root, WPMU_PLUGIN_DIR)) {
                $theme_root_uri = plugins_url(basename($theme_root), $theme_root);
            } else {
                $theme_root_uri = $theme_root;
            }
        } else {
            $theme_root_uri = content_url($theme_root);
        }
    } else {
        $theme_root_uri = content_url();
    }
    return apply_filters('theme_root_uri', $theme_root_uri, get_option('siteurl'), $stylesheet_or_template);
}
Пример #12
0
 /**
  * Instantiates Env Manager object
  * 
  */
 protected function __construct()
 {
     $uploads_data = wp_upload_dir();
     $template_url = get_bloginfo('template_url');
     // Instantiate paths collection object
     $this->__urls = new Collection(array('home' => home_url(), 'admin' => admin_url(), 'plugins' => plugins_url(), 'content' => content_url(), 'uploads' => $uploads_data['baseurl'], 'themes' => str_replace('/' . basename($template_url), '', $template_url), 'theme' => $template_url));
 }
Пример #13
0
function bluerockre_slider_scripts()
{
    if (is_singular('portfolio')) {
        wp_enqueue_script('slider', content_url() . '/plugins/bluerock-portfolio/slider/js/lightslider.js', false, 1.0, false);
        wp_enqueue_style('slider', content_url() . '/plugins/bluerock-portfolio/slider/css/lightslider.css');
    }
}
Пример #14
0
 private function constants()
 {
     # Dirs
     define('THESIS_LIB', TEMPLATEPATH . '/lib');
     define('THESIS_ADMIN', THESIS_LIB . '/admin');
     define('THESIS_CORE', THESIS_LIB . '/core');
     define('THESIS_JS', THESIS_LIB . '/js');
     define('THESIS_SKINS', THESIS_LIB . '/skins');
     # URLs
     define('THESIS_URL', get_bloginfo('template_url'));
     #wp
     define('THESIS_CSS_URL', THESIS_URL . '/lib/css');
     define('THESIS_JS_URL', THESIS_URL . '/lib/js');
     define('THESIS_IMAGES_URL', THESIS_URL . '/lib/images');
     # User dirs
     define('THESIS_USER', WP_CONTENT_DIR . '/thesis');
     define('THESIS_USER_SKINS', THESIS_USER . '/skins');
     define('THESIS_USER_BOXES', THESIS_USER . '/boxes');
     define('THESIS_USER_PACKAGES', THESIS_USER . '/packages');
     # User URLs
     define('THESIS_USER_URL', content_url('thesis'));
     define('THESIS_USER_SKINS_URL', THESIS_USER_URL . '/skins');
     define('THESIS_USER_BOXES_URL', THESIS_USER_URL . '/boxes');
     define('THESIS_USER_PACKAGES_URL', THESIS_USER_URL . '/packages');
     if (is_multisite()) {
         define('THESIS_MS_CSS_VAL', substr(str_rot13(md5("ms-css_{$GLOBALS['blog_id']}")), 0, 5));
     }
 }
Пример #15
0
function export()
{
    global $wpdb;
    $px_table_name = $wpdb->prefix . 'gcm_users';
    $query = "SELECT * FROM {$px_table_name}";
    $datas = $wpdb->get_results($query);
    $url = wp_nonce_url('admin.php?page=px-gcm-export', 'px-gcm-export');
    if (false === ($creds = request_filesystem_credentials($url, '', false, false, null))) {
        return true;
    }
    if (!WP_Filesystem($creds)) {
        // our credentials were not good, ask the user for them again
        request_filesystem_credentials($url, '', true, false, null);
        return true;
    }
    global $wp_filesystem;
    $contentdir = trailingslashit($wp_filesystem->wp_content_dir());
    $in = "Databse ID;GCM Registration ID;Device OS;Device Model;Created At;Messages sent to this Device;\n";
    foreach ($datas as $data) {
        $in .= $data->id . ";" . $data->gcm_regid . ";" . $data->os . ";" . $data->model . ";" . $data->created_at . ";" . $data->send_msg . "\n";
    }
    mb_convert_encoding($in, "ISO-8859-1", "UTF-8");
    if (!$wp_filesystem->put_contents($contentdir . 'GCM-Export.csv', $in, FS_CHMOD_FILE)) {
        echo 'Failed saving file';
    }
    return content_url() . "/GCM-Export.csv";
}
Пример #16
0
 /**
  * @ticket 18302
  *
  * @dataProvider data_theme_files
  */
 public function test_theme_file_uri_with_child_theme($file, $expected_theme, $existence)
 {
     switch_theme('theme-file-child');
     // Ensure the returned URL uses the expected theme:
     $this->assertSame(content_url("themes/{$expected_theme}/{$file}"), get_theme_file_uri($file));
     // Ensure the returned URL always uses the parent theme:
     $this->assertSame(content_url("themes/theme-file-parent/{$file}"), get_parent_theme_file_uri($file));
 }
/**
 * Returns the non-CDN URI to the VIP themes dir.
 *
 * Sometimes enqueuing/inserting resources can trigger cross-domain errors when
 * using the CDN, so this function allows bypassing the CDN to eradicate those
 * unwanted errors.
 *
 * @return string The URI
 */
function wpcom_vip_themes_root_uri()
{
    if (!is_admin()) {
        return home_url('/wp-content/themes');
    } else {
        return content_url('/themes');
    }
}
Пример #18
0
 protected function contentFilePathToURL($abs_path)
 {
     $url = null;
     if (is_file($abs_path) && strpos($abs_path, WP_CONTENT_DIR) === 0) {
         $url = str_replace(WP_CONTENT_DIR, content_url(), $abs_path);
     }
     return $url;
 }
Пример #19
0
 /**
  * Resolves URL to a path accessible through the local file system
  *
  * @param $imageUrl
  *
  * @return string
  */
 private static function getPathByUrl($imageUrl)
 {
     $contentUrl = content_url();
     if (strpos($imageUrl, '/') === 0) {
         $imageUrl = self::getRootUrl() . $imageUrl;
     }
     return WP_CONTENT_DIR . str_replace($contentUrl, '', $imageUrl);
 }
Пример #20
0
 /**
  * Returns the URL for a given file based on the full file path passed in
  * @param $filepath
  * @return string
  */
 public function getUrlForPath($filepath)
 {
     $base = content_url();
     $file_real_path = self::clean($filepath, '/');
     $site_real_path = self::clean(WP_CONTENT_DIR, '/');
     $url_path = $base . str_replace($site_real_path, '', $file_real_path);
     return $url_path;
 }
function setCSSHead()
{
    global $wpdb;
    $resultProduct = $wpdb->get_results("SELECT * FROM wc_CSSDirectory");
    foreach (glob($resultProduct, GLOB_NOSORT) as $cssPath) {
        wp_enqueue_style('customStyle', content_url($cssPath, __FILE__));
    }
}
 function switch_url($link, $img, $url)
 {
     if (file_exists(WP_CONTENT_DIR . '/smilies/package-config.php')) {
         return content_url('/smilies/' . $img);
     } elseif (file_exists(dirname(__FILE__) . '/smilies/package-config.php')) {
         return plugins_url('/smilies/' . $img, __FILE__);
     }
     return $link;
 }
Пример #23
0
function cycloneslider_init()
{
    global $cyclone_slider_plugin_instance;
    $plugin = new CycloneSlider_Plugin();
    $plugin['path'] = realpath(plugin_dir_path(__FILE__)) . DIRECTORY_SEPARATOR;
    $plugin['url'] = plugin_dir_url(__FILE__);
    $plugin['version'] = 'cycloneslider_service_plugin_version';
    $plugin['debug'] = false;
    $plugin['textdomain'] = 'cycloneslider';
    $plugin['slug'] = 'cyclone-slider-pro/cyclone-slider.php';
    $plugin['nonce_name'] = 'cyclone_slider_builder_nonce';
    $plugin['nonce_action'] = 'cyclone-slider-save';
    $plugin['wp_upload_location'] = 'cycloneslider_wp_upload_location';
    $plugin['wp_content_dir'] = 'cycloneslider_service_wp_content_dir';
    $plugin['wp_content_url'] = content_url();
    $plugin['cyclone_slider_dir'] = 'cycloneslider_service_cyclone_slider_dir';
    // Folder where plugin related functions are performed
    $plugin['view_folder'] = $plugin['path'] . 'views';
    $plugin['view'] = 'cycloneslider_service_view';
    $plugin['image_resizer'] = 'cycloneslider_service_image_resizer';
    $plugin['image_editor'] = 'CycloneSlider_ImageEditor';
    $plugin['image_sizes'] = array('40_40_crop' => array('width' => 40, 'height' => 40, 'resize_option' => 'crop'), '60_60_crop' => array('width' => 60, 'height' => 60, 'resize_option' => 'crop'));
    $plugin['image_sizes'] = apply_filters('cycloneslider_image_sizes', $plugin['image_sizes']);
    $plugin['data'] = 'cycloneslider_service_data';
    $plugin['nextgen_integration'] = 'cycloneslider_service_nextgen';
    $plugin['exporter'] = 'cycloneslider_service_exporter';
    $plugin['exports_dir'] = $plugin['cyclone_slider_dir'] . '/exports';
    $plugin['export_json_file'] = 'export.json';
    $plugin['importer'] = 'cycloneslider_service_importer';
    $plugin['imports_dir'] = $plugin['cyclone_slider_dir'] . '/imports';
    $plugin['imports_extracts_dir'] = $plugin['imports_dir'] . '/extracts';
    $plugin['import_zip_name'] = 'import.zip';
    $plugin['zip_archive'] = 'ZipArchive';
    // Order is important. core is overridden by active-theme which in turn is overridden by wp-content.
    $plugin['template_locations'] = array(array('path' => $plugin['path'] . 'templates' . DIRECTORY_SEPARATOR, 'url' => $plugin['url'] . 'templates/', 'location_name' => 'core'), array('path' => realpath(get_stylesheet_directory()) . DIRECTORY_SEPARATOR . 'cycloneslider' . DIRECTORY_SEPARATOR, 'url' => get_stylesheet_directory_uri() . "/cycloneslider/", 'location_name' => 'active-theme'), array('path' => $plugin['wp_content_dir'] . DIRECTORY_SEPARATOR . 'cycloneslider' . DIRECTORY_SEPARATOR, 'url' => $plugin['wp_content_url'] . "/cycloneslider/", 'location_name' => 'wp-content'));
    $plugin['settings_page'] = 'cycloneslider_service_settings_page';
    $plugin['settings_page_properties'] = array('parent_slug' => 'edit.php?post_type=cycloneslider', 'page_title' => __('Cyclone Slider Settings', $plugin['textdomain']), 'menu_title' => __('Settings', $plugin['textdomain']), 'capability' => 'manage_options', 'menu_slug' => 'cycloneslider-settings', 'option_group' => 'cyclone_option_group', 'option_name' => 'cyclone_option_name');
    $plugin['export_page'] = 'cycloneslider_service_export_page';
    $plugin['export_page_properties'] = array('parent_slug' => 'edit.php?post_type=cycloneslider', 'page_title' => __('Cyclone Slider Export', $plugin['textdomain']), 'menu_title' => __('Export/Import', $plugin['textdomain']), 'capability' => 'manage_options', 'menu_slug' => 'cycloneslider-export', 'transient_name' => 'cycloneslider_export_transient', 'nonce_name' => 'cycloneslider_export_nonce', 'nonce_action' => 'cycloneslider_export', 'url' => get_admin_url(get_current_blog_id(), 'edit.php?post_type=cycloneslider&page=cycloneslider-export'));
    //$plugin['export_page_nextgen'] = 'cycloneslider_service_export_page_nextgen';
    $plugin['export_page_nextgen_properties'] = array('parent_slug' => '', 'page_title' => __('Cyclone Slider Nextgen Export', $plugin['textdomain']), 'menu_title' => __('Export Nextgen', $plugin['textdomain']), 'capability' => 'manage_options', 'menu_slug' => 'cycloneslider-export-nextgen', 'transient_name' => 'cycloneslider_export_nextgen_transient', 'nonce_name' => 'cycloneslider_export_nextgen_nonce', 'nonce_action' => 'cycloneslider_export_nextgen', 'url' => get_admin_url(get_current_blog_id(), 'edit.php?post_type=cycloneslider&page=cycloneslider-export-nextgen'));
    $plugin['import_page'] = 'cycloneslider_service_import_page';
    $plugin['import_page_properties'] = array('parent_slug' => '', 'page_title' => __('Cyclone Slider Import', $plugin['textdomain']), 'menu_title' => __('Import', $plugin['textdomain']), 'capability' => 'manage_options', 'menu_slug' => 'cycloneslider-import', 'nonce_name' => 'cycloneslider_import_nonce', 'nonce_action' => 'cycloneslider_import', 'url' => get_admin_url(get_current_blog_id(), 'edit.php?post_type=cycloneslider&page=cycloneslider-import'));
    $plugin['zip_archive'] = 'cycloneslider_service_zip_archive';
    $plugin['youtube'] = new CycloneSlider_Youtube();
    $plugin['vimeo'] = new CycloneSlider_Vimeo();
    $plugin['asset_loader'] = 'cycloneslider_service_asset_loader';
    $plugin['admin'] = 'cycloneslider_service_admin';
    $plugin['frontend'] = 'cycloneslider_service_frontend';
    $plugin['updater'] = 'cycloneslider_service_updater';
    $plugin['updater_properties'] = array('info_url' => 'http://support.codefleet.net/api/plugins/cyclone-slider-pro/latest/info', 'download_url' => 'http://support.codefleet.net/api/plugins/cyclone-slider-pro/latest/download');
    $plugin['widgets'] = new CycloneSlider_Widgets();
    require_once $plugin['path'] . 'src/functions.php';
    // Function not autoloaded from the old days. Deprecated
    $plugin->run();
    $cyclone_slider_plugin_instance = $plugin;
}
Пример #24
0
 /**
  * Configure paths for the stylesheet
  * Since this moment, everything is configured to be usable
  *
  * @protected
  * @author oncletom
  * @since 1.0
  * @version 1.1
  */
 protected function configurePath()
 {
     $target_file = $this->computeTargetPath();
     $this->source_path = apply_filters('wp-less_stylesheet_source_path', WP_CONTENT_DIR . preg_replace('#^' . content_url() . '#U', '', $this->stylesheet->src), $this->stylesheet);
     $this->source_uri = $this->stylesheet->src;
     $this->target_path = self::$upload_dir . $target_file;
     $this->target_uri = self::$upload_uri . $target_file;
     $this->setSourceTimestamp(filemtime($this->source_path));
 }
Пример #25
0
 /**
  * Configure paths for the stylesheet
  * Since this moment, everything is configured to be usable
  *
  * @protected
  * @author villeristi
  * @since 1.0
  * @version 1.1.1
  */
 protected function configurePath()
 {
     $target_file = $this->computeTargetPath();
     $this->source_path = WP_CONTENT_DIR . preg_replace('#^' . content_url() . '#U', '', $this->stylesheet->src);
     $this->source_uri = $this->stylesheet->src;
     $this->target_path = trailingslashit(self::$upload_dir) . basename($target_file);
     $this->target_uri = trailingslashit(self::$upload_uri) . basename($target_file);
     $this->setSourceTimestamp(filemtime($this->source_path));
 }
Пример #26
0
 /**
  * Configure paths for the stylesheet
  * Since this moment, everything is configured to be usable
  *
  * @protected
  * @author oncletom
  * @since 1.0
  * @version 1.1
  */
 protected function configurePath()
 {
     $target_file = $this->computeTargetPath();
     $this->source_path = WP_CONTENT_DIR . preg_replace('#^' . content_url() . '#U', '', $this->stylesheet->src);
     $this->source_uri = $this->stylesheet->src;
     $this->target_path = self::$upload_dir . $target_file;
     $this->target_uri = self::$upload_uri . $target_file;
     $this->source_timestamp = filemtime($this->source_path);
 }
Пример #27
0
/**
 * Favicon
 **/
function frl_favicon()
{
    $favicon_test = WP_CONTENT_DIR . '/favicon.ico';
    //in the root not working don't know why
    if (!file_exists($favicon_test)) {
        return;
    }
    $favicon = content_url('favicon.ico');
    echo "<link href='{$favicon}' rel='shortcut icon' type='image/x-icon' >";
}
 /**
  * Adds Inbound Rocket link to top-level admin bar
  */
 function add_inboundrocket_link_to_admin_bar($wp_admin_bar)
 {
     global $wp_version;
     if (!current_user_can('activate_plugins')) {
         if (!array_key_exists('ir_grant_access_to_' . inboundrocket_get_user_role(), get_option('inboundrocket_options'))) {
             return FALSE;
         }
     }
     $args = array('id' => 'inboundrocket-admin-menu', 'title' => '<span class="ab-icon" ' . ($wp_version < 3.8 && !is_plugin_active('mp6/mp6.php') ? ' style="margin-top: 3px;"' : '') . '><img src="' . content_url() . '/plugins/inbound-rocket/img/inboundrocket-svg-icon.svg" style="height:16px; width:16px;"></span><span class="ab-label">Inbound Rocket</span>', 'parent' => FALSE, 'href' => admin_url('admin.php?page=inboundrocket_stats'), 'meta' => array('title' => 'Inbound Rocket'));
     $wp_admin_bar->add_node($args);
 }
Пример #29
0
 /**
  * Create image object
  * 
  * Manage remote image objects. Cache locally so we can resize and serve 
  * optimized image dimensions.
  * 
  * @param string $url  Remote image URL
  * @param string $name (optional) image file name prefix
  */
 public function __construct($url, $file_name = '')
 {
     $this->source_url = trim($url);
     $this->file_name = sanitize_title($file_name);
     $this->file_extension = $this->extract_file_extension();
     $this->id = md5($url . $this->file_name);
     // create subdirectories to avoid too many directories in the root directory
     $id_directory = substr($this->id, 0, 2) . '/' . substr($this->id, 2);
     $this->upload_basedir = self::cache_dir() . $id_directory;
     $this->upload_baseurl = content_url('cache/podlove/') . $id_directory;
 }
Пример #30
0
function wptouch_get_desktop_bloginfo($param)
{
    switch ($param) {
        case 'stylesheet_directory':
        case 'template_url':
        case 'template_directory':
            return content_url() . '/themes/' . get_option('template');
        default:
            return get_bloginfo($param);
    }
}