From e32992fa40e1c913769cdda406c2cd7aed50d92c Mon Sep 17 00:00:00 2001 From: pioder Date: Sun, 22 Jan 2012 16:14:11 +0000 Subject: [PATCH] =?UTF-8?q?Poprawki=20w=20paginacji=20zdj=C4=99=C4=87.=20Z?= =?UTF-8?q?miana=20funkcji=20z=20imagecopyresized()=20na=20imagecopyresamp?= =?UTF-8?q?led()=20do=20zmiany=20rozmiaru=20obrazk=C3=B3w.=20Inne=20drobne?= =?UTF-8?q?=20poprawki?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://svn.pioder.pl/sg-svn@24 3ed2631f-fe0d-47e0-9194-a46bc0f18ee8 --- robocze/download.php | 17 +++-- robocze/dump.txt | 51 ++++++++++----- robocze/functions.php | 81 +++++++++++++++++++++--- robocze/gallery.php | 4 +- robocze/images/{hasło.png => haslo.png} | Bin robocze/images/upload/07062009544.jpg | Bin 0 -> 195633 bytes robocze/images/upload/07062009544_m.jpg | Bin 0 -> 22646 bytes robocze/images/upload/07062009548.jpg | Bin 0 -> 256408 bytes robocze/images/upload/07062009548_m.jpg | Bin 0 -> 26009 bytes robocze/images/upload/07062009549.jpg | Bin 0 -> 251305 bytes robocze/images/upload/07062009549_m.jpg | Bin 0 -> 26920 bytes robocze/images/upload/07062009550.jpg | Bin 0 -> 214799 bytes robocze/images/upload/07062009550_m.jpg | Bin 0 -> 25852 bytes robocze/images/upload/07062009553.jpg | Bin 0 -> 211121 bytes robocze/images/upload/07062009553_m.jpg | Bin 0 -> 24908 bytes robocze/images/upload/07062009557.jpg | Bin 0 -> 243228 bytes robocze/images/upload/07062009557_m.jpg | Bin 0 -> 26227 bytes robocze/images/upload/07062009560.jpg | Bin 0 -> 289853 bytes robocze/images/upload/07062009560_m.jpg | Bin 0 -> 29502 bytes robocze/images/upload/07062009561.jpg | Bin 0 -> 210112 bytes robocze/images/upload/07062009561_m.jpg | Bin 0 -> 23248 bytes robocze/images/upload/07062009563.jpg | Bin 0 -> 233342 bytes robocze/images/upload/07062009563_m.jpg | Bin 0 -> 24574 bytes robocze/images/upload/07062009565.jpg | Bin 0 -> 266379 bytes robocze/images/upload/07062009565_m.jpg | Bin 0 -> 29982 bytes robocze/images/upload/07062009566.jpg | Bin 0 -> 229737 bytes robocze/images/upload/07062009566_m.jpg | Bin 0 -> 25145 bytes robocze/images/upload/07062009567.jpg | Bin 0 -> 213842 bytes robocze/images/upload/07062009567_m.jpg | Bin 0 -> 26481 bytes robocze/images/upload/07062009569.jpg | Bin 0 -> 202290 bytes robocze/images/upload/07062009569_m.jpg | Bin 0 -> 21469 bytes robocze/images/upload/07062009570.jpg | Bin 0 -> 197166 bytes robocze/images/upload/07062009570_m.jpg | Bin 0 -> 21953 bytes robocze/images/upload/07062009571.jpg | Bin 0 -> 191205 bytes robocze/images/upload/07062009571_m.jpg | Bin 0 -> 21531 bytes robocze/images/upload/08062009624.jpg | Bin 0 -> 272287 bytes robocze/images/upload/08062009624_m.jpg | Bin 0 -> 30665 bytes robocze/images/upload/08062009625.jpg | Bin 0 -> 275443 bytes robocze/images/upload/08062009625_m.jpg | Bin 0 -> 30562 bytes robocze/images/upload/08062009629.jpg | Bin 0 -> 203846 bytes robocze/images/upload/08062009629_m.jpg | Bin 0 -> 21925 bytes robocze/images/upload/08062009630.jpg | Bin 0 -> 338831 bytes robocze/images/upload/08062009630_m.jpg | Bin 0 -> 34367 bytes robocze/images/upload/08062009632.jpg | Bin 0 -> 299219 bytes robocze/images/upload/08062009632_m.jpg | Bin 0 -> 30931 bytes robocze/images/upload/dsc_0006.jpg | Bin 0 -> 196669 bytes robocze/images/upload/dsc_0006_m.jpg | Bin 0 -> 26401 bytes robocze/index.php | 62 +++++++++--------- robocze/init.php | 31 +++++---- 49 files changed, 171 insertions(+), 75 deletions(-) rename robocze/images/{hasło.png => haslo.png} (100%) create mode 100644 robocze/images/upload/07062009544.jpg create mode 100644 robocze/images/upload/07062009544_m.jpg create mode 100644 robocze/images/upload/07062009548.jpg create mode 100644 robocze/images/upload/07062009548_m.jpg create mode 100644 robocze/images/upload/07062009549.jpg create mode 100644 robocze/images/upload/07062009549_m.jpg create mode 100644 robocze/images/upload/07062009550.jpg create mode 100644 robocze/images/upload/07062009550_m.jpg create mode 100644 robocze/images/upload/07062009553.jpg create mode 100644 robocze/images/upload/07062009553_m.jpg create mode 100644 robocze/images/upload/07062009557.jpg create mode 100644 robocze/images/upload/07062009557_m.jpg create mode 100644 robocze/images/upload/07062009560.jpg create mode 100644 robocze/images/upload/07062009560_m.jpg create mode 100644 robocze/images/upload/07062009561.jpg create mode 100644 robocze/images/upload/07062009561_m.jpg create mode 100644 robocze/images/upload/07062009563.jpg create mode 100644 robocze/images/upload/07062009563_m.jpg create mode 100644 robocze/images/upload/07062009565.jpg create mode 100644 robocze/images/upload/07062009565_m.jpg create mode 100644 robocze/images/upload/07062009566.jpg create mode 100644 robocze/images/upload/07062009566_m.jpg create mode 100644 robocze/images/upload/07062009567.jpg create mode 100644 robocze/images/upload/07062009567_m.jpg create mode 100644 robocze/images/upload/07062009569.jpg create mode 100644 robocze/images/upload/07062009569_m.jpg create mode 100644 robocze/images/upload/07062009570.jpg create mode 100644 robocze/images/upload/07062009570_m.jpg create mode 100644 robocze/images/upload/07062009571.jpg create mode 100644 robocze/images/upload/07062009571_m.jpg create mode 100644 robocze/images/upload/08062009624.jpg create mode 100644 robocze/images/upload/08062009624_m.jpg create mode 100644 robocze/images/upload/08062009625.jpg create mode 100644 robocze/images/upload/08062009625_m.jpg create mode 100644 robocze/images/upload/08062009629.jpg create mode 100644 robocze/images/upload/08062009629_m.jpg create mode 100644 robocze/images/upload/08062009630.jpg create mode 100644 robocze/images/upload/08062009630_m.jpg create mode 100644 robocze/images/upload/08062009632.jpg create mode 100644 robocze/images/upload/08062009632_m.jpg create mode 100644 robocze/images/upload/dsc_0006.jpg create mode 100644 robocze/images/upload/dsc_0006_m.jpg diff --git a/robocze/download.php b/robocze/download.php index a6b7f2b..f0390f7 100644 --- a/robocze/download.php +++ b/robocze/download.php @@ -1,5 +1,12 @@ @@ -26,17 +33,17 @@ http://rapidshare.com/files/243914577/ZDJECIA.7z.007
http://rapidshare.com/files/243926118/ZDJECIA.7z.008
- Has__o: + Hasło:
- Has__o: Sucava2009 + Hasło: Sucava2009
diff --git a/robocze/dump.txt b/robocze/dump.txt index abef446..dc86020 100644 --- a/robocze/dump.txt +++ b/robocze/dump.txt @@ -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', '', ''); diff --git a/robocze/functions.php b/robocze/functions.php index a692220..418b5d4 100644 --- a/robocze/functions.php +++ b/robocze/functions.php @@ -30,7 +30,7 @@ function NaglowekXHTML() echo ''; } -function GenerujListeStron() +function GenerujListeStron($adm = false) { global $cnt; global $page; @@ -38,8 +38,16 @@ function GenerujListeStron() if ($page>1) { - $content .= '«'; - $content .= '  < '; + if ($adm) + { + $content .= '«'; + $content .= '  < '; + } + else + { + $content .= '«'; + $content .= '  < '; + } } #wygeneruj strony @@ -60,19 +68,41 @@ function GenerujListeStron() { if ($i == $cnt) { - $content .= ''.$i.' '; + if ($adm) + { + $content .= ''.$i.' '; + } + else + { + $content .= ''.$i.' '; + } } else { - $content .= ''.$i.' | '; + if ($adm) + { + $content .= ''.$i.' | '; + } + else + { + $content .= ''.$i.' | '; + } } } } #dodaj linka "+1 strona" oraz do ostatniej if ($page<$cnt) { - $content .= '>'; - $content .= '  »'; + if ($adm) + { + $content .= '>'; + $content .= '  »'; + } + else + { + $content .= '>'; + $content .= '  »'; + } } #dodaj linka do ostatniej strony @@ -110,7 +140,7 @@ function NaglowekPA($nazwapodstrony) .b { background-color: #666666; color: white; border: 1px; } - +

Panel Administracyjny Galerii Zdjęć

@@ -126,12 +156,43 @@ function NaglowekPA($nazwapodstrony) } function StopkaPA() { - echo ' - ACP by PioDer © 2009 + echo '

+ ACP by PioDer © 2009-2012
'; } + +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); +} ?> diff --git a/robocze/gallery.php b/robocze/gallery.php index 89068a2..7eced9d 100644 --- a/robocze/gallery.php +++ b/robocze/gallery.php @@ -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();