Poprawki w paginacji zdjęć.

Zmiana funkcji z imagecopyresized() na imagecopyresampled() do zmiany rozmiaru obrazków.
Inne drobne poprawki

git-svn-id: https://svn.pioder.pl/sg-svn@24 3ed2631f-fe0d-47e0-9194-a46bc0f18ee8
This commit is contained in:
pioder
2012-01-22 16:14:11 +00:00
parent e6bf0a5071
commit e32992fa40
49 changed files with 171 additions and 75 deletions

View File

@@ -1,5 +1,12 @@
<?php
NaglowekXHTML();
/**
* @package Galeria Suczawa 2009
* @file download.php
* @version $Id$
**/
require_once('./init.php'); #init stuff
NaglowekXHTML();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
@@ -26,17 +33,17 @@
<a class="link" href="http://rapidshare.com/files/243914577/ZDJECIA.7z.007">http://rapidshare.com/files/243914577/ZDJECIA.7z.007</a> <br/>
<a class="link" href="http://rapidshare.com/files/243926118/ZDJECIA.7z.008">http://rapidshare.com/files/243926118/ZDJECIA.7z.008</a> <br/>
</div>
<img src="images/has__o.png" alt="Has__o:" />
<img src="images/haslo.png" alt="Hasło:" />
<div class="dframe">
<b>Has__o: </b> Sucava2009
<b>Hasło: </b> Sucava2009
</div>
</div>
</div>
</div>
<div id="footer">
<a id="copyright">Copyright © 2009 ...</a><br />
<a id="copyright">Copyright © 2009 Various Authors</a><br />
<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>
</div>
</div>
</div>

View File

@@ -3,10 +3,9 @@
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Czas wygenerowania: 16 Cze 2009, 12:36
-- Wersja serwera: 5.1.33
-- Wersja PHP: 5.2.9
-- test
-- Czas wygenerowania: 23 Paź 2009, 22:01
-- Wersja serwera: 5.1.37
-- Wersja PHP: 5.2.10-2.2
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
@@ -21,18 +20,20 @@ SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
--
CREATE TABLE IF NOT EXISTS `admins` (
`id` smallint(1) NOT NULL,
`id` smallint(1) NOT NULL AUTO_INCREMENT,
`nick` varchar(20) NOT NULL,
`password` varchar(200) NOT NULL,
`email` varchar(20) NOT NULL,
`IP` varchar(14) NOT NULL,
`IP` varchar(80) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ;
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ;
--
-- Zrzut danych tabeli `admins`
--
INSERT INTO `admins` (`id`, `nick`, `password`, `email`, `IP`) VALUES
(1, 'admin', '21232f297a57a5a743894a0e4a801fc3', 'root@localhost', '::ffff:127.0.0.1');
-- --------------------------------------------------------
@@ -41,25 +42,45 @@ CREATE TABLE IF NOT EXISTS `admins` (
--
CREATE TABLE IF NOT EXISTS `photos` (
`id` smallint(4) NOT NULL,
`id` smallint(4) NOT NULL AUTO_INCREMENT,
`thumb_name` varchar(20) NOT NULL,
`photo_name` varchar(20) NOT NULL,
`author` varchar(30) NOT NULL,
`description` text NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=10;
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=30 ;
--
-- Zrzut danych tabeli `photos`
--
INSERT INTO `photos` (`id`, `thumb_name`, `photo_name`, `author`, `description`) VALUES
(1, 'DSC_0026_m.png', 'DSC_0026.png', '', 'Pod zamkiem - grupowo'),
(2, 'DSC_0132_m.png', 'DSC_0132.png', '', 'Pod szkołą'),
(1, 'DSC_0026_m.png', 'DSC_0026.png', '', 'Pod zamkiem - grupowo.'),
(2, 'DSC_0132_m.png', 'DSC_0132.png', '', 'Pod szkołą.'),
(3, 'DSC_0169_m.png', 'DSC_0169.png', '', 'Widoki na Monastyr'),
(4, 'DSC_0294_m.png', 'DSC_0294.png', '', 'Bukowina Południowa'),
(5, 'DSC_0378_m.png', 'DSC_0378.png', '', 'Pani Monika :)'),
(6, 'DSC_0080_m.png', 'DSC_0080.png', '', 'Nasz Geniusz podczas rozdawania nagród ;)'),
(7, 'DSC_0672_m.png', 'DSC_0672.png', '', 'Wąwóz...'),
(8, 'DSCF0372_m.png', 'DSCF0372.png', '', 'Świątynia w Monastyrze'),
(9, 'DSCF0452_m.png', 'DSCF0452.png', '', 'Kolejna fotka z wąwozu.');
(6, 'DSC_0080_m.png', 'DSC_0080.png', '', 'Nasz Geniusz podczas rozdawania nagród'),
(7, 'DSC_0672_m.png', 'DSC_0672.png', '', 'Wąwóz - jakaś góra.'),
(8, 'DSCF0372_m.png', 'DSCF0372.png', '', ''),
(9, 'dsc_0006_m.jpg', 'dsc_0006.jpg', '', 'W pracowni - tam pisaliśmy konkurs.'),
(10, '07062009544_m.jpg', '07062009544.jpg', '', ''),
(11, '07062009548_m.jpg', '07062009548.jpg', '', ''),
(12, '07062009549_m.jpg', '07062009549.jpg', '', ''),
(13, '07062009550_m.jpg', '07062009550.jpg', '', ''),
(14, '07062009553_m.jpg', '07062009553.jpg', '', ''),
(15, '07062009557_m.jpg', '07062009557.jpg', '', ''),
(16, '07062009560_m.jpg', '07062009560.jpg', '', ''),
(17, '07062009561_m.jpg', '07062009561.jpg', '', ''),
(18, '07062009563_m.jpg', '07062009563.jpg', '', ''),
(19, '07062009565_m.jpg', '07062009565.jpg', '', ''),
(20, '07062009566_m.jpg', '07062009566.jpg', '', ''),
(21, '07062009567_m.jpg', '07062009567.jpg', '', ''),
(22, '07062009569_m.jpg', '07062009569.jpg', '', ''),
(23, '07062009570_m.jpg', '07062009570.jpg', '', ''),
(24, '07062009571_m.jpg', '07062009571.jpg', '', ''),
(25, '08062009624_m.jpg', '08062009624.jpg', '', ''),
(26, '08062009625_m.jpg', '08062009625.jpg', '', ''),
(27, '08062009629_m.jpg', '08062009629.jpg', '', ''),
(28, '08062009630_m.jpg', '08062009630.jpg', '', ''),
(29, '08062009632_m.jpg', '08062009632.jpg', '', '');

View File

@@ -30,7 +30,7 @@ function NaglowekXHTML()
echo '<?xml version="1.0" encoding="utf-8"?>';
}
function GenerujListeStron()
function GenerujListeStron($adm = false)
{
global $cnt;
global $page;
@@ -38,8 +38,16 @@ function GenerujListeStron()
if ($page>1)
{
$content .= '<a href="?page=1" title="Pierwsza strona">&laquo;</a>';
$content .= '&nbsp;&nbsp;<a href="?page='.($page-1).'" title="Poprzednia strona">&lt;</a> ';
if ($adm)
{
$content .= '<a href="?mode=admin_gallery&amp;submode=view&amp;page=1" title="Pierwsza strona">&laquo;</a>';
$content .= '&nbsp;&nbsp;<a href="?mode=admin_gallery&amp;submode=view&amp;page='.($page-1).'" title="Poprzednia strona">&lt;</a> ';
}
else
{
$content .= '<a href="?page=1" title="Pierwsza strona">&laquo;</a>';
$content .= '&nbsp;&nbsp;<a href="?page='.($page-1).'" title="Poprzednia strona">&lt;</a> ';
}
}
#wygeneruj strony
@@ -60,19 +68,41 @@ function GenerujListeStron()
{
if ($i == $cnt)
{
$content .= '<a href="?page='.$i.'">'.$i.'</a> ';
if ($adm)
{
$content .= '<a href="?mode=admin_gallery&amp;submode=view&amp;page='.$i.'">'.$i.'</a> ';
}
else
{
$content .= '<a href="?page='.$i.'">'.$i.'</a> ';
}
}
else
{
$content .= '<a href="?page='.$i.'">'.$i.'</a> | ';
if ($adm)
{
$content .= '<a href="?mode=admin_gallery&amp;submode=view&amp;page='.$i.'">'.$i.'</a> | ';
}
else
{
$content .= '<a href="?page='.$i.'">'.$i.'</a> | ';
}
}
}
}
#dodaj linka "+1 strona" oraz do ostatniej
if ($page<$cnt)
{
$content .= '<a href="?page='.($page+1).'" title="Następna strona">&gt;</a>';
$content .= '&nbsp;&nbsp;<a href="?page='.$cnt.'" title="Ostatnia strona">&raquo;</a>';
if ($adm)
{
$content .= '<a href="?mode=admin_gallery&amp;submode=view&amp;page='.($page+1).'" title="Następna strona">&gt;</a>';
$content .= '&nbsp;&nbsp;<a href="?mode=admin_gallery&amp;submode=view&amp;page='.$cnt.'" title="Ostatnia strona">&raquo;</a>';
}
else
{
$content .= '<a href="?page='.($page+1).'" title="Następna strona">&gt;</a>';
$content .= '&nbsp;&nbsp;<a href="?page='.$cnt.'" title="Ostatnia strona">&raquo;</a>';
}
}
#dodaj linka do ostatniej strony
@@ -126,12 +156,43 @@ function NaglowekPA($nazwapodstrony)
}
function StopkaPA()
{
echo '
<span style="font-size: 8pt">ACP by <a href="http://pioder.gim2przemysl.int.pl" target="_blank">PioDer</a> &copy; 2009</span>
echo '<br /><br />
<span style="font-size: 8pt">ACP by <a href="http://www.pioder.pl" target="_blank">PioDer</a> &copy; 2009-2012</span>
</div>
</center>
</body>
</html>
';
}
function ZmniejszObraz($wejscie, $szer_wys, $wyjscie)
{
#otwieramy oryginal
$obraz = imagecreatefromjpeg($wejscie);
# sprawdz, czy obrazek nie jest wyzszy niz szerszy
if (imagesy($obraz) > imagesx($obraz))
{
$wysokosc = $szer_wys;
$st = imagesy($obraz) / $szer_wys;
$szerokosc = imagesx($obraz) / $st;
}
else
{
$szerokosc = $szer_wys;
#musimy obliczyc stosunek wiekszego obrazu do mniejszego - liczymy wysokosc
$st = imagesx($obraz) / $szer_wys;
$wysokosc = imagesy($obraz) / $st;
}
#do dziela - zmniejszamy
$mniejszy = imagecreatetruecolor($szerokosc,$wysokosc);
imagecopyresampled($mniejszy,$obraz,0,0,0,0,$szerokosc,$wysokosc,imagesx($obraz),imagesy($obraz));
#i zapisujemy...
imagejpeg($mniejszy, $wyjscie, 99);
#zwalniamy pamiec
imagedestroy($obraz);
imagedestroy($mniejszy);
}
?>

View File

@@ -5,7 +5,7 @@
* @version $Id$
**/
$page = (isset($_GET['page'])) ? intval($_GET['page']) : 0;
require_once('./init.php'); #init stuff
NaglowekXHTML();
@@ -49,7 +49,7 @@ NaglowekXHTML();
</div>
</div>
<div id="footer">
<a id="copyright">Copyright © 2009 ...</a><br />
<a id="copyright">Copyright © 2009 Various Authors</a><br />
<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="admin/">Administracja</a>
</div>

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 191 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 250 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 245 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 210 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 238 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 283 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 205 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 228 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 260 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 224 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 209 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 198 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 192 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 187 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 266 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 269 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 331 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 292 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 192 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

View File

@@ -22,7 +22,7 @@
</div>
</div>
<div id="footer">
<a id="copyright">Copyright © 2009 ...</a><br />
<a id="copyright">Copyright © 2009 Various Authors</a><br />
<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>
</div>

View File

@@ -37,7 +37,7 @@ ini_set('session.cookie_lifetime', 259200); #expire time - 1 month
session_start(); #starting session
if (empty($_SESSION['logged']))
{
$_SESSSION['logged'] = false;
$_SESSION['logged'] = false;
}
$DB = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME); #connect with the database
@@ -51,7 +51,7 @@ if (!$DB->query("SET NAMES 'utf8'")) #użyj utf-8
{
blad('Could not set character to UTF-8');
}
$page = (isset($_GET['page'])) ? intval($_GET['page']) : 1;
#pobierz liczbę zdjęć w galerii
$sql = "SELECT COUNT(`id`) AS `count` FROM `photos`";
@@ -63,28 +63,35 @@ if (!$result = $DB->query($sql))
$row = $result->fetch_assoc();
$count = $row['count'];
$result->free; //zwolnij pamięć
$result->free(); //zwolnij pamięć
if (!is_numeric($page))
{
blad('Podana strona nie istnieje!');
}
if ($page < 1)
{
blad('Podana strona nie istnieje!');
}
//
//wygeneruj strone
//
if (isset($_GET['page'])&&($_GET['page']!=1))
if ($page != 1)
{
if (!is_numeric($_GET['page']))
{
die('Hacking attempt');
}
$value = ($_GET['page']-1)*PERPAGE;
$value = ($page-1)*PERPAGE;
$limit = 'LIMIT '.$value . ', '.PERPAGE;
$page = $_GET['page'];
}
else
{
$limit = 'LIMIT 0, '.PERPAGE;
$page=1;
}
$cnt = ceil($count / PERPAGE);
if(isset($_GET['page']) && ($_GET['page']>$cnt))
$cnt = ($cnt == 0) ? 1 : $cnt;
if($page > $cnt)
{
blad('Podana strona nie istnieje!');
}