Ver Mensaje Individual
  #3 (permalink)  
Antiguo 30/05/2010, 17:47
gastonemen
 
Fecha de Ingreso: octubre-2009
Mensajes: 53
Antigüedad: 14 años, 6 meses
Puntos: 0
Respuesta: problemas con meenews plugin wordpress

gracias por la preocupacion, mira aqui pego toda la funcion donde divide por cero...

igual la rutie y puse impresiones echos para ver que valores arroja pero parece que es el return $button que devuelve cero siempre....

Código PHP:
Ver original
  1. function generateButtons($idNewsletter = null,$titulo,$from,$subjetc,$range,$list){
  2.         global $wpdb;
  3.  
  4.         $num = listandusers::howUserHaveInList($list);
  5.         if($list == 'all')$list = 0;
  6.         if ($range == 'all'){
  7.             $boton = '<a href="javascript:sendmail(null,0,'.$list.',1)" style="display:block; margin:0; padding:10px 10px; background:#444; color:#fff; text-decoration:none">'. __("Send", 'meenews').'</a>';
  8.                 $button .= "<p style='padding:0 0 0 10px; background:#eee; overflow:hidden'><span style='float:left; margin:10px 0 0 0;'>".__("Range ", 'meenews')."<b>".__(" Send All List ", 'meenews')."</b></span><span style='float:right'>$boton</span></p>";
  9.                 $button .='<table width="100%" border="0" cellpadding="0" cellspacing="0" style="border:1px solid #ccc; font-size:10px;display:none" id="result1">
  10.                              <tr>
  11.                                <td align="center" style="padding:3px; font-weight:bold; border-bottom:1px solid #bbb; font-size:11px">'.__("Send Ok ", 'meenews').'</td>
  12.                                <td align="center" style="padding:3px; font-weight:bold; border-bottom:1px solid #bbb; font-size:11px">'.__("Send Wrong ", 'meenews').'</td>
  13.                                <td align="center" style="padding:3px; font-weight:bold; border-bottom:1px solid #bbb; font-size:11px">'.__("Send Test ", 'meenews').'</td>
  14.                              </tr>
  15.                              <tr>
  16.                                <td id="ok1">&nbsp;</td>
  17.                                <td id="wrong1">&nbsp;</td>
  18.                                <td id="test1">&nbsp;</td>
  19.                              </tr>
  20.                          </table>';
  21.         }else{
  22.  
  23.  
  24.             $buttons = ceil( $num / $range);
  25.  
  26.             for ($i = 1; $i <= $buttons; $i++){
  27.                 $ta = $range * ($i-1);
  28.  
  29.                 $ti = $range * $i;
  30.  
  31.                 $boton = '<a href="javascript:sendmail('.$ta.','.$ti.','.$list.','.$i.')" style="display:block; margin:0; padding:10px 10px; background:#444; color:#fff; text-decoration:none">'. __("Send", 'meenews').'</a>';
  32.                 $button .= "<p style='padding:0 0 0 10px; background:#eee; overflow:hidden'><span style='float:left; margin:10px 0 0 0;'>".__("Range ", 'meenews')."<b>$ta</b>".__(" to ", 'meenews')."<b>$ti</b></span><span style='float:right'>$boton</span></p>";
  33.                 $button .='<table width="100%" border="0" cellpadding="0" cellspacing="0" style="border:1px solid #ccc; font-size:10px;display:none" id="result'.$i.'">
  34.                              <tr>
  35.                                <td align="center" style="padding:3px; font-weight:bold; border-bottom:1px solid #bbb; font-size:11px">'.__("Send Ok ", 'meenews').'</td>
  36.                                <td align="center" style="padding:3px; font-weight:bold; border-bottom:1px solid #bbb; font-size:11px">'.__("Send Wrong ", 'meenews').'</td>
  37.                                <td align="center" style="padding:3px; font-weight:bold; border-bottom:1px solid #bbb; font-size:11px">'.__("Send Test ", 'meenews').'</td>
  38.                              </tr>
  39.                              <tr>
  40.                                <td id="ok'.$i.'">&nbsp;</td>
  41.                                <td id="wrong'.$i.'">&nbsp;</td>
  42.                                <td id="test'.$i.'">&nbsp;</td>
  43.                              </tr>
  44.                          </table>';
  45.                          meenewsCore::createSendCola($idNewsletter,$ta,$ti,$list,$i,$range);
  46.             }
  47.         }
  48.         return $button;
  49. }


PD: tambien me fije que si no elijo ni categoria ni tipo de envio "todos" "de 10 en 10 " "de 20 en 20" no respeta el else y pasa y divide igual por cero

Última edición por gastonemen; 30/05/2010 a las 17:58 Razón: PD....