The MU forums have moved to WordPress.org

Site wide tagging plugin, the simple way: it works (50 posts)

  1. danalog
    Member
    Posted 16 years ago #

    I wrote a simple plugin for site wide tags. Did it in 3 hours, of which 2,5 were research, so don't expect heavy features. The code is just under 100 lines. For the coders it should be easy to adjust to specific needs.

    It works with a multidomain install, thats what I use it for.

    The plugin uses the tables used Simple Tagging plugin by Amaury Balmer. So you should really use that plugin too. With a little adjustment UTW could be used. Although I don't trust UTW because of the comment bug.

    http://code.danalog.nl/

    Have fun :)

  2. suleiman
    Member
    Posted 16 years ago #

    do you have a link to your tagging plugin in action? Can it be called as a function inside of a widget?

  3. danalog
    Member
    Posted 16 years ago #

    Yes, I have a working version: 11knights.com (which is still in alpha :))
    I think it could be used in a widget, try it!

  4. suleiman
    Member
    Posted 16 years ago #

    danalog, congratulations, your tag works and looks great.

    I see the following improvements over deltakid's tag solution, which I use on my own setup:

    1) SEF urls for tags. Simply awesome.

    2) The weight difference is also good, though that may be because of fewer categories right now.

    The problems?

    1) You're only showing the linked titles to posts under each tag category, why not display the whole post?

    That's all I can see for now! Great work!

  5. danalog
    Member
    Posted 16 years ago #

    Thanks!

    1) Is thare any other way? I'm not even bothering to write a query based url
    2) I think you mean the cloud? This is to be adjusted as more tags appear. Also it is not category based but tag based.

    1) I only show title because when scaled to thousends of posts the results would be rather overwhelming. It is possible to show an excerpt of 50/100/150 words. Fairly easy to do with some basic mysql/php.

    ====

    The plugin needs further development though. I forgot to exclude private posting for instance.

  6. SteveAtty
    Member
    Posted 16 years ago #

    If you are using subdirectories rather than subdomains you need to change :

      $sites = $wpdb->get_results( "SELECT * FROM wp_site", OBJECT);
      $array_tags = array();
      foreach($sites as $site){
        $table_tags = "wp_".$site->id."_stp_tags";
        $table_posts = "wp_".$site->id."_posts";
    

    to

      $sites = $wpdb->get_results( "SELECT blog_id FROM wp_blogs", OBJECT);
      $array_tags = array();
      foreach($sites as $site){
        $table_tags = "wp_".$site->blog_id."_stp_tags";
        $table_posts = "wp_".$site->blog_id."_posts";
    

    And a few other tweaks need to be done to get it working with subdirectories... if I get it working I'll let you know

  7. demonicume
    Member
    Posted 16 years ago #

    is simple tagging pulling sitewide for the rest of you, because it's only grabbing my main blogs tags. in fact, it has only imported my default category. i see in the plugin where its supposed to work with mu, i'm just not seeing in action. when i load SP in mu-plugins, i get no siteadmin. it works in plugins, but as i said, it doesnt pull all 400 categories/tags

  8. Ovidiu
    Member
    Posted 16 years ago #

    did anyone adapt simple tagging plugin for wpmu? I had one problem with it: it does miss a feature I love that comes with UTW: with UTW there is a simple checkbox to show tags below posts... with simple tagging I have to modify all themes to make them show tags below posts...

    I posted a solution for this somewhere here, even sent it to the author but no reaction. my solution for this worked, but needed some refinements...

  9. danalog
    Member
    Posted 16 years ago #

    Update: Version 1.1

    * Now works with (sub)domains and subdirectories
    * Now works with blogs in sub-subdirectories
    * Now works with tags with multiple words
    * Some small tweaks for settings

    Get it here: http://daankortenbach.nl/blog/webontwikkelaar/wpmu-site-wide-tags-solution/

  10. demonicume
    Member
    Posted 16 years ago #

    anyone got simple tagging orking in mu-plugins?

  11. danalog
    Member
    Posted 16 years ago #

    Yes, I have it working. Put files below in mu-plugins:

    simpletagging.admin.php
    simpletagging.php
    simpletagging.pot
    simpletagging.type-ahead.js

    The other files are for languages and to show you how to use it in your theme.

    More info: http://trac.herewithme.fr/project/simpletagging/

  12. sBlogSitecom
    Member
    Posted 16 years ago #

    hi danalog,

    thanks for your plugin.

    But I tink I have a problem. When I upload
    simpletagging.admin.php
    simpletagging.php
    simpletagging.pot
    simpletagging.type-ahead.js

    files in mu-plugins , admin page shows white page..

    do you have any idea for this ?

  13. ewald
    Member
    Posted 16 years ago #

    Mine shows blank too :(

    i am also getting errors on the frontpage (where dmk_show_tagcloud() is placed)

    WordPress database error: [Table 'blog_blog.wp_1_stp_tags' doesn't exist]
    SELECT DISTINCT post_id, tag_name AS name FROM wp_1_stp_tags tags WHERE post_id IN (5,4,1) ORDER BY post_id, name
  14. drmike
    Member
    Posted 16 years ago #

    Although I don't trust UTW because of the comment bug.

    You may want to review what's being done with regular wordpress. It was my understand that UTW or something simular was to be folded into the wordpress code.

  15. danalog
    Member
    Posted 16 years ago #

    That would be great news drmike.

    For the blank pages... I just tested with a new blog, I get errors on public pages stating the table wans't there (but that is just because my standard theme has the cloud function in it). Went into admin, clicked on the Tags tab and the table was inserted in the db. No problems anymore.

    Double check if you have the Simple Tagging Plugin is correctly installed. You can try to move it in its original directory to the plugins directory.

    Also I noticed STP has a new version since yesterday... did you use that version?

    Edit: Just tested with the 1.6.7 version. It blanks the admin.

  16. danalog
    Member
    Posted 16 years ago #

    STP 1.6.2 is the version I use and it works.

    You can get older versions of STP here: http://trac.herewithme.fr/project/simpletagging/browser/branches

    Tests would be great! Please use STP trac for posting tickets about STP, the developer is very active and would benefit from your experiences.

  17. ceejayoz
    Member
    Posted 16 years ago #

    Anyone else getting:

    Fatal error: Cannot redeclare class simpletaggingadmin in /.../wp-content/mu-plugins/simpletagging.admin.php on line 2

    when they upload SimpleTagging into mu-plugins/? Works fine in plugins/

    edit: Seems to work when I put:

    if(class_exists('SimpleTaggingAdmin')) {
    	return;
    }

    at the top of simpletagging.admin.php, but that seems a tad kludgy.

    I'm guessing as mu-plugins/ plugins get automatically included, the plugin is include()ing it as well and it's getting processed twice.

  18. lunabyte
    Member
    Posted 16 years ago #

    How many resources does this eat?

    To me it would seem pretty resource intensive, especially if it's building tags on every page load.

  19. danalog
    Member
    Posted 16 years ago #

    I'm working on a cached version. This will solve the resource intensiveness, but its not that heavy. Well... it is heavy if you use it on a system with thousends of blogs... but such a system is resource intensive by definition. Also when Wordpress 2.3 is released I will move to the new tagging feature instead of STP.

  20. lunabyte
    Member
    Posted 16 years ago #

    So it's safe to say this is for small sites only, at this time?

    Large sites are resource intensive, yes which is why anyone writing plugins should take their plugins resource usage into account.

    Not that I'm pickin' on ya, just bringing the resource issue to light.

    For the main tag list on my site, as an example, I write the output to a flat HTML file once every 15 minutes. Then include it from my sidebar. That could be widgetized too, if I wanted users to be able to put the site-wide tag cloud in their sidebars too.

    Again, that's just an example, but definitely some food for thought to cut resource usage.

  21. danalog
    Member
    Posted 16 years ago #

    As on my site:

    WARNING: This plugin is not as save as could be. It could also be faster. I suspect performance problems on larger wpmu sites. Check out the code and adjust as needed. If you have any updates, upgrades or brilliant additions please send them to me so I can add them. Released under the "Do whatever you want with it license" :)

  22. lunabyte
    Member
    Posted 16 years ago #

    Cool. I'll have to take a look at it. Don't really have a place for it at the moment, but nothing says I can't put in a vhost locally to play with at some point.

  23. BillyD
    Member
    Posted 16 years ago #

    If I uncheck "Include categories in tag list:" it remains checked and the categories continue to appear in the tags. What should I do? Thank you.

  24. BillyD
    Member
    Posted 16 years ago #

    In fact that happens with all the checkboxes.

  25. BillyD
    Member
    Posted 16 years ago #

    Okay, I fixed the problem by resetting to the defaults and then making my moves. A little odd, but it works.

  26. BillyD
    Member
    Posted 16 years ago #

    I am having the same problem as "demonicume" above: this only grabs the tags from my default blog and not from my subdomains. What should I do?

  27. SteveAtty
    Member
    Posted 16 years ago #

    Thats in the Simple Tagging plugin by Amaury Balmer configuration isn't it?

    I had major problems with it remembering things and the include tags in posts just blew PHP up !!

    I ended up hard coding a few things and writing some of the code.

  28. BillyD
    Member
    Posted 16 years ago #

    Hey Steve, do you know where that would be?

    I have both simple tagging and the sitewide tag feed installed in mu-plugins and when I call

    <?php echo dmk_show_tagcloud(); ?>

    It doesn't pull any of the tags from my subdomains, just my main domain. Any idea?

  29. SteveAtty
    Member
    Posted 16 years ago #

    I'm trying to remember what I changed to get simpletagging behaving with embedded [tags]...[/tags]

    I'm pretty sure it was the preg_match_all in the getEmbeddedTags function in simpletagging.admin.php as I've found the following line immediately after a commented out line:

    preg_match_all('|' . preg_quote('[tags]') . '(.*?)' . preg_quote('[/tags]') .'|', $postContent, $matches);
  30. BillyD
    Member
    Posted 16 years ago #

    Thanks Steve, but I don't really need the [tags] option. My users on subdomains simply type in the tags when they make posts, but the tags don't appear in my tag cloud. The only tags that appear in the tag cloud are those I make on my default blog, without subdomain, http://theworldblog.org

    Thanks for your help; I appreciate it.

About this Topic

  • Started 16 years ago by danalog
  • Latest reply from belladonna74