Skip to:
Content
Pages
Categories
Search
Top
Bottom

Set delay before user can request to join the same Group again, after being rejected.

  • I am trying to limit the number of join requests a user can submit to any particular private Group, per set period of time. For example, if a Group admin rejects a user’s request, that user will not be able to submit another join request to that same group until he has waited 30 days since his initial submission. This will help minimize “join request” spam.

    I have no problem creating a new button with the proper IF statement under bp_get_group_join_button in bp-groups-template.php, but this is where I’m stuck:

    When logged in as a Group admin, and when viewing the Group admin tab, I can see exactly how long ago a member had requested to join the Group. When logged in as that member while viewing the Home tab in that Group, I have been unable to pull the correct value. When I set link_text to bp_group_request_time_since_requested, it says “requested 42 years, 2 months ago”. This comes out to a request date of Jan. 1, 1970.

    What am I missing?

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

  • yadigit
    Participant

    @yadigit

    This is just a though and that’s a very good idea and I will also look into it too..
    have you tried the ‘ > ‘ sign..
    I would set a $timeset = TIMERESTRICT

    Now this is something I wouldn’t know how to do but This is how i would lay out the if command..
    How would would you call the time of when the person left the group?
    if you could do that I’d set a string as
    $timeleft = TIMEPERSONLEFTGROUP

    and make the if command

    if $timeset < $timeleft {
    Can’t join time
    } else {
    Join
    }

    Im not sure if it helped too much, but I hope it gave you an idea on what to do.
    @jeffsl

    @yadigit thanks for the input. That is similar to what I would do as well. But creating the function is not where my problem is. The problem is that I am unable to pull any of a member’s Group activity dates (i.e. when applied, when joined, etc.) from the database. I have tried using bp_group_request_time_since_requested(), which runs bp_core_time_since( strtotime( $requests_template->request->date_modified ) ), but I am not getting the right data.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Set delay before user can request to join the same Group again, after being rejected.’ is closed to new replies.
Skip to toolbar