Jump to content


Hawk

Member Since 22/01/2003
Offline Last Active 22/10/2006, 12:15
-----

Posts I've Made

In Topic: Como Colocar Link

07/05/2005, 20:48

posta o código do ver.php. Como tá notícia no bd?

In Topic: Miniatura De Gif Animado

07/05/2005, 19:46

Tenta assim. Não testei

<?

// pasta de onde o script vai carregar as imagens
$dir = "./nomedasuapasta";

// função que vai gerar thumb
function gerathumb($arquivoimg) {

/*
* Examples / Exemplos:
* <img src="createthumb.php?image=filename.jpg">
* <img src="createthumb.php?image=filename.jpg&max=200">

*/

if ( isset( $arquivoimg ) ) {
$image = $arquivoimg;
} else {
echo "Parâmetro \"image\" faltando.<BR>";
echo "Parameter \"image\" missing.";
exit;
}

if ( isset( $arquivoimg["max"] ) ) {
$max = $arquivoimg["max"];
} else {
$max = "100";
}

if ( !function_exists( "imagecreatefromstring" ) ) {
header( "location: $image" );
exit;
}

$im = @imagecreatefromstring( @fread( @fopen( $image, "r" ), @filesize( $image ) ) );

if ( !strlen( $im ) ) {
$im = imagecreate ( $max, $max );

$bgc = imagecolorallocate ( $im, 255, 255, 255 );
$tc = imagecolorallocate ( $im, 0, 0, 0 );
imagefilledrectangle ( $im, 0, 0, 150, 30, $bgc );

imagestring ( $im, 2, 3 , 15, "Erro ao carregar", $tc );
imagestring ( $im, 2, 18, 30, "miniatura.", $tc );

imagestring ( $im, 2, 10, 55, "Error on load", $tc );
imagestring ( $im, 2, 18, 70, "thumbnail.", $tc );

header( "Content-type: " . image_type_to_mime_type( IMAGETYPE_PNG ) );
echo imagepng( $im );
exit;
}

$largura = imagesx( $im );
$altura = imagesy( $im );

if ( $largura >= $altura ) {
if ( $largura > $max ) {
  $naltura = ( $max / $largura ) * $altura;
  $nlargura = ( $max / $largura ) * $largura;
}
} else {
if ( $altura > $max ) {
  $nlargura = ( $max / $altura ) * $largura;
  $naltura = ( $max / $altura ) * $altura;
}
}

if ( function_exists( 'imagecopyresampled' ) ) {
if ( function_exists( 'imageCreateTrueColor' ) ) {
  $ni = imageCreateTrueColor( $nlargura, $naltura );
} else {
  $ni = imagecreate( $nlargura, $naltura );
}
if ( !@imagecopyresampled( $ni, $im, 0, 0, 0, 0, $nlargura, $naltura, $largura, $altura ) ) {
  imagecopyresized( $ni, $im, 0, 0, 0, 0, $nlargura, $naltura, $largura, $altura );
}
} else {
$ni = imagecreate( $nlargura, $naltura );
imagecopyresized( $ni, $im, 0, 0, 0, 0, $nlargura, $naltura, $largura, $altura );
}

header( "Content-type: " . image_type_to_mime_type( IMAGETYPE_JPEG ) );
echo imagejpeg( $ni, null, 70 );
}

if (is_dir($dir)) {
    if ($pasta = opendir($dir)) {
        while (($arq_imagem = readdir($pasta)) !== false) {
            if (!(($arq_gif == ".") || ($arq_gif == "..")))
                gerathumb($arq_gif);
        }
        closedir($pasta);
    }
}

exit;
?>

In Topic: Chave Estrangeira...

07/05/2005, 19:31

coloca a estrutura dessas suas tabelas aqui para ver se conseguimos entender melhor oq vc quer. Pq tá meio confuso hehehe

In Topic: Arrays + Mysql

07/05/2005, 19:22

Vc tá chamando errado as info do bd
tenta assim:
<?

session_start();


include ("config.php");

//seleciona dados na tabela
$sql = mysql_query("Select * From loja Order by codigo Desc") or die(mysql_error());
$tot3 = mysql_num_rows($sql);
While($r = mysql_fetch_array($sql)){




//MONTA O ARRAY DE PRODUTOS

$produto[1][CODIGO]     =   $r["codigo"];

$produto[1][ARTISTA]     =   $r["artista"];

$produto[1][ALBUM]       =   $r["sobre"];

$produto[1][PRECO]       =   $r["preco"];

$produto[1][IMAGEM]      =   $r["imagem"];



//TOTAL DE PRODUTOS POR LINHA

$total = 2;



}

?>


In Topic: Erro 404

07/05/2005, 18:45

Sua dúvida não está relacionada a php. Estaria se vc utilizasse query string no seu site oq não parece pelo exemplo de url que postou.

Isso vc consegue no seu painel do host. No meu é o cpainel. Então é "Error Pages".
Veja com o suporte do seu host.

Se vc quiser usar query string no site vc pode conseguir esse efeito caso uma url digitada não for encontrada.

veja esse tópico
http://forum.wmonlin...howtopic=110269

mas mesmo assim se o visitante digitar o link direto no caso www.meusite.com.br/blogue e não encontrar a página não vai ser exibida a página de erro.

IPB Skin By Virteq