Skip to:
Content
Pages
Categories
Search
Top
Bottom

reviews per user

  • Avatar of gwu123
    gwu123
    Participant

    @gwu123

    hi,
    I need some help with the group review plugin (http://buddypress.org/community/groups/bp-group-reviews/).

    This plugin by default lets one review per user per group. I want to edit this so that the condition is one review per user across all groups. In other words if a user has rated a group he should not be allowed to rate any other group. And he should be pointed to which group he has already rated. just like now it says u have already rated and delete this rating.

    thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • Avatar of Boone Gorges
    Boone Gorges
    Keymaster

    @boonebgorges

    This is possible, though you’ll have to code some of it yourself.

    First, you’ll have to apply the change I just made to one of the functions (which will be released in the next version) https://github.com/boonebgorges/bp-group-reviews/commit/54b6a648393afec39740fb3e797acb2f35b4614c

    Then, you’ll have to filter the output of that function (using `add_filters( ‘bpgr_has_written_reviews’, ‘my_filter_function’ );`) with a function that checks to see whether the user has any activity items of type ‘review’. This is off the top of my head, but it’d be something like this:

    `function bbg_limit_to_one_review_sitewide( $has_written ) {
    global $bp;
    if ( bp_has_activities( ‘user_id=’ . $bp->loggedin_user->id . ‘&type=review’ ) ) {
    return true;
    } else {
    return false;
    }
    }
    add_filter( ‘bpgr_has_written_reviews’, ‘bbg_limit_to_one_review_sitewide’ );`

    Avatar of gwu123
    gwu123
    Participant

    @gwu123

    thanks so much. I will try it out.

    Avatar of erogosdet
    erogosdet
    Member

    @erogosdet

    Illusion is the first of all pleasures

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

You must be logged in to reply to this topic.