Group Mods

  • Avatar Image
  • Avatar Image
  • Avatar Image

Support: Third Party Components & Plugins (Support Group)

Post your add-ons here.

MediaWiki edits -> BP activity streams (14 posts)

Started 1 year, 1 month ago by: Boone Gorges

← Group Forum   Support Forums
  • Avatar Image Boone Gorges said 1 year, 1 month ago:

    I’m working on a project, the CUNY Academic Commons, where we’ve worked out single sign-on for WPMu and MediaWiki. On top of this shared user authentication, I wrote a MediaWiki extension that takes MediaWiki page edits (limited to one update per 24 hours for a given author/page combination) and feeds them into the BP activity streams.

    It’s a very cool addition for our project – makes the action going on in the wiki much more visible, both in the sitewide feeds and on individual profile pages.

    The extension can be found here if you’re interested.

  • Avatar Image r-a-y said 1 year, 1 month ago:

    Nice job, Boone!
    There’s probably going to be a few people interested in this!

  • Avatar Image Dolugen said 1 year, 1 month ago:

    Wow, it’s awesome. I was thinking for days of this very same concept for my buddypress based wiki, here comes the solution :) Good work!

  • Avatar Image 21cdb said 1 year, 1 month ago:

    Awesome!

  • Avatar Image nicolagreco said 1 year, 1 month ago:

    I’ve written a complete integration for MediaWiki in BuddyPress (activity, groups, user page, buddybar included)

    On september i’ll release it, i hope you can wait and try it :)

  • Avatar Image flynn said 1 year, 1 month ago:

    Boone,

    Thank you for your code, the single sign on worked brilliantly!
    I’m building a Game Studies social site for the new media field (hopefully new media academics, ludologists, etc will take to it) for the University of Wyoming, and a wiki was a major concern. the WP wiki plugins aren’t up to the task, so this really helps.

    Few questions if I may.

    When I enable the site wide update plugin, my mediawiki page goes blank. Thoughts?
    Also, how did you manage to make CUNY look so integrated, a mediawiki theme I suppose? I’ve never themed (or worked with really) mediawiki, is there a good theme site where I might be able to download something to modify, or is it a group up kind of thing?

    Thanks for your hard work!

    @Nicola:
    I’ll look into your plugin when it comes out, but will it do anything more/different as Boone’s code is rather complete in what it does. Also, beta?

  • Avatar Image flynn said 1 year, 1 month ago:

    Ok, visual integration.
    I made a theme that calls WP’s header / footer. Install it into your media wiki skins dir and change skin in LocalSettings.php to “dusk” and you should be good to go.

    Basically the theme does this:
    wiki header stuff
    <?php require(‘../wp-config.php’); $single = 1; $siteurl = get_settings(’siteurl’); ?>
    Wiki content stuff
    <?php get_footer(); ?>

    It’s not classy, but it works… well, for me. To work with your site it may take some CSS tweaking, namely, width and background info most of which is in “main.css” around line 350.

    I’ll update the zip as I make changes. I don’t really plan to make this a supported thing, but as I hack a solution together, I might as well share it.

    http://thegsn.org/Extra/Archive.zip

  • Avatar Image Hempsworth said 1 year, 1 month ago:

    On the activity output, could the ‘7 seconds ago’ message be wrapped around a:

    <span class="timesince">

    Like the other activity outyputs. It would make skinning this so much easier!

  • Avatar Image Boone Gorges said 1 year, 1 month ago:

    @Flynn – Glad you got the single sign-on working! The visual integration really just came from an excessive amount of CSS elbow grease. I’m a bit embarrassed to say that our solution for sitewide navigation isn’t as elegant as yours – the WP nav is hardcoded into the MediaWiki template. We were in a rush to get the thing together (and frustrated with the less-than-ideal theming structure of MW!) and it never occurred to us. I’ll definitely look into using includes to make this work.

    As for the activity plugin – it’s hard to know from just the blank screen just what’s wrong. If you’re getting the problem even without saving pages, then it’s unlikely that it’s a problem with the code (since it is only hooked when a wiki page save is complete). A couple possibilities:

    You might want to take a look to make sure that there is a close ?> in the MW extension. I had to leave it out of the MW documentation page because of the way the MW knowledgebase renders PHP (I guess?). If MW isn’t detecting an end to the extension, it could cause a panic.
    Where did you place the require_once line in your LocalSettings.php? My system was finicky; I only got the plugin to activate correctly when I made it the second to last require_once in the config file (just before the WP redirection extension code). So you might try playing around with the location of this file.
    Make sure as well that the line in LocalSettings.php is pointing to the right location – [MW-directory]/extensions/buddypress-activity/buddypress-activity.php, or whatever alternative location you’ve chosen on your system.

    Hope that helps at least a little!

    @Hempsworth – It’s funny that you mention the class=timesince – I must have spent three hours trying to get that to work one way or the other. The problem is that the timesince span tags are added in the individual BP components (groups, blogs, wire, etc). To get wiki functions to work the same way I would have to abandon the quick-n-dirty activity hack that I employed and actually build entire wiki BP classes. Maybe one day! In the meantime, you might try this even quicker-n-dirtier hack that I mention in the Usage section of the extension page. The preg_replace code I give there goes in BuddyPress core, around line 226 and 230 (ish) of [wp-install-directory]/wp-content/plugins/buddypress/bp-activity/bp-activity-templatetags.php. This hack will only apply to new wiki activity – not the stuff that you’ve already posted – so make sure to make a new wiki edit to test.

  • Avatar Image flynn said 1 year, 1 month ago:

    @Boone,

    Thanks for the tips, I had been messing with it some and noticed that my error in the activity stream was completely PEBKAC… I miss-typed like four things…

    [cough]

    Anyway…
    I’ll leave the theme up and post updates on the GSN and Twitter once the site is properly launched. As for now, I’m glad you guys may get some use out of it :D

  • Avatar Image flynn said 10 months, 2 weeks ago:

    Update-

    I know this is a dead thread, but the code is all still functional, and it’s a good tip for people, so I’m just going to append the latest update of the wiki/WPMU integration theme.

    More info, change log, and download here: http://aaron.dighumanities.org/2009/10/19/mediawiki-wpmu-deep-style-integration-update/

  • Avatar Image Boone Gorges said 10 months, 2 weeks ago:

    Very cool, Flynn. Thanks so much for sharing.

  • Avatar Image LPH2005 said 2 months, 2 weeks ago:

    I hate to dredge up an old thread – but – is work being done on this for WP 3.0 and BP 1.2.4.1?

    @flynn – the server is temporarily unavailable; theme link isn’t available.

    @boonebgorges – have you tried your extension with BP 1.2.4.1?

    @nicolagreco – did you ever release anything?

    Today seemed like a good day to try to get my MediaWiki footer integrated into BuddyPress footer – and just started looking around. Any tips from anyone would be great!

  • Avatar Image LPH2005 said 2 months, 2 weeks ago:

    It looks like the INSERT into db does not align for WP 3.0. So I modified the mysql_query statement

    Also, I changed the lines with $wpmudp to ($wpmudp, $link) in which $link was added as:

    $link = mysql_connect(‘localhost’, ‘db’, ‘db_password’);
    if (!$link) {
    die(‘Not connected : ‘ . mysql_error());
    }

    This allowed the extension to attach to the proper database (my mediawiki is on a different host, with different user and password).

    The only thing incorrect is the time. And I’m working on a solution for it.

    See this thread for how I modified the query statement:
    http://buddypress.org/community/groups/creating-extending/forum/topic/db-inserts-into-bp_activity