Skip to:
Content
Pages
Categories
Search
Top
Bottom

Division by zero warning

  • @amalsh

    Participant

    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)
  • @amalsh

    Participant

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

    @modemlooper

    Moderator

    Plugin is outdated.

    @amalsh

    Participant

    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

    @amalsh

    Participant

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

    @amalsh

    Participant

    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?

    @funkolector

    Participant

    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;
    }

    @funkolector

    Participant

    @richoz

    Participant

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

    @bphelp

    Participant

    @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.

    @richoz

    Participant

    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.

    @bphelp

    Participant

    @richoz
    A simple way would be to use a language file:
    https://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)
  • The topic ‘Division by zero warning’ is closed to new replies.
Skip to toolbar