Log in

View Full Version : Lightbox with databank



smarta
03-02-2011, 10:45 PM
My problem is, how to can I make the following code/script working as a lightbox::):confused:

echo "<td><a href=\"javascript:ampliar_img('../fotos_eventos/" . $fotos->data["cod_foto"] . ".jpg', " . $fotos->data["height"] . ", " . $fotos->data["width"] . ")\">";

I have the databank already and would like to change from "ampliar_img" ("enlarge_img") to rel="lightbox[roadtrip]

Here is the whole code:


<?php
$fotos = new consulta($link);
$sql = "Select * From fotos_eventos Where cod_evento = " . $even->data["cod_evento"];
$fotos->executa($sql);
if ($fotos->nrw > 0)
{
for ($i=0; $i < $fotos->nrw; $i++)
{
$fotos->navega($i);
if (($i % 4) == 0) // Está na 1ª ou 4ª linha
{
if ($i != 0)
echo "</tr>\n";
echo "<tr align='center' class='corpotabela'>";
}
echo "<td><a href=\"javascript:ampliar_img('../fotos_eventos/" . $fotos->data["cod_foto"] . ".jpg', " . $fotos->data["height"] . ", " . $fotos->data["width"] . ")\">";
echo "<img border='0' title='Clique na imagem para ampliar' src='../fotos_eventos/th_" . $fotos->data["cod_foto"] . ".jpg' class='thumb'></a></td>\n";

if ($i == $fotos->nrw - 1)
echo "</tr>";
}
}
?>
</table>
</td>
</tr>
</table>
</td>
<?php
}//End Case (exibir)
}// end switch
?>