The MU forums have moved to WordPress.org

display content from one blog in the backend of the other blogs (5 posts)

  1. torre
    Member
    Posted 15 years ago #

    Hi !

    I want to write a guide and news for the other admins, editors etc. in the backend of their blog. So I use one of our blogs to create pages and news. This Admin-Blog is accessible to logged in users only with the autheticator-plugin.

    Now i want to display the content of this blog in the backend of the other blogs: the news on the dashboard and the pages on one page in the backend. i have made a new area on the dashboard and and new site in the backend.

    But how can i display the content from another blog?
    I cant do this with rss, because the blog is only for loged in users (authenticator-plugin). Can I display the content directly from the database?

    thx.

    torre

  2. SteveAtty
    Member
    Posted 15 years ago #

    You can display it directly from the database. If you look at once of the Recent Posts plugins and then alter the code to only grab from a specific blog then that should give you the functionality you require.

  3. lunabyte
    Member
    Posted 15 years ago #

    As noted, absolutely grab it from the database. You could even cache the output, to keep from running the queries too frequently on content which most likely isn't going to change often.

    Shouldn't be too difficult to do, even from scratch. You know the table(s) you'll need to hit, so a quick SELECT x, y, z FROM prefix_X_table would do the trick. Run the actual query like once every few hours, store the results in a file or memcached (whatever is available), and it should be pretty light.

  4. dsader
    Member
    Posted 15 years ago #

    I'd use an mu-plugin rather than editing the dashboard directly:

    function ds_featured_output() {
    switch_to_blog('###');
    
    // http://codex.wordpress.org/Template_Tags/query_posts#Retrieve_a_Particular_Post
    
    echo 'http://codex.wordpress.org/The_Loop';
    
    // or
    // http://codex.wordpress.org/Template_Tags/query_posts#Retrieve_a_Particular_Page
    
    echo 'http://codex.wordpress.org/The_Loop';
    
    restore_current_blog();
    }
    add_action ('activity_box_end', 'ds_featured_output'); // hook to dashboard
  5. torre
    Member
    Posted 15 years ago #

    many thanks for your help !
    I think "switch_to_blog" is the function for me.

About this Topic