Mam drobny problem ze skryptem galerii. Skrypt nie jest mój,jednak na jego podstawie chcę budować dalsza część skryptu.
Skrypt ma za zadanie wczytać pliki graficzne. I wczytuje je jak należy. Problem zaczyna się gdy chce zmienić ścieżkę odczytu.
Oryginalnie skrypt wczytuje obrazki z katalogu głównego. Jedyna zmiana jaką wprowadziłem w skrypcie to właśnie ścieżka opendir.
Pliki oczywiście wczytuje,ale już nie wyświetla obrazków. Nie potrafię za bardzo sobie z tym poradzić

Jakieś wskazówki?
zawartość pliku galerii
<?php ?> <?php }?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <?php } else {?> <title>Quick Photo Gallery</title> <?php }?> </head> <body> class="img-responsive"> <?php }?> <?php if(!function_exists('get_file_extension')){ function get_file_extension($filename) { $exts = $exts[$n]; return $exts; } } /* This is the correct way to loop over the directory. */ echo '<div style="border:1px solid #EBEBEB; margin-right:10px; margin-bottom:10px; padding:5px; width:auto; display:block; float:left;"><a href="submitnews.php?big_image='.$file.'"><img border="0" src="image.php?file='.$file.' alt="'.$image_title.'" title="'.$image_title.'"/></a></div>'; } } } ?> <div style="clear:both;"> <p style="margin:0px; padding:3px; background-color:#FAFAFA; border:1px solid #EBEBEB; font-size:10px; font-family:Arial, Helvetica, sans-serif;">Script powered by thewebhelp.com <a style="color:#006699;" href="http://www.thewebhelp.com/php/quick_photo_gallery/">quick photo gallery</a>.</p> </div> </body> </html>
Do działania skryptu wykorzystywany jest tez plik images. Próbowałem tutaj zmienić oryginalne ściezki ale i to nic nie dało,dlatego wrzucam plik oryginalny
<?php ini_set("memory_limit", "200000000"); // for large images so that we do not get "Allowed memory exhausted"?> <?php $requested_width = $_REQUEST['width']; $requested_height = $_REQUEST['height']; } else { // if the original file is not there then stop everything and show a default thumb echo '<p>No "file" was defined in url.</p><p>Script powered by thewebhelp.com <a href="http://www.thewebhelp.com/php/quick_photo_gallery/">quick photo gallery</a>.</p>'; exit; } // if original image is bigger than requested then calculate proportions in order to scale it down $proportions = $original_width/$original_height; // show the image at the maximum height size but ... $new_height = $requested_height; // but ... if above calculated width is over the given limit then scal it down according to given width $new_width = $requested_width; } }else { $new_width = $original_width; $new_height = $original_height; // show original file without any resizing "image_cache/20.jpg" exit; } } // now that we know the resized file check to see if file already exists "image_cache/20_800x600.jpg" and load it, else create it below exit; } $file = $partial_name.'.jpg'; // set quality to 100 $quality= 100; } // get width and height of original image $original_width = $imagedata[0]; $original_height = $imagedata[1]; // if orignal image is smaller than 550px then do NOT increase its size to 550 if($original_width<$new_width){ $new_width = $original_width; } // calculating width or height if one was not defined // leave this one first $new_width = $original_width; $new_height = $original_height; } $new_height = $new_width*($original_height/$original_width); } $new_width = $new_height*($original_width/$original_height); } $smaller_image = imagecreatetruecolor($new_width, $new_height); $original_image = imagecreatefromjpeg($file); imagecopyresampled($smaller_image, $original_image, 0, 0, 0, 0, $new_width, $new_height, $imagedata[0], $imagedata[1]); // save the image if($new_width>140 and $new_height>100){ imagejpeg($smaller_image,'image_cache/'.$partial_name.'_'.$new_width.'x'.$new_height.'.jpg',$quality); } else { imagejpeg($smaller_image,'image_cache/'.$partial_name.'_'.$new_width.'x'.$new_height.'.jpg',$quality); } // make the image 644 (0644) chmod('image_cache/'.$partial_name.'_'.$new_width.'x'.$new_height.'.jpg',0644); imagedestroy($original_image); imagedestroy($smaller_image); imagedestroy($watermarked_image); // read the new image exit; ?>