La solucion es algo sencilla, como decia otro usuario debes de ir creando los
Agregare unas cuentas lineas a tu codigo, checa y estudialo:
Código PHP:
if (($d == "") || ($d == 0)) {
$d = 1;
}
$sqld = $d - 1;
$sqld *= $limit;
$result = $db->sql_query("SELECT * FROM ".$prefix."_video_stream ".$sortby2." ".$sortby1." LIMIT $sqld,$limit");
$rowvid = $db->sql_numrows($result);
$result2 = $db->sql_query("SELECT * FROM ".$prefix."_video_stream ".$sortby2." ".$sortby1."");
$rowvid2 = $db->sql_numrows($result2);
// If videos are in the DB then they are displayed.
if ($rowvid != "0") {
echo "<table border=0 cellspacing=0 cellpading=0>";
while($row = $db->sql_fetchrow( $result )) {
if($b==0){
echo "<tr>";
}
echo "<td>";
$userav = $row['user'];
if ($row['rating'] == "") {$rating = "0";} else {$rating = $row['rating'];}
$id = $row['id'];
echo "<table width=\"100%\" border=\"0\" cellspacing=\"5\" cellpadding=\"5\"><tr><td>";
avatars($userav);
echo "</td><td width=\"100%\"><a href=\"modules.php?name=Video_Stream&page=watch&id=".$row['id']."&d=".$d."\">".$row['vidname']."</a><br>";
echo "<strong><font size=\"2\">".$row['date']."</font></strong><br>".$row['user']." <a href=\"modules.php?name=Video_Stream&page=search&search=user:".$row['user']."\">["._MOREFROMUSER."]</a></td></tr></table>";
echo "<table width=\"100%\" border=\"0\" cellspacing=\"5\" cellpadding=\"5\"><tr><td width=\"50%\" valign=\"top\"></td><td align=\"right\" valign=\"top\">";
category($id);
echo "</td></tr></table>";
echo "<table width=\"100%\" border=\"0\" cellspacing=\"5\" cellpadding=\"5\"><tr><td width=\"98%\">";
echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"10\"><tr>";
$image = $row['imgurl'];
if ($image == "") {
echo "<td><table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td><a href=\"modules.php?name=Video_Stream&page=watch&id=".$row['id']."&d=".$d."\"><img src=\"modules/Video_Stream/images/noimage.gif\" border=\"0\" height=\"150\" alt=\"".$row['vidname']."\"></a></td></tr></table></td>";
} else{
echo "<td><table border=\"1\" cellspacing=\"0\" cellpadding=\"0\"><tr><td><a href=\"modules.php?name=Video_Stream&page=watch&id=".$row['id']."&d=".$d."\"><img src=\"".$image."\" border=\"0\" height=\"150\" alt=\"".$row['vidname']."\"></a></td></tr></table></td>";
}
echo "<td width=\"80%\" valign=\"top\"><b>"._DESCRIPTION." :</b> ".$row['description']."</td>"; // agregada por mi
echo "</tr></table>";
echo "</td><td width=\"100%\" valign=\"top\">";
echo "</td></tr></table><br><div align=\"center\">___________________________________________________________________________";
echo "</td>";
if($b==1){
echo "</tr>";
$b=0;
}else{
$b=$b+1;
}
}
echo "</table>";
$pages = ceil($rowvid2 / $limit);
echo "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td width=\"30%\">";
if ($d > 1) {
$p = $d - 1;
echo "<div align=\"left\"><a href=\"modules.php?name=Video_Stream&d=".$p."\">"._PREVIOUS."</a></div>";
} else {
echo " ";
}
echo "</td><td width=\"40%\"><div align=\"center\">";
pagesnav($d, $pages);
echo "<br>"._PAGE." ".$d."/".$pages."</div></tr><td width=\"30%\">";
if ($d < $pages) {
$d += 1;
echo "<div align=\"right\"><a href=\"modules.php?name=Video_Stream&d=".$d."\">"._NEXT."</a></div>";
} else {
echo " ";
}
echo "</td></tr></table>";
}
Si te podras dar cuenta agrege una tabla, arriba de tu while esta declarada una nueva tabla ....
Lo que vamos hacer es mostrar cada registro dentro de un <td>, el otro codigo que agregue te explicare que hace cada uno:
Código PHP:
if($b==0){
echo "<tr>";
}
Este codigo hace que cuando $b sea igual a 0 imprima un <tr>, abajito viene un <td> que se vuelve a cerrar abajo para que cada registro vaya dentro de una celda.
Este otro codigo:
Código PHP:
if($b==1){
echo "</tr>";
$b=0;
}else{
$b=$b+1;
}
Cuando $b tenga cierto valor cerrara esa fila, este numero va a indicar el numero de columnas que se mostraran por fila, es decir, si quieres mostrar 10 columnas de regisotrs en una fila pondras 9 ya que $b inicia en 0, espero le entiendas y que esto te sea de gran ayuda
Por cierto cuando $b tenga ese valor q cierra la volvemos 0 poara que inicie otra fila y asi sucesivamente siempre y cuando haya registros, y pss en caso contrario aumentamos $b hasta que llegue al valor q cierra la fila! xD!
Este ejemplo te muestra los registros en 2 columnas, estudialo y pruebale! xD!
sALUDOS!!
Arriba el americaaa! xD! viva mexicoo!