Skip to:
Content
Pages
Categories
Search
Top
Bottom

Division by zero warning

  • Avatar of Hope
    Hope
    Participant

    @amalsh

    Hi all,

    I’m getting this warning:
    “Warning: Division by zero in ….\wp-content\plugins\buddypress\bp-activity\bp-activity-template.php on line 566″

    when opening the activity of admin (when he’s not my friend) + sometimes when loading more the activity stream… does anybody know the cause of this & how can be fixed?

    Thanks

Viewing 11 replies - 1 through 11 (of 11 total)
  • Avatar of Hope
    Hope
    Participant

    @amalsh

    Apparently it appears with non friends activities.. BTW, I’m using “buddypress-friends-only-activity-stream” plugin. Could it be the reason?

    Avatar of @modemlooper
    @modemlooper
    Moderator

    @modemlooper

    Plugin is outdated.

    Avatar of Hope
    Hope
    Participant

    @amalsh

    Yes it is but What may caused this issue in it? and if I wanted to not use it, how can I restrict activities to friends’ activities only?

    Thank you

    Avatar of Hope
    Hope
    Participant

    @amalsh

    Anybody? how to hide non friends activity updates from activity stream?

    Avatar of Hope
    Hope
    Participant

    @amalsh

    The problem in the plugin is in the row:
    $activities->pag_num = $activities->pag_num -1;
    When it takes 0 value.

    What does pag_num refer to in activity?

    Avatar of funkolector
    funkolector
    Participant

    @funkolector

    hello @amalsh, I did the dirtiest quick hack ever… i wouldn’t advice it, but it removed the error…

    replacing : $activities->pag_num = $activities->pag_num -1;
    by :
    if ($activities -> pag_num != 1) {
    $activities -> pag_num = $activities -> pag_num – 1;
    }

    Avatar of funkolector
    funkolector
    Participant

    @funkolector

    Avatar of richoz
    richoz
    Participant

    @richoz

    Hey @funkolector, many thanks. This is what I really need.

    Avatar of bp-help
    bp-help
    Participant

    @bphelp

    @richoz Yeah the plugin is a blessing. None of the credit belongs to me so @pollyplummer and Rich Fuller gets full credit. I just adjusted a couple things based on stuff I viewed on the net and it happened to work out and make it work I suppose the way most people expected too.

    Avatar of richoz
    richoz
    Participant

    @richoz

    Which brings me to the next question: How to change the tab title into something like “Me & My Friend” instead of “All Members”? And also the correct total “Me & My Friend” number. Preferably this is done by the plugin itself.

    Thanks in advance.

    Avatar of bp-help
    bp-help
    Participant

    @bphelp

    @richoz
    A simple way would be to use a language file:

    http://codex.buddypress.org/developer/customizing/customizing-labels-messages-and-urls/

    Personally on my own test site I used a function that removes the tab all together since the stream is unified between you and your friends and make this tab irrelevant.

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

You must be logged in to reply to this topic.