Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Gnt estava vendo essa video aula aki http://www.mxmasters.com.br/dreamweaver/dreamweaver-sistema-de-galeria-de-imagem-com-lightbox-e-php/ Mais qunado terminao a galeria vai tudo certinhoa masi na gora que chega no exibir ele so aparece isso
; ?> alguem sabe o que pode está acontecendo de errado!
fiz do dream cs4 não no cs3
codigo do index
<?php require_once('Connections/fotos.php'); ?>
<?php
// Load the common classes
require_once('includes/common/KT_common.php');
// Load the tNG classes
require_once('includes/tng/tNG.inc.php');
// Make a transaction dispatcher instance
$tNGs = new tNG_dispatcher("");
// Make unified connection variable
$conn_fotos = new KT_connection($fotos, $database_fotos);
// Start trigger
$formValidation = new tNG_FormValidation();
$tNGs->prepareValidation($formValidation);// Start Multiple Image Upload Object
$multipleImageUpload = new tNG_MImageUpload("", "KT_Upload", "fotos");
$multipleImageUpload->setPrimaryKey("id", "{rsfotos.id}");
$multipleImageUpload->setBaseFolder("fotos/");
$multipleImageUpload->setFolder("{id}");
$multipleImageUpload->setMaxSize(5000);
$multipleImageUpload->setMaxFiles(100);
$multipleImageUpload->setAllowedExtensions("bmp, jpg, jpeg, gif, png");
$multipleImageUpload->setResize(640, 480, true);// Make an insert transaction instance
$ins_fotos = new tNG_insert($conn_fotos);
$tNGs->addTransaction($ins_fotos);$ins_fotos->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Insert1");
$ins_fotos->registerTrigger("BEFORE", "Trigger_Default_FormValidation", 10, $formValidation);
$ins_fotos->registerTrigger("END", "Trigger_Default_Redirect", 99, "categorias.php");
$ins_fotos->registerTrigger("AFTER", "Trigger_MultipleUploadRename", 90, $multipleImageUpload);$ins_fotos->setTable("fotos");
$ins_fotos->addColumn("categoria", "STRING_TYPE", "POST", "categoria");
$ins_fotos->setPrimaryKey("id", "NUMERIC_TYPE");
// Execute all the registered transactions
$tNGs->executeTransactions();
// Get the transaction recordset
$rsfotos = $tNGs->getRecordset("fotos");
$row_rsfotos = mysql_fetch_assoc($rsfotos);
$totalRows_rsfotos = mysql_num_rows($rsfotos);
?><html xmlns="[http://www.w3.org/1999/xhtml">](http://www.w3.org/1999/xhtml)
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<link href="includes/skins/mxkollection3.css" rel="stylesheet" type="text/css" media="all" />
<script src="includes/common/js/base.js" type="text/javascript"></script>
<script src="includes/common/js/utility.js" type="text/javascript"></script>
<script src="includes/skins/style.js" type="text/javascript"></script>
<?php echo $tNGs->displayValidationRules();?>
</head>
<body>
<?php
echo $tNGs->getErrorMsg();
?>
<form method="post" id="form1" action="<?php echo KT_escapeAttribute(KT_getFullUri()); ?>">
<table cellpadding="2" cellspacing="0" class="KT_tngtable">
<tr>
<td class="KT_th"><label for="categoria">Categoria:</label></td>
<td><input type="text" name="categoria" id="categoria" value="<?php echo KT_escapeAttribute($row_rsfotos['categoria']); ?>" size="32" />
<a target="_blank" onclick="<?php echo $multipleImageUpload->getUploadAction(); ?>" href="<?php echo $multipleImageUpload->getUploadLink(); ?>">Upload</a>
<input type="hidden" name="<?php echo $multipleImageUpload->getUploadReference(); ?>" value="1" />
<?php echo $tNGs->displayFieldHint("categoria");?> <?php echo $tNGs->displayFieldError("fotos", "categoria"); ?></td>
</tr>
<tr class="KT_buttons">
<td colspan="2"><input type="submit" name="KT_Insert1" id="KT_Insert1" value="Insert record" /></td>
</tr>
</table>
</form>
<p> </p>
</body>
</html><?php require_once('Connections/fotos.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$maxRows_Consulta = 10;
$pageNum_Consulta = 0;
if (isset($_GET['pageNum_Consulta'])) {
$pageNum_Consulta = $_GET['pageNum_Consulta'];
}
$startRow_Consulta = $pageNum_Consulta * $maxRows_Consulta;
mysql_select_db($database_fotos, $fotos);
$query_Consulta = "SELECT * FROM fotos ORDER BY id DESC";
$query_limit_Consulta = sprintf("%s LIMIT %d, %d", $query_Consulta, $startRow_Consulta, $maxRows_Consulta);
$Consulta = mysql_query($query_limit_Consulta, $fotos) or die(mysql_error());
$row_Consulta = mysql_fetch_assoc($Consulta);
if (isset($_GET['totalRows_Consulta'])) {
$totalRows_Consulta = $_GET['totalRows_Consulta'];
} else {
$all_Consulta = mysql_query($query_Consulta);
$totalRows_Consulta = mysql_num_rows($all_Consulta);
}
$totalPages_Consulta = ceil($totalRows_Consulta/$maxRows_Consulta)-1;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="[http://www.w3.org/1999/xhtml">](http://www.w3.org/1999/xhtml)
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<table border="0">
<tr>
<td>id</td>
<td>categoria</td>
</tr>
<?php do { ?>
<tr>
<td><?php echo $row_Consulta['id']; ?></td>
<td><a href="exibir.php?id=<?php echo $row_Consulta['id']; ?>"><?php echo $row_Consulta['categoria']; ?></a></td>
</tr>
<?php } while ($row_Consulta = mysql_fetch_assoc($Consulta)); ?>
</table>
</body>
</html>
<?php
mysql_free_result($Consulta);
?>codigo do exibir
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="[http://www.w3.org/1999/xhtml">](http://www.w3.org/1999/xhtml)
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<link rel="stylesheet" type="text/css" href="../style-projects-jquery.css" />
<!-- Arquivos utilizados pelo jQuery lightBox plugin -->
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/jquery.lightbox-0.5.js"></script>
<link rel="stylesheet" type="text/css" href="css/jquery.lightbox-0.5.css" media="screen" />
<!-- / fim dos arquivos utilizados pelo jQuery lightBox plugin -->
<!-- Ativando o jQuery lightBox plugin -->
<script type="text/javascript">
$(function() {
$('#gallery a').lightBox();
});
</script>
<style type="text/css">
/* jQuery lightBox plugin - Gallery style */
#gallery {
background-color: #444;
padding: 10px;
width: 779px;
}
#gallery ul { list-style: none; }
#gallery ul li { display: inline; }
#gallery ul img {
border: 5px solid #3e3e3e;
border-width: 5px 5px 20px;
}
#gallery ul a:hover img {
border: 5px solid #fff;
border-width: 5px 5px 20px;
color: #fff;
}
#gallery ul a:hover { color: #fff; }
</style>
</head>
<body>
<div id="gallery">
<?php $pasta = $_GET['id']; ?>
<?php echo "<a href='$filename' target='_blank'><img src='$filename' width='200' height='200'></a> " ;
}
?>
</div>
</body>
</html>amigo, não rodei o teu código aqui e também sou um aprendiz
mas acho que o um dos problemas é que você tá chamando uma variável dentro de aspas simples
tenta assim lá no final
<?php
foreach (glob("fotos/$pasta/*.jpg") as $filename) {?>
<a href="$filename" target="_blank"><img src="$filename" width="200" height="200"></a>
<?php } ?>
foi mal.. esqueci de um detalhe..
<?php
foreach (glob("fotos/$pasta/*.jpg") as $filename) {?>
<a href="<?=$filename?>" target="_blank"><img src="<?=$filename?>" width="200" height="200"></a>
<?php } ?>
no editor de texto é f*** pra editar.. rsCara Não deu certo naum !mais agora não aparecer isso so apareces umas coisas lah menos as imagesn !sabe se tem algo mais errado?
Abrs
Orientações para uma boa participação. Poste EXATAMENTE o erro como aparece.
Carlos Eduardo
não aparece imagens!fika tipo umas coisinha bem pequena azuis no lugar e quando você clicak e abre o efeito mais naum aparece imagen nenhuma!
Verifique se as fotos não foram salvas em uma pasta diferente e troque as short_open_tags (<? e <?=) pelas tags completas (<?php e <?php echo).
Se não conseguir corrigir, passe um link para vermos o erro acontecendo, facilitará na solução.
Carlos Eduardo
Velho com essas informações é difícil saber o que está acontecendo, poste a parte do código aonde você puxa as imagens do bd.
Até mais!