Example #1
0
/**
 * Return an array of sites
 *
 * @return array array of site's blognames indexed by ID  
 */
function oik_ms_site_list()
{
    oik_require("shortcodes/oik-blogs.php", "oik-ms");
    $blogs = bw_get_blog_list();
    $site_select = array();
    foreach ($blogs as $blog) {
        $bloginfo = bw_get_bloginfo($blog);
        $site_select[$blog] = $bloginfo->blogname;
    }
    return $site_select;
}
Example #2
0
/**
 * Display information about a blog in a particular format
 *
 * 
 */
function bw_display_blog($id, $atts, $content)
{
    $bloginfo = bw_get_bloginfo($id);
    if ($bloginfo) {
        if (is_numeric($id)) {
            $url = get_blogaddress_by_id($id);
        } else {
            $url = get_blogaddress_by_name($id);
        }
        $blog = $bloginfo->blog_id;
        switch_to_blog($blog);
        if ($content) {
            e(bw_do_shortcode($content));
        } else {
            alink(null, $url, $bloginfo->blogname);
        }
        restore_current_blog();
    }
}