Galerías de Fotos
$query="select idColeccion,NombreColeccion from colecciones order by idColeccion asc";
$result=mysql_query($query) or die(mysql_error());
while($row2 = mysql_fetch_array($result))
{
echo " ";
$queryxx="select idSubcoleccion,NombreSubcoleccion from subcolecciones where idColeccion=$row2[idColeccion] ";
$resultxx=mysql_query($queryxx) or die(mysql_error());
while($rowxx = mysql_fetch_array($resultxx))
{
echo " |
if (!$coleccion and !$subcoleccion)
{
echo "Ultimas fotos publicadas";
$query="select * from fotos where ver like 'si' order by fecha desc LIMIT 6";
$result = mysql_query($query);
$columnas=2;
$num_rows = mysql_num_rows($result);
echo "";
for($i = 0; $i < $num_rows; $i++)
{
$row = mysql_fetch_array($result);
if($i % $columnas == 0)
{
echo "\n";
}
echo "$row[titulo]
 | ";
if(($i % $columns) == ($columns - 1) || ($i + 1) == $num_rows)
{
echo " \n";
}
}
echo " ";
}
if ($coleccion)
{
echo "Fotos publicadas: ";
$db = mysql_connect($hostname, $username, $password);
mysql_select_db($databasename, $db) or die(mysql_errno() . ": " . mysql_error() . " ");
// including the navbar class
include("./navbar.php");
// initiate it!
$nav = new navbar;
// set how many records to show at a time
$nav->numrowsperpage = 4;
$columnas=2;
$sql = "select * from fotos where idColeccion = $coleccion and ver like 'si' order by fecha desc";
// the third parameter of execute() is optional
$result = $nav->execute($sql, $db, "mysql");
// handle the returned result set
$rows = mysql_num_rows($result);
for ($y = 0; $y < $rows; $y++) {
$data = mysql_fetch_object($result);
if($y % $columnas == 0)
{
echo " \n";
}
echo"$data->titulo
idFoto\")> nombrefichero\"> | \n";
if(($y % $columns) == ($columns - 1) || ($y + 1) == $num_rows)
{
echo " \n";
}
}
// build the returned array of navigation links
$links = $nav->getlinks("all", "off");
if (count($links))
{
echo "
Más fotos: \n";
}
for ($y = 0; $y < count($links); $y++) {
echo $links[$y] . " ";
}
}
if ($subcoleccion)
{
echo " Fotos publicadas: ";
$db = mysql_connect($hostname, $username, $password);
mysql_select_db($databasename, $db) or die(mysql_errno() . ": " . mysql_error() . " ");
// including the navbar class
include("./navbar.php");
// initiate it!
$nav = new navbar;
// set how many records to show at a time
$nav->numrowsperpage = 4;
$columnas=2;
$sql = "select * from fotos where idSubcoleccion = $subcoleccion and ver like 'si' order by fecha desc";
// the third parameter of execute() is optional
$result = $nav->execute($sql, $db, "mysql");
// handle the returned result set
$rows = mysql_num_rows($result);
for ($y = 0; $y < $rows; $y++) {
$data = mysql_fetch_object($result);
if($y % $columnas == 0)
{
echo " \n";
}
echo"$data->titulo
idFoto\")> nombrefichero\"> | \n";
if(($y % $columns) == ($columns - 1) || ($y + 1) == $num_rows)
{
echo " \n";
}
}
// build the returned array of navigation links
$links = $nav->getlinks("all", "off");
if (count($links))
{
echo "
Más fotos: \n";
}
for ($y = 0; $y < count($links); $y++) {
echo $links[$y] . " ";
}
}
?>
|