Want more features on Pastebin? Sign Up, it's FREE!
Guest

Ammendment to bp-cubepoint-templatetags.php

By: a guest on May 22nd, 2010  |  syntax: None  |  size: 1.18 KB  |  views: 250  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.  This adjustment will suppress php warning messages  of 'division by zero' as per thekmens suggestion
  2.  
  3.  find this block - starting around luine 54 in /includes/bp-cubepoint-templattags.php
  4.  
  5.                 $this->pag_links = paginate_links( array(
  6.                         'base' => $bp->displayed_user->domain . $bp->cubepoint->slug .'/'. $bp->cubepoint->points_slug .'/%_%',
  7.                         'format' => '%#%',
  8.                         'total' => ceil( (int) $this->total_point_count / (int) $this->pag_per_page ),
  9.                         'current' => (int) $this->pag_page,
  10.                         'prev_text' => '←',
  11.                         'next_text' => '→',
  12.                         'mid_size' => 1
  13.                 ));
  14.                 $this->pag_table_links = paginate_links( array(
  15.                         'base' => $bp->displayed_user->domain . $bp->cubepoint->slug .'/'. $bp->cubepoint->table_slug .'/%_%',
  16.                         'format' => '%#%',
  17.                         'total' => ceil( (int) $this->total_point_count / (int) $this->pag_per_page ),
  18.                         'current' => (int) $this->pag_page,
  19.                         'prev_text' => '←',
  20.                         'next_text' => '→',
  21.                         'mid_size' => 1
  22.                 ));
  23.  Note the lines beginning 'total' and the word ceil, prepend @ to ceil
  24.  The lines should now read as:
  25.  
  26. 'total' => @ceil( (int) $this->total_point_count / (int) $this->pag_per_page ),
  27.  
  28.  simply suppresses the display of  error/warning messages
clone this paste RAW Paste Data