Skip to:
Content
Pages
Categories
Search
Top
Bottom

DB INSERTS into bp_activity (works but time is 5 hours off)


  • LPH2005
    Participant

    @lph2005

    I’m looking at a MediaWiki extension written by Boone, in which he tied the MediaWiki to bp_activity_sitewide for WPMU. I am only using WP 3.0 in single blog. I almost have a handle on the mysql_query statement needed to insert values. However, my knowledge is “use google” and “spend time” – I’m not the sharpest tool in the shed. Therefore, I thought it best to ask the experts here.

    I want to insert into the db, table bp_activity. The first value is an auto_increment. How is it best to setup the mysql_query so it is auto_incremented properly?

    This is what I have

    mysql_query( “INSERT INTO `wp_bp_activity` (`id`,`user_id`,`component`, `type`, `action`, `content`, `primary_link`, `item_id`, `secondary_item_id`, `date_recorded`, `hide_sitewide`, `mptt_left`, `mptt_right`) VALUES ( ‘I HAVE NO CLUE’, ‘$user_id’, ‘blogs’, ‘new blog post’, ‘a wiki edit’, ‘$contentdesc’, ‘$articleURL’, ’46’, ‘0’, FROM_UNIXTIME(‘$time2’), ‘0’, ‘0’, ‘0’ )”) or die(mysql_error()); // insert into bp activity feed

    Also,

    Can “component” be == to “wiki”?
    Can “type” == “new wiki edit”?
    Can action be set so that it inserts the URL also ?

    Thank you!!

    I’ll keep mucking about ;)

    Update

    OK. I removed `id` and this worked. The information was inserted into the database. However, it does not show up in the activity stream. I’m thinking the item_id is wrong?

Viewing 2 replies - 1 through 2 (of 2 total)

  • LPH2005
    Participant

    @lph2005

    It’s working!

    I didn’t see the activity because the time is incorrect. It showed up 5 hours off. I’m not sure how to fix that yet – but it’s working :)


    LPH2005
    Participant

    @lph2005

    I couldn’t figure anything else out … so I went with a simple fix.

    $time1 = time() + (5 * 60 * 60);

    then use FROM_UNIXTIME($time1)

    At least it is working ;)

    To see activity stream now showing wiki edits … see http://www.thechembook.com activity stream on front page, right side

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘DB INSERTS into bp_activity (works but time is 5 hours off)’ is closed to new replies.
Skip to toolbar