<?
include("config.php");
$conn = mysql_connect("$host","$usuario","$senha");
$banco = mysql_select_db("$bancodedados");
$num = mysql_query("SELECT * FROM fotos") or die(mysql_error());
$sql = mysql_query("SELECT * FROM fotos_cat") or die(mysql_error());
$qnt = mysql_num_rows($num);
$qnt2 = mysql_num_rows($sql);
$data = date('Y-m-d H:i:s');
?>
<html><head><title>fotos</title>
<META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=Shift_JIS">
</head>
<body bgcolor="#FE9901"><font size="-2">
<center>[Publicidades]<br>
<?
include("func.php");
$MySQL = new banner();
$MySQL->sorteio("imagem");
?>
<br>[Publicidade]<br>
<?
$MySQL->sorteio("texto");
?>
<hr color="#33CCFF">
</center>
<center>Imagens de Fundo
<hr color="#33CCFF">
Temos <?print $qnt?> fotos, em <?print "$qnt2";?> categorias.
<hr color="#33CCFF">
<?
if($_GET[cat] == "") {
?>
Selecione em qual categoria vc quer entrar:<hr color="#33CCFF">
<? while($row = mysql_fetch_array($sql)) { ?>
<a href="?cat=<?print $row[id]?>"><?print $row[categoria]?></a>
<?
$x = mysql_query("SELECT * FROM fotos where cat = '$row[id]' AND data <= '$data'") or die(mysql_error());
$numb = mysql_num_rows($x);
print " (";
print $numb;
print ") <br>";
}
}
else {
if($_GET[foto] == "") {
$qntd = 10;
if(!$_GET[pagina]) {
$pagina = 1;
}
else {
$pagina = $_GET[pagina];
}
$mat = $pagina -1;
$inicial = $qntd * $mat;
$sql = mysql_query("SELECT * FROM fotos WHERE cat = '$_GET[cat]' AND data <= '$data' AND status = 'sim'") or die(mysql_error());
$num_pag = mysql_num_rows($sql);
$num = mysql_query("SELECT * FROM fotos WHERE cat = '$_GET[cat]' AND data <= '$data' AND status = 'sim' ORDER by hits ASC LIMIT $inicial,$qntd") or die(mysql_error());
$total_pag = ceil($num_pag/$qntd);
print "<center>";
if($pagina>1) {
$anterior = $pagina-1;
print "[<a href='?cat=$_GET[cat]&pagina=$anterior'><- Anterior </a> ]";
}
if($pagina<$total_pag) {
$proximo = $pagina+1;
print " [<a href='?cat=$_GET[cat]&pagina=$proximo'> Proximo -></a>]";
}
print "</center>";
while($row = mysql_fetch_array($num)) { ?>
<a href="?cat=<?print $_GET[cat]?>&foto=<?print $row[id]?>"><?print $row[autor]?></a> - <?print $row[hits]?> Hits<br>
<?
}
}
else {
$num = mysql_query("SELECT * FROM fotos WHERE id = '$_GET[foto]' AND data <= '$data'") or die(mysql_error());
while($row = mysql_fetch_array($num)) { ?>
<?print $row[autor];?><br><hr width="50%" size="1" align="left">
<img src="<?print $row[url]?>"><br><hr color="#33CCFF" width="50%" size="1" align="left"><center>
<?
$hits = $row[hits] + 1;
$sql = mysql_query("UPDATE fotos SET hits = '$hits' WHERE id = '$_GET[foto]'");
?>
<?print $hits?> Hits
<?
}
}
}
?></center>
<hr color="#33CCFF">
[color=#FF0000]como eu coloco marca dagua nesse sistema de fotos?

Marca Dagua
Started By semponto, 02/07/2006, 04:54
Nenhuma resposta neste tópico
1 user(s) are reading this topic
0 membro(s), 1 visitante(s) e 0 membros anônimo(s)