function widget($args, $instance)
    {
        global $wpdb;
        $blog_id = isset($instance['blog_id']) ? $instance['blog_id'] : 1;
        $show_banner = isset($instance['show_banner']) ? $instance['show_banner'] : 1;
        $title = isset($instance['title']) ? $instance['title'] : '';
        $blog = get_blog_details($blog_id);
        $img = get_blog_option($blog_id, 'header_img');
        if ($show_banner == 0 || empty($img)) {
            $img = $blog->blogname;
        } else {
            $img = '<img src="' . $img . '" alt="' . str_replace('"', '', $blog->blogname) . '"/>';
        }
        echo $args['before_widget'];
        if ($title != '') {
            echo $args['before_title'] . $title . $args['after_title'];
        }
        echo $args['before_content'];
        ?>
      <a href="<?php 
        echo $blog->siteurl;
        ?>
"><?php 
        echo $img;
        ?>
</a>
      <?php 
        echo $args['after_content'] . $args['after_widget'];
    }
Example #2
0
function sitesettings_get_blog_subdomain()
{
    $blog_details = get_blog_details(get_current_blog_id());
    $domain = $blog_details->domain;
    $domain = explode('.', $domain);
    return $domain[0];
}
Example #3
0
 /**
  *
  * @param string $name Name of the IP site being checked.
  *
  * @return bool
  */
 public function is_ip_site($name)
 {
     $site = get_blog_details();
     $home_domain = apply_filters('ip_home_domain', 'ip.wsu.edu');
     $home_path = apply_filters('ip_home_path', '/');
     $future_students_domain = apply_filters('ip_future_students_domain', 'ip.wsu.edu');
     $future_students_path = apply_filters('ip_future_students_path', '/future-students/');
     $study_english_domain = apply_filters('ip_study_english_domain', 'ip.wsu.edu');
     $study_english_path = apply_filters('ip_study_english_path', '/learn-english/');
     $study_abroad_domain = apply_filters('ip_study_abroad_domain', 'ip.wsu.edu');
     $study_abroad_path = apply_filters('ip_study_abroad_path', '/study-abroad/');
     $scholars_abroad_domain = apply_filters('ip_scholars_abroad_domain', 'ip.wsu.edu');
     $scholars_abroad_path = apply_filters('ip_scholars_abroad_path', '/scholars-abroad/');
     $on_campus_domain = apply_filters('ip_on_campus_domain', 'ip.wsu.edu');
     $on_campus_path = apply_filters('ip_on_campus_path', '/on-campus/');
     if ('ip-home' === $name && $home_domain === $site->domain && $home_path === $site->path) {
         return true;
     }
     if ('future-students' === $name && $future_students_domain === $site->domain && $future_students_path === $site->path) {
         return true;
     }
     if ('study-english' === $name && $study_english_domain === $site->domain && $study_english_path === $site->path) {
         return true;
     }
     if ('study-abroad' === $name && $study_abroad_domain === $site->domain && $study_abroad_path === $site->path) {
         return true;
     }
     if ('scholars-abroad' === $name && $scholars_abroad_domain === $site->domain && $scholars_abroad_path === $site->path) {
         return true;
     }
     if ('on-campus' === $name && $on_campus_domain === $site->domain && $on_campus_path === $site->path) {
         return true;
     }
     return false;
 }
Example #4
0
    public function metabox()
    {
        // Inform user no CPTs available to be shown.
        if (empty($this->sites)) {
            echo '<p>' . __('No items.') . '</p>';
            return;
        }
        global $nav_menu_selected_id;
        $html = '<ul id="multisite-nav-list">';
        foreach ($this->sites as $site) {
            $blog = get_blog_details($site['blog_id']);
            $html .= '<h4>' . $blog->blogname . ' Pages</h4>';
            foreach ($site['pages'] as $pt) {
                $html .= sprintf('<li>
					<label>
					<input type="hidden" name="blogId" value="' . $blog->blog_id . '">
					<input type="checkbox" value="%s" />&nbsp;%s</label></li>', $pt->ID, $pt->post_title);
            }
        }
        $html .= '</ul>';
        // 'Add to Menu' button
        $html .= '<p class="button-controls"><span class="add-to-menu">';
        $html .= '<input type="submit"' . disabled($nav_menu_selected_id, 0, false) . ' class="button-secondary
			  submit-add-to-menu right" value="' . esc_attr__('Add to Menu', 'hptal-textdomain') . '"
			  name="add-post-type-menu-item" id="submit-post-type-archives" />';
        $html .= '<span class="spinner"></span>';
        $html .= '</span></p>';
        print $html;
    }
Example #5
0
 /**
  * @internal
  * @param string|int $site_name_or_id
  */
 protected function init_with_multisite($site_name_or_id)
 {
     if ($site_name_or_id === null) {
         //this is necessary for some reason, otherwise returns 1 all the time
         if (is_multisite()) {
             restore_current_blog();
             $site_name_or_id = get_current_blog_id();
         }
     }
     $info = get_blog_details($site_name_or_id);
     $this->import($info);
     $this->ID = $info->blog_id;
     $this->id = $this->ID;
     $this->name = $this->blogname;
     $this->title = $this->blogname;
     $this->url = $this->siteurl;
     $theme_slug = get_blog_option($info->blog_id, 'stylesheet');
     $this->theme = new TimberTheme($theme_slug);
     $this->language = get_bloginfo('language');
     $this->charset = get_bloginfo('charset');
     $this->pingback_url = get_bloginfo('pingback_url');
     $this->language_attributes = TimberHelper::function_wrapper('language_attributes');
     $this->description = get_blog_option($info->blog_id, 'blogdescription');
     $this->multisite = true;
     $this->admin_email = get_blog_option($info->blog_id, 'admin_email');
 }
Example #6
0
function wp_check_bind_user($username, $password)
{
    if (empty($password)) {
        return __('<strong>ERROR</strong>: The password field is empty.');
    }
    $userdata = get_userdatabylogin($username);
    if (!$userdata) {
        return sprintf(__('<strong>ERROR</strong>: Invalid username. <a href="%s" title="Password Lost and Found">Lost your password</a>?'), site_url('wp-login.php?action=lostpassword', 'login'));
    }
    if (is_multisite()) {
        // Is user marked as spam?
        if (1 == $userdata->spam) {
            return __('<strong>ERROR</strong>: Your account has been marked as a spammer.');
        }
        // Is a user's blog marked as spam?
        if (!is_super_admin($userdata->ID) && isset($userdata->primary_blog)) {
            $details = get_blog_details($userdata->primary_blog);
            if (is_object($details) && $details->spam == 1) {
                return __('Site Suspended.');
            }
        }
    }
    $userdata = apply_filters('wp_authenticate_user', $userdata, $password);
    if (is_wp_error($userdata)) {
        return;
    }
    if (!wp_check_password($password, $userdata->user_pass, $userdata->ID)) {
        return sprintf(__('<strong>ERROR</strong>: The password you entered for the username <strong>%1$s</strong> is incorrect. <a href="%2$s" title="Password Lost and Found">Lost your password</a>?'), $username, site_url('wp-login.php?action=lostpassword', 'login'));
    }
}
 /**
  * Start importer background process on production environment.
  */
 public function run()
 {
     // Get current deploy status (if any).
     $deploy_status = $this->api->get_deploy_status($this->batch->get_id());
     // Make sure background import for this job is not already running.
     if ($deploy_status > 0) {
         return;
     }
     // Inicate that background import is about to start.
     $this->api->set_deploy_status($this->batch->get_id(), 1);
     // Default site path.
     $site_path = '/';
     // Site path in multi-site setup.
     if (is_multisite()) {
         $site = get_blog_details();
         $site_path = $site->path;
     }
     // Trigger import script.
     $import_script = dirname(dirname(dirname(__FILE__))) . '/scripts/import-batch.php';
     $background_process = new Background_Process('php ' . $import_script . ' ' . ABSPATH . ' ' . get_site_url() . ' ' . $this->batch->get_id() . ' ' . $site_path . ' ' . $this->api->generate_import_key($this->batch));
     if (file_exists($import_script)) {
         $background_process->run();
     }
     if (!$background_process->get_pid()) {
         // Failed to start background import.
         $this->api->add_deploy_message($this->batch->get_id(), 'Batch import failed to start.', 'info');
         $this->api->set_deploy_status($this->batch->get_id(), 2);
     }
 }
 public function get_blog_details()
 {
     if (is_null($this->blog_details)) {
         $this->blog_details = get_blog_details();
     }
     return $this->blog_details;
 }
Example #9
0
function framemarket_listall_shops()
{
    global $wpdb;
    $query = "SELECT blog_id FROM " . $wpdb->base_prefix . "blogs WHERE spam != '1' AND archived != '1' AND deleted != '1' AND public = '1' ORDER BY path";
    $blogs = $wpdb->get_results($query);
    $blogs = apply_filters('framemarket_list_shops', $blogs);
    ?>
<select name="shoplist" onchange="document.location.href=this.options[this.selectedIndex].value;">
	<option value=""><?php 
    echo apply_filters('shop_drop_default_label', 'Visit a shop');
    ?>
</option>
	<?php 
    foreach ($blogs as $blog) {
        $blog_details = get_blog_details($blog->blog_id);
        ?>
<option value="<?php 
        echo $blog_details->siteurl;
        ?>
"> <?php 
        echo $blog_details->blogname;
        ?>
</option>
<?php 
    }
    ?>
 </select>
<?php 
}
Example #10
0
 public function prepare_items()
 {
     $current_page = $this->get_pagenum();
     $per_page = 10;
     global $blog_id;
     global $wpdb;
     global $pagenow;
     if (is_plugin_active_for_network('wp-piwik/wp-piwik.php')) {
         $total_items = $wpdb->get_var('SELECT COUNT(*) FROM ' . $wpdb->blogs);
         $blogs = \WP_Piwik\Settings::getBlogList($per_page, $current_page);
         foreach ($blogs as $blog) {
             $blogDetails = get_blog_details($blog['blog_id'], true);
             $this->data[] = array('name' => $blogDetails->blogname, 'id' => $blogDetails->blog_id, 'siteurl' => $blogDetails->siteurl, 'piwikid' => $this->wpPiwik->getPiwikSiteId($blogDetails->blog_id));
         }
     } else {
         $blogDetails = get_bloginfo();
         $this->data[] = array('name' => get_bloginfo('name'), 'id' => '-', 'siteurl' => get_bloginfo('url'), 'piwikid' => $this->wpPiwik->getPiwikSiteId());
         $total_items = 1;
     }
     $columns = $this->get_columns();
     $hidden = array();
     $sortable = array();
     $this->_column_headers = array($columns, $hidden, $sortable);
     $this->set_pagination_args(array('total_items' => $total_items, 'per_page' => $per_page));
     foreach ($this->data as $key => $dataset) {
         if (empty($dataset['piwikid']) || $dataset['piwikid'] == 'n/a') {
             $this->data[$key]['piwikid'] = __('Site not created yet.', 'wp-piwik');
         }
         if ($this->wpPiwik->isNetworkMode()) {
             $this->data[$key]['name'] = '<a href="index.php?page=wp-piwik_stats&wpmu_show_stats=' . $dataset['id'] . '">' . $dataset['name'] . '</a>';
         }
     }
     $this->items = $this->data;
     return count($this->items);
 }
function list_network_sites($atts)
{
    // Start by getting an array of information of all sites in the network.
    $info = array('network_id' => null, 'public' => null, 'archived' => null, 'mature' => null, 'spam' => null, 'deleted' => null, 'limit' => 100, 'offset' => 0);
    $siteInfos = wp_get_sites($info);
    // Use shortcode atts to determine list type, then begin the output variable $list with the right <li> tag.
    $listType = shortcode_atts(array('list' => "unordered"), $atts);
    if ($listType['list'] == "unordered") {
        $list = "<ul>";
    } else {
        if ($listType['list'] == "ordered") {
            $list = "<ol>";
        } else {
            $list = "Error: Incorrect shortcode was used. Please contact admin.";
            return $list;
        }
    }
    // Add the list content.
    foreach ($siteInfos as $siteInfo) {
        $blog_details = get_blog_details($siteInfo['blog_id']);
        $list .= "<li><a href='{$blog_details->siteurl}'>{$blog_details->blogname}</a></li>";
    }
    // Close the list tag.
    if ($listType['list'] == "unordered") {
        $list .= "</ul>";
    } else {
        $list .= "</ol>";
    }
    return $list;
}
Example #12
0
function uw_register_widgets()
{
    if (!is_blog_installed()) {
        return;
    }
    unregister_widget('Widget_Akismet');
    unregister_widget('WP_Widget_Meta');
    unregister_widget('WP_Widget_Recent_Posts');
    unregister_widget('WP_Widget_RSS');
    //register_widget('UW_Widget_Single_Image');
    //register_widget('UW_RSS_Widget');
    //register_widget('UW_Widget_Recent_Posts');
    //register_widget('UW_Widget_CommunityPhotos');
    register_widget('UW_Widget_Categories');
    //register_widget('UW_Widget_Twitter');
    //register_widget('UW_KEXP_KUOW_Widget');
    //register_widget('UW_Showcase_Widget');
    //register_widget('UW_Subpage_Menu');
    register_widget('UW_Nav_Menu_Widget');
    //register_widget('UW_Calendar');
    //register_widget('UW_Campus_Map');
    // Specific to Page Builder only
    register_widget('UW_Headline_Separator_Widget');
    register_widget('UW_Headline_Widget');
    register_widget('UW_Intro_Widget');
    //register_widget('UW_YouTube_Playlist_Widget');
    if (is_multisite() && get_blog_details('marketing')) {
        register_widget('UW_Pride_Points');
    }
}
/**
 * Get the "dashboard blog", the blog where users without a blog edit their profile data.
 * Dashboard blog functionality was removed in WordPress 3.1, replaced by the user admin.
 *
 * @since MU
 * @deprecated 3.1.0
 * @see get_blog_details()
 * @return int
 */
function get_dashboard_blog()
{
    _deprecated_function(__FUNCTION__, '3.1');
    if ($blog = get_site_option('dashboard_blog')) {
        return get_blog_details($blog);
    }
    return get_blog_details($GLOBALS['current_site']->blog_id);
}
/**
 * Run redirection
 * 
 * @param string $lang		Current language
 * @param string $req		Current path
 * @param array $sites		List of others sites
 */
function redirectTo($lang, $req, &$sites)
{
    if ($req == get_blog_details()->path) {
        header('Location: ' . $sites[$lang]);
    } else {
        header('Location: ' . $sites[$lang] . '404error');
    }
}
function login_site_redirect($redirect_to)
{
    global $user;
    $primary_blog_id = get_usermeta($user->ID, 'primary_blog');
    $blog_details = get_blog_details($primary_blog_id);
    $redirect_url = $blog_details->siteurl;
    return $redirect_url;
}
 function column_blog_id($item)
 {
     if (!empty($item['blog_id'])) {
         $blog = get_blog_details($item['blog_id']);
         return sprintf('<a href="%s">%s</a>', get_site_url($item['blog_id']), $blog->blogname);
     } else {
         return 'N/A';
     }
 }
Example #17
0
 private function prepare_item($blog)
 {
     $details = get_blog_details($blog);
     $id = $blog['blog_id'];
     switch_to_blog($id);
     $result = ['id' => $id, 'name' => $details->blogname, 'icon' => get_site_icon_url(), 'path' => $blog['path'], 'description' => get_bloginfo($blog), 'global' => in_array($id, $this->GLOBAL_SITE_IDS)];
     restore_current_blog();
     return $result;
 }
Example #18
0
 private function prepare_item($blog)
 {
     $details = get_blog_details($blog);
     $id = $blog['blog_id'];
     switch_to_blog($id);
     $result = ['id' => $id, 'name' => $details->blogname, 'icon' => get_site_icon_url(), 'cover_image' => get_header_image(), 'color' => '#FFA000', 'path' => $blog['path'], 'description' => get_bloginfo($blog), 'live' => in_array($id, $this->included_site_ids)];
     restore_current_blog();
     return $result;
 }
Example #19
0
 function add_site_title_body_class($classes)
 {
     $site = array_filter(explode('/', get_blog_details(get_current_blog_id())->path));
     array_shift($site);
     if (is_multisite()) {
         $classes[] = 'site-' . sanitize_html_class(implode('-', $site));
     }
     return $classes;
 }
Example #20
0
 /**
  * Set working domain name..
  * @param $the_domain
  * @return $this
  */
 public function set_domain($the_domain = false)
 {
     if ($the_domain == false || preg_match('/^[-a-z0-9]+\\.[a-z]{2,6}$/', strtolower($the_domain)) == false) {
         throw new Youtube_exception('Invalid domain.  Need to define domain and domain must follow the format domain.tld');
     }
     $this->_my_site = get_blog_details(array("domain" => $the_domain));
     switch_to_blog($this->_my_site->blog_id);
     $this->_my_data["categories"] = get_categories(array('orderby' => 'name', 'hide_empty' => 0));
     return $this;
 }
 function get_registered_date()
 {
     if (function_exists('get_blog_details')) {
         $blog_details = get_blog_details();
         if (!empty($blog_details->registered)) {
             return $this->format_date($blog_details->registered);
         }
     }
     return '0000-00-00T00:00:00+00:00';
 }
Example #22
0
 /**
  * Update the URL of a site
  *
  * @synopsis <ID> <NEW_URL> [--force]
  *
  * @param array $args
  * @param array $assoc_args
  */
 public function update(array $args = [], array $assoc_args = [])
 {
     $site_id = (int) $args[0];
     $site = get_blog_details($site_id, TRUE);
     if (!$site) {
         WP_CLI::error("A site with ID {$site_id} does not exist");
     }
     if (is_main_site($site_id)) {
         WP_CLI::error("The given site is the main site of the network. This feature does not support updating the main site URL");
     }
     $new_url = $args[1];
     if (!filter_var($new_url, FILTER_VALIDATE_URL)) {
         WP_CLI::error("{$new_url} is not a valid url");
     }
     /**
      * Parse the new URL components
      */
     $url_components = parse_url($new_url);
     $existing_scheme = parse_url($site->siteurl, PHP_URL_SCHEME);
     $scheme = isset($url_components['scheme']) ? $url_components['scheme'] : $existing_scheme;
     $host = isset($url_components['host']) ? $url_components['host'] : '';
     $path = isset($url_components['path']) ? trailingslashit($url_components['path']) : '/';
     // WP core does not accept ports in the URL so we don't too
     $site_details = get_object_vars($site);
     $site_details['domain'] = $host;
     $site_details['path'] = $path;
     /**
      * Update the site details (goes to the wp_blogs table)
      */
     update_blog_details($site_id, $site_details);
     // update 'home' and 'siteurl' in the options table
     switch_to_blog($site_id);
     $existing_home = trailingslashit(get_option('home'));
     $new_home = esc_url_raw($scheme . '://' . $host . $path);
     $new_home = untrailingslashit($new_home);
     // check if the actual 'home' value matches the old site URL
     if ($site->domain === parse_url($existing_home, PHP_URL_HOST) && $site->path === parse_url($existing_home, PHP_URL_PATH)) {
         update_option('home', $new_home);
     }
     $existing_site_url = trailingslashit(get_option('siteurl'));
     if ($site->domain === parse_url($existing_site_url, PHP_URL_HOST) && $site->path === parse_url($existing_site_url, PHP_URL_PATH)) {
         update_option('siteurl', $new_home);
     }
     /**
      * WP core deletes rewrite rules during the URL updating process
      *
      * @see wp-admin/network/site-info.php
      */
     delete_option('rewrite_rules');
     restore_current_blog();
     $new_home = trailingslashit($new_home);
     // append trailing slash for success report to avoid confusion
     WP_CLI::success("Update site URL to {$new_home}");
 }
 /**
  *
  * @return type
  */
 protected function getSiteList()
 {
     //retrieve site list first
     $blog_list = $this->retrieveSiteList();
     $response = array('iTotalRecords' => count($blog_list), 'iTotalDisplayRecords' => count($blog_list), 'sEcho' => aam_Core_Request::request('sEcho'), 'aaData' => array());
     $default = aam_Core_API::getBlogOption('aam_default_site', 0, 1);
     foreach ($blog_list as $site) {
         $blog = get_blog_details($site->blog_id);
         $response['aaData'][] = array($site->blog_id, get_admin_url($site->blog_id, 'admin.php'), get_admin_url($site->blog_id, 'admin-ajax.php'), $blog->blogname, '', $site->blog_id == $default ? 1 : 0);
     }
     return json_encode($response);
 }
 public static function inspect($user_id, $old_user_data = array())
 {
     $current_user = wp_get_current_user();
     $updated_user = get_user_by('id', $user_id);
     if (!$updated_user instanceof WP_User) {
         return "";
     }
     $changed_user_properties = array();
     foreach (get_object_vars($updated_user->data) as $property_key => $property_val) {
         if (in_array(gettype($property_val), array("integer", "string", "boolean")) && $old_user_data->{$property_key} != $property_val) {
             switch ($property_key) {
                 case "ID":
                 case "user_login":
                 case "user_nicename":
                 case "user_registered":
                 case "user_activation_key":
                 case "user_status":
                     // Because changes in any of the above is beyond the scope of this logging routine...
                     break;
                 case "user_pass":
                     $changed_user_properties[$property_key] = "password";
                     break;
                 case "user_email":
                     $changed_user_properties[$property_key] = "e-mail";
                     break;
                 case "user_url":
                     $changed_user_properties[$property_key] = "homepage";
                     break;
                 case "display_name":
                     $changed_user_properties[$property_key] = "display name";
                     break;
             }
         }
     }
     foreach ($changed_user_properties as $property_key => $property_label) {
         if ($property_key != 'user_pass') {
             $log_message = "The " . $property_label . " setting for " . $updated_user->display_name . " (" . $updated_user->user_login . ") " . "was changed from '" . $old_user_data->{$property_key} . "'' to '" . $updated_user->data->{$property_key} . "'";
         } else {
             $log_message = "The " . $property_label . " setting for " . $updated_user->display_name . " (" . $updated_user->user_login . ") " . "was changed";
         }
         if ($current_user instanceof WP_User) {
             $log_message .= " by " . $current_user->display_name . " (" . $current_user->user_login . ")";
         }
         if (is_multisite() && is_plugin_active_for_network(ACI_PLUGIN_BASENAME)) {
             $site_name = get_blog_details($site_id)->blogname;
             $log_message .= " on " . $site_name;
         }
         $log_message .= ".";
         AC_Inspector::log($log_message, __CLASS__);
     }
     return "";
 }
 public static function getAddress()
 {
     $hasAdderss = true;
     $address = [];
     for ($i = 0; $hasAdderss; $i++) {
         $hasAdderss = get_blog_option(self::getBlogID(), '_gmsites_address' . ($i + 1));
         if ($hasAdderss) {
             $hasAdderss['details'] = get_blog_details(self::getBlogID());
             $address[$i] = $hasAdderss;
         }
     }
     return $address;
 }
 function testSubDirectoryImageLocaion()
 {
     if (!is_multisite()) {
         $this->markTestSkipped('Test is only for Multisite');
         return;
     }
     $blog_id = TestTimberMultisite::createSubDirectorySite();
     $this->assertGreaterThan(1, $blog_id);
     $blog_details = get_blog_details($blog_id);
     $pretend_image = 'http://example.org/wp-content/2015/08/fake-pic.jpg';
     $is_external = TimberURLHelper::is_external_content($pretend_image);
     $this->assertFalse($is_external);
 }
    /**
     * Outputs the content of the widget
     *
     * @param array $args
     * @param array $instance
     */
    public function widget($args, $instance)
    {
        wp_enqueue_script('city-selector');
        wp_enqueue_script('city-map');
        wp_enqueue_style('jquery-ui-lightness');
        wp_enqueue_style('nn-menu-lib');
        wp_enqueue_style('city-selector');
        wp_enqueue_style('city-map');
        echo $args['before_widget'];
        echo $args['before_title'] . 'Nerd Nite Cities' . $args['after_title'];
        $cities = wp_get_sites();
        ?>
		<div id="nn-cities-widget">
			<select id="nerdnite-city-selector" data-placeholder="Choose a city...">
				<option value=""></option>
				<?php 
        $cityList = array();
        foreach ($cities as $city) {
            $blog_details = get_blog_details($city[blog_id]);
            if (preg_match("/.*Test.*/i", $blog_details->blogname)) {
                continue;
            } elseif (preg_match("/^[Nn]erd [Nn]ite (.*)\$/", $blog_details->blogname, $matches)) {
                $city_name = ucfirst($matches[1]);
                if (in_array($city_name, ["Template", "Aimeeville", "Podcast"])) {
                    continue;
                }
                if ($city['public'] != "1" || $city['archived'] == "1" || $city['deleted'] == "1") {
                    continue;
                }
                array_push($cityList, array("domain" => $city[domain], "name" => $city_name));
            }
        }
        function citySort($a, $b)
        {
            return strnatcmp($a['name'], $b['name']);
        }
        usort($cityList, "citySort");
        foreach ($cityList as $city) {
            echo "<option value='{$city['domain']}'>{$city['name']}</option>";
        }
        ?>
			</select>
			<div id="nn-city-map-display">map</div>

			<div id="nn-map-of-cities-dialog">
				<div id="nn-map-of-cities"></div>
			</div>
		</div>
		<?php 
        echo $args['after_widget'];
    }
Example #28
0
function toolbar_scripts_method()
{
    $current_user = wp_get_current_user();
    $user_role = get_the_user_role($current_user);
    global $blog_id;
    $site_details = get_blog_details($blog_id, 'siteurl');
    if ($user_role == 'Professor' || $user_role == 'Super_admin') {
        wp_enqueue_script('jquery-ui-core');
        wp_enqueue_script('jquery-ui-resizable');
        wp_enqueue_style('jquery-ui-css', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/start/jquery-ui.css');
        wp_enqueue_script('seufolios_iframe_script', plugins_url('evaluation/js/iframe.js', __FILE__));
        wp_enqueue_style('prefix-style', plugins_url('evaluation/css/iframe.css', __FILE__));
    }
}
Example #29
0
function motopressCECheckDomainMapping()
{
    global $wpdb;
    if (is_multisite()) {
        if (is_plugin_active('domain-mapping/domain-mapping.php') || is_plugin_active('wordpress-mu-domain-mapping/domain_mapping.php')) {
            $blogDetails = get_blog_details();
            $mappedDomains = $wpdb->get_col(sprintf("SELECT domain FROM %s WHERE blog_id = %d ORDER BY id ASC", $wpdb->dmtable, $blogDetails->blog_id));
            if (!empty($mappedDomains)) {
                if (!in_array(parse_url($blogDetails->siteurl, PHP_URL_HOST), $mappedDomains)) {
                    add_action('admin_notices', 'motopressCEDomainMappingNotice');
                }
            }
        }
    }
}
 /**
  * Initialize the class and set its properties.
  *
  * @since    1.0.0
  * @param      string    $plugin_name       The name of this plugin.
  * @param      string    $version    The version of this plugin.
  */
 public function __construct($plugin_name, $version)
 {
     $this->plugin_name = $plugin_name;
     $this->version = $version;
     $this->redis = new Predis\Client(['scheme' => 'tcp', 'host' => REDIS_HOST, 'port' => REDIS_PORT, 'password' => REDIS_PASSWORD]);
     $this->blog_id = get_current_blog_id();
     if (function_exists('get_blog_details')) {
         $details = get_blog_details($this->blog_id, 'domain', false);
         $domain = $details->domain;
         $sub_domain = explode(".", $domain)[0];
         $this->sub_domain = $sub_domain;
     }
     Resque::setBackend(REDIS_HOST . ":" . REDIS_PORT, REDIS_DB);
     Resque_Event::listen('afterPerform', array('RooftopJob', 'afterPerform'));
 }