The MU forums have moved to WordPress.org

Common tag cloud? (27 posts)

  1. Konstan
    Member
    Posted 15 years ago #

    Since now mu is at 1.3 and has the tagging feature, has anyone tried to write a tag plugin to get tags from all blogs?

    I wish I knew what to do to code it, as it would be a great addition to my front page.

  2. theapparatus
    Member
    Posted 15 years ago #

    Been doing that for ages actually.

    - Set up the sitewide tag in a seperate wp blog solution we're discussed previously.

    - Install your favorite tag cloud plugin into the seperate wp install.

    - (Here's where it gets tricky) Create a blank Page Template within the seperate wp install with just the commented header that tells wp that it's a page template and a single function call to the tag cloud function. That's it. No wp-head or footer or anything else. Just the "It's a page template" bit and the function call.

    - Create a Page within your seperate wp install and use that Page template. (It's probably best to hide this page in your seperate install. Make it a subpage and don't list them or something)

    - Go back to your wpmu install and add in an iframe that calls the page that you created from the seperate blog. This is why you don't want to include anything else in that Page template because you just want to list the tags.

    Hope you can make sense of this. Andrea, if you understand this, this may be a good topic for a tutorial.

  3. andrea_r
    Moderator
    Posted 15 years ago #

    As soon as I test it and work through it myself, I will. :)

  4. Konstan
    Member
    Posted 15 years ago #

    Yeah I am aware of that method, but I was thinking more along a single plugin for wpmu.

    I'll try this to see how it goes.

  5. SteveAtty
    Member
    Posted 15 years ago #

    The Danalog site wide tagging system works well, and it is cross blog, and can easily be integrated into widgets, search etc.

    Not sure how the addition of site wide tags in 1.3 will affect it. I guess it needs looking into and I may well do that after I come back from Maine

  6. robbpdx
    Member
    Posted 15 years ago #

    Well... Can somebody give a pointer to info about how to use the new native site-wide tags without doing a hack?

  7. andrea_r
    Moderator
    Posted 15 years ago #

    Nobody's done it yet. Not that I'm aware of anyway.

  8. lunabyte
    Member
    Posted 15 years ago #

    The new tagging is for individual blogs, not site-wide.

  9. Konstan
    Member
    Posted 15 years ago #

    I am waiting on SimpleTags, the coder said he'll make it work with mu :)

  10. Bike
    Member
    Posted 15 years ago #

    The new SimpleTags already works, you just have to combine it with Danalogs/Daans sitewide tags solution, both out of teh box.
    See http://www.biketravellers.com (under construction :) for an example.

    Cheers Bike

  11. Konstan
    Member
    Posted 15 years ago #

    So you just placed the danalog wpmu file in mu-plugins as well as the simpleTags plugin into mu-plugins?

  12. Konstan
    Member
    Posted 15 years ago #

    I am setting up a test server to try and make it work, but I dont see how danalog would work since it looks for a table called stp_tags but SimpleTags doesnt create any tables as far as I can see.

    Did you edit any files? Also, the install path, did you change it or leave everything default?

  13. Bike
    Member
    Posted 15 years ago #

    ah, it seems you are right, my mistake :)
    Somehow it still works with the old tags, that were imported, but apparently are still around!
    New tags made do not appear, sorry about that, guess Amaury will come with a real solution soon,

    Cheers, bike

  14. Konstan
    Member
    Posted 15 years ago #

    I guess you could hack up the danalog file, but wp creates 3 tables for the tags and I get lost there :P

    I often wish I knew how to code.

  15. Konstan
    Member
    Posted 15 years ago #

    Ok, I got it working! Almost...

    I set up a test server at http://bh.kostya.cl and I got sitewide tags working, but when you click on a link you dont get a list of the posts...

    How did you make it work Bike?

  16. Bike
    Member
    Posted 15 years ago #

    Your site doesn't load so I cannot see what happens, but I remember the key was this part

    // use this function in the 404.php file in your template
    /*
    replace: <h2 class="center">Error 404 - Not Found</h2>
    with: <?php dmk_show_taglist(); ?>
    */

    Also make sure you got the latest version (from a few montsh ago at least), as Daan changed many minor things after I tested it for him. I suck at coding, but can stress-test like a champ ;-)

    Did you do that? What queries did you change to work with the new tags?

    Cheers, Bike

  17. Konstan
    Member
    Posted 15 years ago #

    Site loads fine now. I still cant get the template to load the posts, I just get the 404 not found template :(

    I replaced the first part of the code with this:

    $sites = $wpdb->get_results( "SELECT blog_id FROM wp_blogs", OBJECT);
        $array_tags = array();
        foreach($sites as $site){
          $table_tags = "wp_".$site->blog_id."_terms";
          $table_posts = "wp_".$site->blog_id."_posts";
        	if($exists = $wpdb->get_row("show tables like '$table_tags'")){
        		$tag_results = $wpdb->get_results("SELECT name FROM $table_tags WHERE term_id >2");
        		foreach ($tag_results as $tag) {
    				array_push($array_tags, strtolower($tag->name));
        		}
    		}
        }

    But cant get the post list to work :S

  18. Konstan
    Member
    Posted 15 years ago #

    Ah I give up on part 2, I guess I'll have to wait until someone who knows what he/she is doing to make it work.

  19. Konstan
    Member
    Posted 15 years ago #

    Ok, got it somewhat working. It works, but it will only show posts if the term has been used in blog 1, and will only show 1 post for each term per blog because thats how its setup in the database. This is it for me, gets too advanced from here on :P

  20. dbasulto
    Member
    Posted 15 years ago #

    The problem with theapparatus solution is that the Site Feed isnĀ“t adding the tags for each post. No idea why, since it uses the_category_rss , same as the regular feed which does add the post tags...

    but so far, this is the best solution: to have a regular WP install that gets its content trough the WPMU site wide feed, using feedwordpress plugin, then generating a tag cloud on the regular WP install and show it trough an iframe.

  21. andrea_r
    Moderator
    Posted 15 years ago #

    See other thread: tags are new, and not coded into the sitewide feed plugin yet.

  22. lunabyte
    Member
    Posted 15 years ago #

    Why do threads like this make me chuckle?

  23. Konstan
    Member
    Posted 15 years ago #

    Nevermind. Not worth it :P

  24. mrhenry
    Member
    Posted 15 years ago #

    I've done site wide tags by creating a plugin, which stores the term_id, blog_id, post_id and post_time into a separate table every time someone writes a post. Then it uses the wp_sitecategories table to get the correct name for the tag according to the term_id.

    This has been tested on a test server. And is also used at http://betraise.org/tags (Don't be scared of the amount of tags at betraise :) ) I haven't been able to test this on large wpmu sites, but I think that this approach shouldn't be too resource intensive either. At least if you use wp_cache to cache the mysql queries like I've done

    This works fine for me, and I might be able to share this with the community in a couple of days...

  25. demonicume
    Member
    Posted 15 years ago #

    sweet!! how about you share how you did the front page avatar thing. i'm about to take a bat to my test server! i may be willing to part with some dough for his solution.

  26. SteveAtty
    Member
    Posted 15 years ago #

    It does seem odd that the new tags are carried all the way up to the top. There is a wp_sitecategories table which contains all the tag and categories but at the top level we loose the taxonomy and the relationships.

    I would have though that the obvious way to get site wide tagging working would be to create the top level taxomony and a term_taxonomy table (with an additional blog_id column) ad to maintain these tables at the same time as the blog specific tables are maintained (i.e. when the wp_sitecategories table is maintained).

    Doing it that way easily allows tag sizing depending on the number of "hits" and would easily allow you to produce lists of links from a selected tag to the individual blog entries. Having read MrHenry's post it sounds like he has done something similar.

    It just seems odd that for a MutiUser system this functionality is missing.

    Then all we need is a bit of code to convert the contents of the stp_tags table for each blog into tags

  27. andrea_r
    Moderator
    Posted 15 years ago #

    mrhenry, I do believe you are on the right track.

About this Topic

  • Started 15 years ago by Konstan
  • Latest reply from andrea_r