$sql = mysql_query("SELECT * FROM galeria");
?>
Fica assim:
<? $sql = mysql_query("SELECT * FROM galeria");
?>
Posted 18/05/2008, 10:55
Posted 27/05/2008, 10:31
Edição feita por: André - MundoNX, 27/05/2008, 10:52.
Posted 05/06/2008, 15:50
Posted 06/06/2008, 09:14
<?
$logo = "images/logo.png"; // enderego da sua logomarca
$file = $_GET['imagem']; // $file vem por query-string ou post, contendo nome do arquivo
header("Content-type: image/jpeg");
$foto = imagecreatefromjpeg($_GET[imagem]);
$largura_foto = imagesx($foto);//LARGURA
$altura_foto = imagesy($foto);//ALTURA
if($largura_foto > $altura_foto){ // se largura for maior q altura
$new_w = (int)$_GET["w"];
$new_h = (int)$_GET["h"];
$PosicaoLogoW = 0;
$PosicaoLogoH = 275;
} else { // senaum joga a imagem com 240 de altura com largura original
$new_w = 306; //$largura_foto;
$new_h = 389;
$PosicaoLogoW = -98;
$PosicaoLogoH = 275;
}
$dst_img=imagecreatetruecolor($new_w,$new_h);
$src_img=imagecreatefromjpeg($file); // pega a imagem
$extensao=substr($logo, -3); // pega extansao da logo
if ($extensao=="jpg" OR $extensao=="JPG"){
$src2_img=imagecreatefromjpeg($logo); //logotipo em jpg
}
if ($extensao=="gif" OR $extensao=="GIF"){
$src2_img=imagecreatefromgif($logo); //logotipo em gif
}
if ($extensao=="png" OR $extensao=="PNG"){
$src2_img=imagecreatefrompng($logo); //logotipo em png
}
$tira_fundo = imagecolorallocate($src2_img, 0, 255, 49); //pega a imagem e tira a cor indicada pelo rgb
//$imagecolortransparent($src2_img, $tira_fundo); //agora vc deixa a cor rgb transparente:
$insert_x = imagesx($src2_img);
$insert_y = imagesy($src2_img);
imagecopyresampled($dst_img,$src_img,0,0,0,0,$new_w,$new_h,imagesx($src_img),imagesy($src_img));
//imagecopymerge($original, $meu_logo, $imagem_x-($logo_x), $imagem_y-($logo_y+5), 0, 0, $logo_x, $logo_y, 50);
imagecopymerge($dst_img,$src2_img,$PosicaoLogoW,$PosicaoLogoH,0,0,$insert_x,$insert_y,75); //posiciona o logotipo
imagejpeg($dst_img, NULL, 90); //gera um jpeg com o logotipo
?>
Posted 17/06/2008, 15:59
Posted 27/06/2008, 16:49
<?
//include("../../config.php");
$id = $_GET[id];
$cidade = $_GET[cidade];
$pg = $_GET[pg];
$sql = mysql_query("SELECT * FROM galeria where id='$id'");
$dados= mysql_fetch_array($sql);
$dir = "../../images/eventos/$dados[id_franquia]/$dados[pasta]/";
if (strstr($pg,".")== TRUE){
$pg=ceil($pg);
$pg=$pg-1;
}
if (!$pg==0)
{
$cont=$pg * $qts_thumbs;
} else {
$cont=0;
}
?>
<script language=JavaScript1.2>
function makevisible(cur,which){
if (which==0)
cur.filters.alpha.opacity=80
else
cur.filters.alpha.opacity=100
}
</SCRIPT>
<style type="text/css">
<!--
.style2 {color: #FF0000}
.style3 { font-size: 10px;
font-family: Verdana, Arial, Helvetica, sans-serif;
}
-->
</style>
<table width="212" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td colspan="2" valign="top">
<table width="212" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="19" align="left" valign="top"><span class="style2">Evento: <? echo "$dados[nome]";?></span><br />
Local
:
<? echo "$dados[local]";?>
<br />
Data:
<? $data = explode("-", $dados[data]); echo "$data[2]/$data[1]/$data[0]";?>
<br />
<span class="style3">Fotos: <? echo "$dados[fotografo]";?> </span></td>
</tr>
<tr>
<td width="200" height="340" valign="top"><?
$handle = opendir($dir);
$ext = "jpg";
$indice = 0;
$ipp = $qts_thumbs;
while (false !== ($file = readdir($handle)))
{
$pathdata = pathinfo($file);
if (!is_dir($file) && ($pathdata["extension"] == strtolower($ext)) || ($pathdata["extension"] == strtoupper($ext)))
{
$imagens[$indice] = $file;
$indice++;
}
}
natcasesort($imagens);
reset($imagens);
$pagina = 1;
if ($_GET['pg'])
$pagina = $_GET['pg'];
$paginas = ceil(count($imagens) / $ipp);
$inicio = $pg * $ipp;
$thumb="thumbs.php?w=60&h=60&imagem=";
for ($i=$inicio; $i<($inicio+$ipp); $i++)
if($imagens[$i] != ""){
$cont=$cont+1;
?>
<?
$z = "";
while($z < "$paginas") {
$z++;
if($pg == $z){
$page = $ipp*$z+1;
}
}
//echo $page;
?>
<a href="zoom.php?id=<? echo $id?>&cidade=<? echo $cidade?>&page=<? echo "$cont";?>" target="exibe_fotos"><img src="<? echo "$thumb$dir$imagens[$i]"; ?>" hspace="1" vspace="2" border="0" style="border:1px solid #999999;FILTER: alpha(opacity=100)" onmouseover="makevisible(this,0)" onmouseout="makevisible(this,1)"></a>
<!--<a href="java script:Muda('<? echo "thumbs.php?w=320&h=240&imagem=$dir$imagens[$i]"; ?>','<? echo "$cont";?>')"> <img src="<? echo "$thumb$dir$imagens[$i]"; ?>" hspace="1" vspace="2" border="0" style="border:1px solid #999999;FILTER: alpha(opacity=100)" onmouseover="makevisible(this,0)" onmouseout="makevisible(this,1)"></a>-->
<? }?></td>
</tr>
</table></td>
</tr>
<tr><td height="5"></td></tr>
<tr>
<TD valign="top">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr valign="middle">
<td width="30%" height="20" align="left" valign="top"> Fotos:
<?
$dir1=opendir($dir);
$cont=0;
while ($res=readdir($dir1) ){
$tipo=explode(".",$res);
if ($tipo[1]=="jpg" || $tipo[1]=="JPG"){
$cont=$cont+1;
}
}
echo "<strong>".($cont)."</strong>";
?> </td>
<td width="70%" align="right" valign="top"><font color="#000000"> <strong>
<?
echo "Pgs: ";
for($i=0; $i<$paginas; $i++){
$url = "?id=$id&cidade=$cidade&pg=$i";
if ($i==$pg) {
echo "<font color='#666666'>".($i+1)."</font> ";
} else {
echo "<a href='$url'><font color='#000000'>".($i+1)."</font></a> ";
}
}
?>
</strong>
<? /*
$url = "?id=$id&cidade=$cidade";
if ($pg > 0){
$pg = $pg-1;
echo "<a href='$url&pg=$pg'>«</a>";
}
for ($i=1;$i<$paginas;$i++){
if ($i-1 != $pg) {
echo "<a href='$url&pg=$i'>";
} else {
echo "<span style='background-color: #0066CC;color: #FFFFFF'> ";
}
echo "<b>$i</b> </span></a>";
}
if ($pg < ($paginas-2)){
$pg = $pg+1;
echo "<a href='$url&pg=$pg'>»</a>";
} */?>
</font></td>
</tr>
</table> </td>
</tr>
</table>
Posted 04/07/2008, 15:49
Posted 04/07/2008, 23:09
"; $abre=fopen($file,w); fputs($abre,$escrever); ?>
Posted 05/07/2008, 18:30
Pessoal,
estou com um problema bizarro aqui!
Eu usava a galeria numa boa, estou montando um outro site aqui e está me aparecendo um erro na hora de instalar.
Primeiro que no instalar.php ele me mostra todos os forms e nao so o primeiro.
Entre o primeiro e o segundo form aparece"; $abre=fopen($file,w); fputs($abre,$escrever); ?>
Tentei de td o jeito arrumar. estou usando PHP 5.2.6
Cheguei a mudar as tags do php de <? para <?php, os forms ficam corretos só que quando clico em avançar ele nao vai p/ lugar nenhum!
Help!
Entao galera, parece que o problema está no lance da tag de inicialização do PHP.
Consegui mudar aqui. Mas será que é algum problema da versão? Tenho que mudar todas as tags?
Posted 20/07/2008, 19:36
Olá vou posta o meu Gerador de thumbs com marca d´agua!.
<? $logo = "images/logo.png"; // enderego da sua logomarca $file = $_GET['imagem']; // $file vem por query-string ou post, contendo nome do arquivo header("Content-type: image/jpeg"); $foto = imagecreatefromjpeg($_GET[imagem]); $largura_foto = imagesx($foto);//LARGURA $altura_foto = imagesy($foto);//ALTURA if($largura_foto > $altura_foto){ // se largura for maior q altura $new_w = (int)$_GET["w"]; $new_h = (int)$_GET["h"]; $PosicaoLogoW = 0; $PosicaoLogoH = 275; } else { // senaum joga a imagem com 240 de altura com largura original $new_w = 306; //$largura_foto; $new_h = 389; $PosicaoLogoW = -98; $PosicaoLogoH = 275; } $dst_img=imagecreatetruecolor($new_w,$new_h); $src_img=imagecreatefromjpeg($file); // pega a imagem $extensao=substr($logo, -3); // pega extansao da logo if ($extensao=="jpg" OR $extensao=="JPG"){ $src2_img=imagecreatefromjpeg($logo); //logotipo em jpg } if ($extensao=="gif" OR $extensao=="GIF"){ $src2_img=imagecreatefromgif($logo); //logotipo em gif } if ($extensao=="png" OR $extensao=="PNG"){ $src2_img=imagecreatefrompng($logo); //logotipo em png } $tira_fundo = imagecolorallocate($src2_img, 0, 255, 49); //pega a imagem e tira a cor indicada pelo rgb //$imagecolortransparent($src2_img, $tira_fundo); //agora vc deixa a cor rgb transparente: $insert_x = imagesx($src2_img); $insert_y = imagesy($src2_img); imagecopyresampled($dst_img,$src_img,0,0,0,0,$new_w,$new_h,imagesx($src_img),imagesy($src_img)); //imagecopymerge($original, $meu_logo, $imagem_x-($logo_x), $imagem_y-($logo_y+5), 0, 0, $logo_x, $logo_y, 50); imagecopymerge($dst_img,$src2_img,$PosicaoLogoW,$PosicaoLogoH,0,0,$insert_x,$insert_y,75); //posiciona o logotipo imagejpeg($dst_img, NULL, 90); //gera um jpeg com o logotipo ?>
Posted 21/07/2008, 17:56
Se este post lhe ajudou, ajude o fórum também. Use a reputação de mensagens!
Posted 29/07/2008, 11:46
Posted 30/07/2008, 10:18
Posted 30/07/2008, 13:37
Posted 01/08/2008, 17:35
0 membro(s), 2 visitante(s) e 0 membros anônimo(s)