Skip to:
Content
Pages
Categories
Search
Top
Bottom

adding new alert into activity stream

  • @ninanoki

    Participant

    under the same database i have another scripts like mediawiki and wordpress. how can i make those scripts to insert new row into wp_bp_activity? i think that i should find a place where article is being saved and should write a mysql query to insert such row into wp_bp_activity table. anyone has ever wrote such code? such extension would be helpful…to choose table and column for action, content, etc.

Viewing 2 replies - 1 through 2 (of 2 total)
  • @nuprn1

    Participant

    so you need to create a record outside the scope of BuddyPress? (if you can can bring in the global bp – then you just need a wrapper around function bp_activity_add )

    Just have a look at the class BP_Activity_Activity and the save() function

    @boonebgorges

    Keymaster

    @ninanoki – There are three strategies for doing what you want to do.

    1) Load WP/BP in the background when you, for instance, save a mediawiki edit. You can do that by including wp-load.php. Then you can use the BP activity API, as @nuprn1 suggests above. The downside is that you’ve got a lot of overhead, loading both MW and WP at the same time.

    2) Write directly to the WP database with a MW extension. I wrote this http://www.mediawiki.org/wiki/Extension:BuddyPressActivity a while back and it is out of date and doesn’t work right now, but you could hack it to work. Downside: it’s fugly

    3) You could pull edits in via RSS. I have a working version of such a plugin on my localhost right now, but I have to clean it up before releasing it. It’ll let the admin put in any RSS feed (like MW Recent Changes) and have the updates be posted as activity items. If you’re sharing a user database, it’ll even key the user_id correctly. I might get a chance to work this up in the next day or two, and I’ll post it on these forums when I do.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘adding new alert into activity stream’ is closed to new replies.
Skip to toolbar