salve ragazzi, nel mio sito sto lavorando su questo script, che3 è un album fotografico. funziona bene, però è semplice quindi ho inserito greybox... ma non funziona. chi mi aiuta a capire dove sbaglio?
grazie
<script type="text/javascript">
var GB_ROOT_DIR = "../gallery/greybox/";
</script>
<script type="text/javascript" src="greybox/AJS.js"></script>
<script type="text/javascript" src="greybox/AJS_fx.js"></script>
<script type="text/javascript" src="greybox/gb_scripts.js"></script>
<link href="greybox/gb_styles.css" rel="stylesheet" type="text/css" media="all" />
<?php
include("config.inc.php");
// initialization
$result_array = array();
$counter = 0;
$number_of_photos_in_row = 0;
$result_final = "";
if (isset($_GET['cid']))
{
$cid = (int)($_GET["cid"]);
}
if (isset($_GET['pid']))
{
$pid = (int)($_GET["pid"]);
}
// Category Listing
if( empty($cid) && empty($pid) )
{
$number_of_categories_in_row = 'immagine.style.height'/160;
$result = mysql_query( "SELECT c.nCategory_id,c.cCategory_name,COUNT(photo_id)
FROM ".$db_prefix."gallery_category as c
LEFT JOIN ".$db_prefix."gallery_photos as p ON p.photo_category = c.nCategory_id
GROUP BY c.nCategory_id" );
while( $row = mysql_fetch_array( $result ) )
{
$result_array[] = "".$row[1]." "."(".$row[2].")";
}
mysql_free_result( $result );
$result_final = "<tr>\n";
foreach($result_array as $category_link)
{
if($counter == $number_of_categories_in_row)
{
$counter = 1;
$result_final .= "\n</tr>\n<tr>\n";
}
else
$counter++;
$result_final .= "\t<td>".$category_link."</td>\n";
}
if($counter)
{
if($number_of_categories_in_row-$counter)
$result_final .= "\t<td colspan='".($number_of_categories_in_row-$counter)."'></td>\n";
$result_final .= "</tr>";
}
}
// Thumbnail Listing
else if( $cid && empty( $pid ) )
{
$number_of_thumbs_in_row = 'immagine.style.height'/160;
$result = mysql_query( "SELECT photo_id,photo_caption,photo_filename FROM ".$db_prefix."gallery_photos WHERE photo_category='".addslashes($cid)."'" );
$nr = mysql_num_rows( $result );
if( empty( $nr ) )
{
$result_final = "\t<tr><td align>Non ci sono Foto in questa categoria</td></tr>\n";
}
else
{
while( $row = mysql_fetch_array( $result ) )
{
$result_array[] = "[img]".$images_dir."/tb_".$row[2]."[/img]";
}
mysql_free_result( $result );
$result_final = "<tr>\n";
foreach($result_array as $thumbnail_link)
{
if($counter == $number_of_thumbs_in_row)
{
$counter = 1;
$result_final .= "\n</tr>\n<tr>\n";
}
else
$counter++;
$result_final .= "\t<td>".$thumbnail_link."</td>\n";
}
if($counter)
{
if($number_of_photos_in_row-$counter)
$result_final .= "\t<td colspan='".($number_of_photos_in_row-$counter)."'></td>\n";
$result_final .= "</tr>";
}
}
}
// Full Size View of Photo
else if( $pid )
{
$result = mysql_query( "SELECT photo_caption,photo_filename FROM ".$db_prefix."gallery_photos WHERE photo_id='".addslashes($pid)."'" );
list($photo_caption, $photo_filename) = mysql_fetch_array( $result );
$nr = mysql_num_rows( $result );
mysql_free_result( $result );
if( empty( $nr ) )
{
$result_final = "\t<tr><td>No Photo found</td></tr>\n";
}
else
{
$result = mysql_query( "SELECT cCategory_name FROM ".$db_prefix."gallery_category WHERE nCategory_id='".addslashes($cid)."'" );
list($category_name) = mysql_fetch_array($result);
mysql_free_result($result);
$result_final .= "<tr>\n\t<td>"
."Categorie >"
."$category_name</td>\n</tr>\n";
$result_final .= "<tr>\n\t<td align='center'>
<body onLoad='javascript:resize();' onResize='history.go(0)'>
[img]".$images_dir.[/img]
$photo_caption
</td>
</tr>
</body>";
}
}
// Final Output
echo <<<__HTML_END
<html>
<head>
<title>Gallery View</title>
<script language="javascript">
function resize()
{
var immagine = document.getElementById("miaImg");
immagine.style.height = document.body.clientHeight * 0.9;
}
</script>
<link rel="stylesheet" href="../blog/themes/cleanlines/global.css">
</head>
<body>
<table width='100%' border='0' align='center' style='width: 100%;'>
$result_final
</table>
</body>
</html>
__HTML_END;
?>