Ver Mensaje Individual
  #1 (permalink)  
Antiguo 28/01/2010, 16:31
CanariasHosting
 
Fecha de Ingreso: abril-2009
Ubicación: Santa Cruz de Tenerife
Mensajes: 49
Antigüedad: 15 años, 1 mes
Puntos: 0
No repite resultados

Tengo dos funciones ...

Código PHP:
function SubEvento($id_evento){
    
$q="select * from dep_subeventos where id_evento='$id_evento' limit 0,10";
    
$res=mysql_query($q);  
    while(
$r=mysql_fetch_array($res)){
    
$evento.=  '
      <tr>
    <td>'
.$r['p2p'].'</td>
      <td>'
.$r['nombre'].'</td>
      <td>'
.$r['idioma'].'</td>
      <td>'
.$r['tipo'].'</td>
      <td>'
.$r['kbps'].'</td>
      <td><b><a href="'
.$r['enlace'].'" target="_blank">Play</a></b></td>
    </tr>'
;
}  
return 
$evento;

function 
evento($usuario){  
  
$w="1";
  
$fecha_i date("Y-m-d H:i:s");
  
$fecha_f date("Y-m-d 23:59:59");
    
$q="select * from dep_eventos where hora>= '$fecha_i' and hora<='$fecha_f' order by hora asc limit 0,7";
    
$res=mysql_query($q);  
    while(
$r=mysql_fetch_array($res)){
        
$ideve $r['id_evento'];
        
$nomeve $r['evento'];
        
$cateve $r['cat_evento'];
        
$horaeve $r['hora'];
        
$horaeve date("H:i:s"strtotime($horaeve));
        
$diaeve date("d-m-Y"strtotime($horaeve));
      
//`id_evento`, `cat_evento`, `evento`, `hora`
      
if (!empty($usuario) && $usuario0){
      
$x.='<tr><td><img src="template/imagenes/iconos/'.$cateve.'.png"></td><td>'.$diaeve.' -</td><td><a href="" id="mostrar'.$w.'" class="mainmenu">'.strtoupper($nomeve).'</a></td><td> ('.$horaeve.')</td></tr><tr><td class="td" colspan="4"></td></tr>'
         
.'<tr><td colspan="4">
          <div id="caja'
.$w.'">
             <table border="0" cellpadding="1" cellspacing="1" width="600">
            <tr>
                <td>P2P</td>
                <td><span class="es">Nombre</span></td>
                <td><span class="es">Idioma</span></td>
                <td><span class="es">Tipo</span></td>
                <td>Kbps</td>
                <td>Play</td>
            </tr>
              '
.SubEvento($ideve).'
             </table>
           </div>
          </td>
        </tr>'
;
      }else{
    
$x.='<tr><td><img src="template/imagenes/iconos/'.$cateve.'.png"></td><td>'.$diaeve.' -</td><td><a href="./foros/index.php?action=register" class="mainmenu" title="Registrate ¡¡">'.strtoupper($nomeve).'</a></td><td> ('.$horaeve.')</td></tr><tr><td class="td" colspan="4"></td></tr>';
      }
    
$eventos $x;
    
$w++;    
    }  
    return 
$eventos;

Y no se por que motivo la funcion Subevento me da solamente el ultimo, o como podria solucionarlo, estoy utilizando un simple sistema de plantillas, esto se vera en un tpl.

A que puede ser posible, gracias