| | |
| Stránka: 1 z 1
| [ Príspevkov: 7 ] | |
Autor | Správa |
---|
Registrovaný: 08.12.07 Prihlásený: 25.07.12 Príspevky: 87 Témy: 14 |
Stiahol som si script pre obrazkovu galeriu ale nefunguje ako ma. Vzdy ked chcem aby presiel na dalsi obrazok tak sa url zmeni podla scriptu (napr. http://www.l4me.org/loner_invasion.php?p=9 pre obrazok cislo 9 (ale stranka nacita zasa prvy obrazok. Precital som si diskusiu k scriptu a prisiel som na to ze problem je vo verzii PHP. Script vraj nefunguje s verziou 5. Neviem ci sa to da opravit ale ocenil by som keby sa na to niekto pozrel a povedal mi ci sa to da zmenit.
Kód: <?php // ------------------------------------------------------------------------- // // Comic Gallery 1.2 // // ------------------------------------------------------------------------- // // Copyright (C) 2005 Stuart Robertson // // http://www.designmeme.com/ // // ------------------------------------------------------------------------- // // This program is free software; you can redistribute it and/or modify // // it under the terms of the GNU General Public License as published by // // the Free Software Foundation; either version 2 of the License, or // // (at your option) any later version. // // A summary is available at http://creativecommons.org/licenses/GPL/2.0/ // // ------------------------------------------------------------------------- // // Edit the code below to configure your Comic Gallery // // ------------------------------------------------------------------------- //
// Your images directory, relative to the page calling this script $imagedir="img/content/loner/invasion";
// To start at the last image use "last" $startimage="first";
// Copyright name to display, for none use " " $copyright=" ";
// Creative Commons license, for none use " " // example: "http://creativecommons.org/licenses/by/2.0/" $creativecommons=" ";
// type of divider, for none use " " $divider="·";
// show arrows, for none use 0 $arrows=1;
// show back and next, for none use 0 $backnext=1;
// show back and next, for none use 0 $firstlast=1;
// show numbers, for none use 0 $numbers=1;
// numbers per line $linelength=20;
// navigation position, for aboe use "above" $navplacement="below";
// ------------------------------------------------------------------------- // // Do not edit below this line // ------------------------------------------------------------------------- //
// initialize variables $pics=array(); $count=0;
// Open the directory $comicdir=opendir($imagedir);
// read directory into pics array while (($file = readdir($comicdir))!==false) { // filter for jpg, gif or png files... if (substr($file,-4) == ".jpg" || substr($file,-4) == ".gif" || substr($file,-4) == ".png" || substr($file,-4) == ".JPG" || substr($file,-4) == ".GIF" || substr($file,-4) == ".PNG"){ $pics[$count] = $file; $count++; } } closedir($comicdir);
// check for the picture to view $pic=$HTTP_GET_VARS['p']; // if no picture variable... if ($pic=="") { if ($startimage!="last"){ $pic=1; } else { $pic=$count; } }
// sort the filenames alphabetically sort($pics); reset($pics);
// determine which picture to get for ($f=0;$f<=sizeof($pics)-1;$f++){if ($pic==$pics[$f]){$selected = $f+1;}}
// check for javascript... if ($pic && !preg_match("/javascript/",$pic)){
// get current image file $current=$pics[$pic-1]; $next=$pic+1; if ($next > sizeof($pics)){ $next=sizeof($pics); } $back=$pic-1; if ($back < 1){ $back=1; } // display image above nav if ($navplacement!="above"){ if (substr($current,-4) == ".jpg" || substr($current,-4) == ".gif" || substr($current,-4) == ".png" || substr($current,-4) == ".JPG" || substr($current,-4) == ".GIF" || substr($current,-4) == ".PNG"){ if ($pic < sizeof($pics)){ echo"\n<p id=\"cg_img\"><a href=\"?p=".$next."\"><img src=\"".$imagedir."/".$current."\" alt=\"Next\" /></a></p>\n"; } else { echo"\n<p id=\"cg_img\"><img src=\"".$imagedir."/".$current."\" alt=\"End\" /></p>\n"; } } }
// display back and next if ($backnext != 0 || $arrows != 0){ if (sizeof($pics) > 1){ echo "<p id=\"cg_nav1\">"; if ($firstlast != 0){ if ($pic > 1){ echo "<a href=\"?p=1\" id=\"cg_first\"><span>First</span></a>"; } else { echo "<span id=\"cg_first\"><span>First</span></span>"; } echo "<span class=\"cg_divider\"> ".$divider." </span>"; } if ($pic > 1){ echo "<a href=\"?p=".$back."\" id=\"cg_back\"><span>"; if ($arrows != 0) { echo "« "; } if ($backnext != 0) { echo "Back"; } echo "</span></a>"; } else { echo "<span id=\"cg_back\"><span>"; if ($arrows != 0) { echo "« "; } if ($backnext != 0) { echo "Back"; } echo "</span></span>"; } echo "<span class=\"cg_divider\"> ".$divider." </span>"; if ($pic < sizeof($pics)){ echo "<a href=\"?p=".$next."\" id=\"cg_next\"><span>"; if ($backnext != 0) { echo "Next"; } if ($arrows != 0) { echo " »"; } echo "</span></a>"; } else { echo "<span id=\"cg_next\"><span>"; if ($backnext != 0) { echo "Next"; } if ($arrows != 0) { echo " »"; } echo "</span></span>"; } if ($firstlast != 0){ echo "<span class=\"cg_divider\"> ".$divider." </span>"; if ($pic < sizeof($pics)){ echo "<a href=\"?p=". sizeof($pics) ."\" id=\"cg_last\"><span>Last</span></a>"; } else { echo "<span id=\"cg_last\"><span>Last</span></span>"; } } echo "</p>\n"; echo "<br>\n"; } } // display numbers if ($numbers != 0){ if (sizeof($pics) > 1){ // display textlinks echo "<p id=\"cg_nav2\">"; // loop over images for ($f=1;$f<=sizeof($pics);$f++){ // if the link to the pic is the selected one, display a bold number and no link if ($pic==$f){echo "<b>".$f."</b>";} // otherwise display the link else{echo "<a href=\"?p=".$f."\">".$f."</a>";} // add dividers and linebreaks if (($f % $linelength) == 0) { echo "<br />"; } else { if ($f!=sizeof($pics)){ echo "<span class=\"cg_divider\"> ".$divider." </span>"; } } } echo "</p>\n"; } } // display image below nav if ($navplacement=="above"){ if (substr($current,-4) == ".jpg" || substr($current,-4) == ".gif" || substr($current,-4) == ".png" || substr($current,-4) == ".JPG" || substr($current,-4) == ".GIF" || substr($current,-4) == ".PNG"){ if ($pic < sizeof($pics)){ echo"\n<p id=\"cg_img\"><a href=\"?p=".$next."\"><image src=\"".$imagedir."/".$current."\" alt=\"Next\" border=\"0\"></a></p>\n"; } else { echo"\n<p id=\"cg_img\"><image src=\"".$imagedir."/".$current."\" alt=\"End\" /></p>\n"; } } } // display copyright echo "<p class=\"small\">"; if ($creativecommons != " "){ echo "<a href=\"".$creativecommons."\" title=\"Creative Commons License\">Some Rights Reserved</a> ".$divider." "; } else { if ($copyright != " "){ echo "© ".$copyright." ".$divider." "; } } // If you make use of this script, be nice and keep the link back to my site :-) echo "Powered by <a href=\"http://www.designmeme.com/comicgallery/\">ComicGallery v1.2</a></p>\n"; } ?>
|
|
Registrovaný: 20.11.07 Prihlásený: 18.01.09 Príspevky: 2929 Témy: 116 | Napísal dadmtb: 01.10.2008 21:17 | |
|
neviem sice pomoct ale nechces radsej vyskusat lightbox?
|
|
Registrovaný: 08.12.07 Prihlásený: 25.07.12 Príspevky: 87 Témy: 14 | Napísal autor témy erkakbe: 01.10.2008 21:21 | |
|
nechcel som skusat nic nove lebo som to uz cele nastavil a dufal som ze pride niekto kto opravi jeden riadok a zacne to fungovat : ) ale daj link
|
|
Registrovaný: 17.10.06 Prihlásený: 08.01.11 Príspevky: 1752 Témy: 17 | Napísal suchy: 01.10.2008 21:26 | |
|
_________________ A Real Programmer might or might not know his wife's name. He does, however, know the entire ASCII code table. |
|
Registrovaný: 08.12.07 Prihlásený: 25.07.12 Príspevky: 87 Témy: 14 | Napísal autor témy erkakbe: 01.10.2008 21:31 | |
|
*owned by google* ja som si to samozrejme uz nasiel ta posledna veta bola skor fraza vyjadrujuca ze napriek nevoli to vyskusam...tever
|
|
Registrovaný: 27.07.07 Príspevky: 3948 Témy: 51 Bydlisko: Bratislava |
nahrad si tento riadok:
Kód: $pic=$HTTP_GET_VARS['p']; tymto: Kód: $pic=$_GET['p'];
a bude ti to fungovat... jednoduche, nie?
_________________ NTB: Acer Aspire 4820TG 14" | CPU: Intel Core i5 2,53 GHz | VGA: ATI Mobility Radeon HD5650 1GB | RAM: 8GB DDR3 1066 MHz | HDD: 1TB SSD WD BLUE |
|
Registrovaný: 08.12.07 Prihlásený: 25.07.12 Príspevky: 87 Témy: 14 | Napísal autor témy erkakbe: 01.10.2008 22:18 | |
|
woohooo presne v toto som dufal : ) diky =)
|
|
| Stránka: 1 z 1
| [ Príspevkov: 7 ] | |
Podobné témy | Témy | Odpovede | Zobrazenia | Posledný príspevok |
---|
| PHP login script v PHP, ASP | 7 | 3413 | 08.02.2010 8:42 juho | | Php galeria hladam script v PHP, ASP | 0 | 302 | 17.02.2013 1:09 onkel1 | | Image Upload PHP script v PHP, ASP | 0 | 1768 | 30.09.2005 23:01 JanoF | | java script v php-fusion v Redakčné systémy | 0 | 486 | 10.03.2007 23:07 Sony | | php script na zistenie zapnutia javascriptu v PHP, ASP | 18 | 1816 | 10.07.2008 9:56 GoodWill | | Hladam programatora (php, MySQL, html, java script) v Ponuka práce | 2 | 1494 | 29.01.2008 8:21 mond | | Na webe nefunkčný php kód v PHP, ASP | 4 | 504 | 28.02.2011 21:52 masliak | | Hladam programatora + kodera (php, MySQL, html, java script) v Ponuka práce | 1 | 990 | 18.01.2008 14:12 Flety | | Hladam zdatneho PHP/JS/AJAX... kodera pre komunikacny script v Ponuka práce | 1 | 1041 | 20.09.2008 18:53 Hack2er | | Nefunkčný formulár keď includnem header.inc.php v PHP, ASP | 4 | 470 | 10.08.2011 15:24 kapo | | ako spustit pomocou cron PHP script aj s predanou premennou? v PHP, ASP | 3 | 764 | 04.08.2010 9:13 pohoda | | Php Script: XML -> CSV (Problém s 0 na začiatku) v PHP, ASP | 5 | 393 | 21.11.2017 19:56 BX | | "roletka" , ako na prislušný script v php v HTML, XHTML, XML, CSS | 7 | 780 | 21.11.2007 22:06 johny128 | | l0vel gallery v Webdesign | 10 | 697 | 10.03.2009 5:46 lio | | Gallery 2 v Redakčné systémy | 1 | 746 | 22.03.2008 11:15 Numline1 | | Gallery 2 v Redakčné systémy | 0 | 819 | 02.12.2008 13:13 suttik |
| Nemôžete zakladať nové témy v tomto fóre Nemôžete odpovedať na témy v tomto fóre Nemôžete upravovať svoje príspevky v tomto fóre Nemôžete mazať svoje príspevky v tomto fóre
|
|