Skip to:
Content
Pages
Categories
Search
Top
Bottom

Porting wp plugins using post ID to use Group ID – broaden buddypress group functionality

  • Avatar of nit3watch
    nit3watch
    Participant

    @nit3watch

    Iv’e been looking at a lot of nice plug-ins such as @chrisvrichardson‘s MapPress Easy Google Maps and Five Star Rating ( http://wordpress.org/extend/plugins/five-star-rating/ ) amongst many other wp plug-ins that use the post ID that would work nicely for bp groups.

    First off, to save the group id instead of the posts id it should be quite easy using: ID={$bp->groups->current_group->id} as aposed to the origional code: ID={$id}, wordpress $id is the post id from what I have gathered, and then calling it either in the group header, eg: star rating, or creating a new tab on the group page, eg: for the maps..

    I had a go at this but cant come right, still learning sql and stuff having mainly played around with ‘group meta’ and not separate tables.. ( soz for bad terminology :P )

    Could one of the experienced developers maybe write up a tut or change a wordpress plug-in using the post id to work for groups so I, and others could have something to compare/relate back to.. and have a starting point for porting plug-ins for groups.

    These are countless plug-ins working of the wp post ID and this would really improve and expand buddypress group functionality.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Avatar of nit3watch
    nit3watch
    Participant

    @nit3watch

    Motivation :D

    Image and video hosting by TinyPic

    K well trying this with the Five Star Rating plug-in: http://wordpress.org/extend/plugins/five-star-rating/

    Here’s what I have so far, though $id ( from line 176 onwards ) is confusing me.. and not quite sure to do there?
    I cant get it to save the group data..

    Im calling the ‘stars’ using the shortcode in the group header: http://pastebin.com/R1gsTudD

    Here’s my edited fsr.class.php: http://pastebin.com/qczBCb18

    Avatar of nit3watch
    nit3watch
    Participant

    @nit3watch

    I thought of trying to make a function that would take preference over the build in wordpress $id.

    something like:

    function id()
    $id = $bp->groups->current_group->id

    but doesn’t take effect, is there some way to take priority like with css !important ?

    Edit: instead of trying the above I changed all instances of $id to my own function $group_rate
    Though I just need a little help with the function and after which I dont see why it shouldn’t all work :D

    Here’s my version, my function’s on line 7-10 : http://pastebin.com/dR74qbqM

    Avatar of nit3watch
    nit3watch
    Participant

    @nit3watch

    I got it to return the group rating ( changed a posts id to a groups id ), checked it by editing the votes in the db table though just can’t get it to save the group id. Please help

    http://pastebin.com/dkJiMdwf

    Avatar of sirspacey
    sirspacey
    Member

    @sirspacey

    Did you find any answers on how to get the group id?

    Avatar of @modemlooper
    @modemlooper
    Moderator

    @modemlooper

    $id = $bp->groups->current_group->id

    Thats how you get the id

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

The topic ‘Porting wp plugins using post ID to use Group ID – broaden buddypress group functionality’ is closed to new replies.