Browse Source

Taka sobie rewizja :|

git-svn-id: https://svn.pioder.pl/sg-svn@17 3ed2631f-fe0d-47e0-9194-a46bc0f18ee8
master
pioder 15 years ago
parent
commit
146f5832dd
2 changed files with 109 additions and 109 deletions
  1. +108
    -108
      robocze/display.php
  2. +1
    -1
      robocze/gallery.php

+ 108
- 108
robocze/display.php View File

@ -1,109 +1,109 @@
<?php
/**
* @package Galeria Suczawa 2009
* @file display.php
* @version $Id$
**/
require_once('./init.php'); #init stuff
$id=(isset($_GET['id'])) ? intval($_GET['id']) : 1; #check which photo should be loaded
NaglowekXHTML();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl">
<head>
<title>Podgląd zdjęcia nr <?=$id?></title>
<?php
/**
* @package Galeria Suczawa 2009
* @file display.php
* @version $Id$
**/
require_once('./init.php'); #init stuff
$id=(isset($_GET['id'])) ? intval($_GET['id']) : 1; #check which photo should be loaded
NaglowekXHTML();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl">
<head>
<title>Podgląd zdjęcia nr <?=$id?></title>
<link type="text/css" href="style.css" rel="stylesheet" /> <link type="text/css" href="style.css" rel="stylesheet" />
<meta http-equiv="Content-Type" content="<?=$xhtml?'application/xhtml+x':'text/ht'?>ml; charset=utf-8" />
<script type="text/javascript">
<!-- <[CDATA[ -->
path='http://<?=$_SERVER['HTTP_HOST'].dirname($_SERVER['REQUEST_URI'])?>';
<!-- ]]> -->
</script>
<script type="text/javascript" src="script.js"></script>
</head>
<body onload="init()">
<div id="display">
<?
$sql = "SELECT * FROM `photos` WHERE id='$id'";
if (!$result = $DB->query($sql))
{
showError('Nie mozna pobrac informacji o zdjeciu!');
}
if ($result->num_rows == 0)
{
$row = array(
'author' => '--',
'description' => 'Zdjęcie usunięte',
'photo_name' => 'no_image.png',
'id' => $i
);
}
else
{
$row = $result->fetch_assoc();
$row['author'] = ($row['author']=='') ? 'Autor nieznany' : $row['author'];
$row['description'] = ($row['description']=='') ? 'Brak opisu' : $row['description'];
}
?>
<div id="current">
<a href="images/upload/<?=htmlspecialchars($row['photo_name'])?>"><img id="curr_image" height="300px" alt="ZdjÄ_cie" src="images/upload/<?=htmlspecialchars($row['photo_name'])?>" /></a>
<br/>
<b>Autor: </b><a id="author"><?=htmlspecialchars($row['author'])?></a><br />
<b>Opis: </b><a id="description"><?=nl2br(htmlspecialchars($row['description']))?></a>
</div>
<?
$prev = $DB->query('SELECT COUNT(id) FROM photos WHERE id<'.$id)->fetch_row(); #check if there are some previous photos
$prev=$prev[0];
if($prev>0) {
$prev=$DB->query('SELECT * FROM photos WHERE id<'.$id.' ORDER BY id DESC LIMIT 1;')->fetch_assoc(); #if yes, get the previous photo's data
?>
<div id="prev">
<a onclick="javascript:prev()">
<img id="prev_image" height="100px" alt="<?=$prev['id']?>" src="images/upload/<?=$prev['thumb_name']?>" /><br/>
</a>
<a onclick="javascript:prev()">Poprzednie zdjęcie</a>
</div>
<?
}
else {
?>
<div id="prev" style="display: none">
<a onclick="javascript:prev()">
<img id="prev_image" height="100px" alt="" src="" /><br/>
</a>
<a onclick="javascript:prev()">Poprzednie zdjęcie</a>
</div>
<?
}
$next = $DB->query('SELECT COUNT(id) FROM photos WHERE id>'.$id)->fetch_row(); #check if there are some next photos
$next=$next[0];
if($next>0) {
$next=$DB->query('SELECT * FROM photos WHERE id>'.$id.' ORDER BY id ASC LIMIT 1;')->fetch_assoc(); #if yes, get the next photo's data
?>
<div id="next">
<a onclick="javascript:next()">
<img id="next_image" height="100px" alt="<?=$next['id']?>" src="images/upload/<?=$next['thumb_name']?>" /><br/>
</a>
<a onclick="javascript:next()">Następne zdjęcie</a>
</div>
<?
}
else {
?>
<div id="next" style="display: none">
<a onclick="javascript:next()">
<img id="next_image" height="100px" alt="" src="" /><br/>
</a>
<a onclick="javascript:next()">Następne zdjęcie</a>
</div>
<?
}
?>
</div>
</body>
</html>
<meta http-equiv="Content-Type" content="<?=$xhtml?'application/xhtml+x':'text/ht'?>ml; charset=utf-8" />
<script type="text/javascript">
<!-- <[CDATA[ -->
path='http://<?=$_SERVER['HTTP_HOST'].dirname($_SERVER['REQUEST_URI'])?>';
<!-- ]]> -->
</script>
<script type="text/javascript" src="script.js"></script>
</head>
<body onload="init()">
<div id="display">
<?
$sql = "SELECT * FROM `photos` WHERE id='$id'";
if (!$result = $DB->query($sql))
{
showError('Nie mozna pobrac informacji o zdjeciu!');
}
if ($result->num_rows == 0)
{
$row = array(
'author' => '--',
'description' => 'Zdjęcie usunięte',
'photo_name' => 'no_image.png',
'id' => $i
);
}
else
{
$row = $result->fetch_assoc();
$row['author'] = ($row['author']=='') ? 'Autor nieznany' : $row['author'];
$row['description'] = ($row['description']=='') ? 'Brak opisu' : $row['description'];
}
?>
<div id="current">
<a href="images/upload/<?=htmlspecialchars($row['photo_name'])?>"><img id="curr_image" height="300px" alt="ZdjÄ_cie" src="images/upload/<?=htmlspecialchars($row['photo_name'])?>" /></a>
<br/>
<b>Autor: </b><a id="author"><?=htmlspecialchars($row['author'])?></a><br />
<b>Opis: </b><a id="description"><?=nl2br(htmlspecialchars($row['description']))?></a>
</div>
<?
$prev = $DB->query('SELECT COUNT(id) FROM photos WHERE id<'.$id)->fetch_row(); #check if there are some previous photos
$prev=$prev[0];
if($prev>0) {
$prev=$DB->query('SELECT * FROM photos WHERE id<'.$id.' ORDER BY id DESC LIMIT 1;')->fetch_assoc(); #if yes, get the previous photo's data
?>
<div id="prev">
<a onclick="javascript:prev()">
<img id="prev_image" height="100px" alt="<?=$prev['id']?>" src="images/upload/<?=$prev['thumb_name']?>" /><br/>
</a>
<a onclick="javascript:prev()">Poprzednie zdjęcie</a>
</div>
<?
}
else {
?>
<div id="prev" style="display: none">
<a onclick="javascript:prev()">
<img id="prev_image" height="100px" alt="" src="" /><br/>
</a>
<a onclick="javascript:prev()">Poprzednie zdjęcie</a>
</div>
<?
}
$next = $DB->query('SELECT COUNT(id) FROM photos WHERE id>'.$id)->fetch_row(); #check if there are some next photos
$next=$next[0];
if($next>0) {
$next=$DB->query('SELECT * FROM photos WHERE id>'.$id.' ORDER BY id ASC LIMIT 1;')->fetch_assoc(); #if yes, get the next photo's data
?>
<div id="next">
<a onclick="javascript:next()">
<img id="next_image" height="100px" alt="<?=$next['id']?>" src="images/upload/<?=$next['thumb_name']?>" /><br/>
</a>
<a onclick="javascript:next()">Następne zdjęcie</a>
</div>
<?
}
else {
?>
<div id="next" style="display: none">
<a onclick="javascript:next()">
<img id="next_image" height="100px" alt="" src="" /><br/>
</a>
<a onclick="javascript:next()">Następne zdjęcie</a>
</div>
<?
}
?>
</div>
</body>
</html>

+ 1
- 1
robocze/gallery.php View File

@ -51,7 +51,7 @@ NaglowekXHTML();
<div id="footer"> <div id="footer">
<a id="copyright">Copyright © 2009 ...</a><br /> <a id="copyright">Copyright © 2009 ...</a><br />
<div id="links"> <div id="links">
<a href="index.php">Strona Główna</a> | <a href="gallery.php">Fotogaleria</a> | <a href="download.php">Download</a> | <a href="http://suczawa.ath.cx">Forum</a>
<a href="index.php">Strona Główna</a> | <a href="gallery.php">Fotogaleria</a> | <a href="download.php">Download</a> | <a href="http://suczawa.ath.cx">Forum</a> | <a href="admin/">Administracja</a>
</div> </div>
</div> </div>
</div> </div>

Loading…
Cancel
Save