Ver Mensaje Individual
  #1 (permalink)  
Antiguo 17/06/2011, 23:41
Lazard
 
Fecha de Ingreso: junio-2008
Mensajes: 59
Antigüedad: 15 años, 10 meses
Puntos: 0
Warning: Division by zero in

Aunque la funcionalidad es correcta , me sale este error, se lo que significa, pero no se como sacarlo.

error -> Warning: Division by zero in /home/7384732984732948/public_html/wp-content/plugins/bp-album/includes/bp-album-templatetags.php on line 80

Código PHP:

class BP_Album_Template {
    
    var 
$current_picture = -1;
    var 
$picture_count 0;
    var 
$pictures;
    var 
$picture;

    var 
$in_the_loop;

    var 
$pag_page;
    var 
$pag_per_page;
    var 
$pag_links;

    function 
BP_Album_Template$args '' ) {
        
$this->__construct$args);
    }
    
    function 
__construct$args '' ) {
        global 
$bp;

        
        
$defaults bp_album_default_query_args();
        
        
$r apply_filters('bp_album_template_args',wp_parse_args$args$defaults ));
        
extract$r EXTR_SKIP);

        
$this->pag_page $page;
        
$this->pag_per_page $per_page;
        
$this->owner_id $owner_id;
        
$this->privacy$privacy;
        
        
/***
         * You can use the "type" variable to fetch different things to output.
         * For example on the groups template loop, you can fetch groups by "newest", "active", "alphabetical"
         * and more. This would be the "type". You can then call different functions to fetch those
         * different results.
         */

        
$total bp_album_get_picture_count($r);
        
$this->pictures bp_album_get_pictures($r);

        
// Item Requests
        
if ( !$max || $max >= $total )
            
$this->total_picture_count $total;
        else
            
$this->total_picture_count $max;

        if ( !
$max || $max >= count($this->pictures))
            
$this->picture_count count($this->pictures);
        else
            
$this->picture_count $max;

        
$this->pag_links paginate_links( array(
            
'base' => $bp->displayed_user->domain $bp->album->slug .'/'$bp->album->pictures_slug .'/%_%',
            
'format' => '%#%',
            
'total' => ceil( (int) $this->total_picture_count / (int) $this->pag_per_page ), /// es aqui donde el error !
            
'current' => (int) $this->pag_page,
            
'prev_text' => '←',
            
'next_text' => '→',
            
'mid_size' => 1
        
));
        

        if (
$this->picture_count)
            
$this->picture $this->pictures[0];
        
    } 
He probado con esto pero no funciona

if(empty($this))
{
echo "M";
}
else
{
echo "O";
}