You have defenitely seen a “look at my nice images” page where initially all that you can see, is a punch of links to image files. Somebody was wise enough to load images into webserver but was unable to create a gallery of them. Or perhaps you have some limited access to internet and computational power (over mobilephone?) and want to share few pictures but you are just not ready to create index.html with 20 lines there.
Here is solution. I created few versions of “PHP one line galleries” – just copy-paste code into .php file and let code does everything else. No need to “write permission”!
Shortest gallery
<head><title>PHP One Line Gallery</title></head><body><?php /* PHP One Line Gallery, shortest version. by UR, 2013 */$ext_arr=array('.jpg', '.gif', '.png');$files=scandir('.'); foreach($files as $file){ if(in_array(strtolower(substr($file, strrpos($file, '.'))), $ext_arr)){ echo $file.':<br/><img src="'.$file.'" title="'.$file.'" style="max-width: 100%;"/><br/>'; }}?></body>
Pros:
* very short code, easy to copy-paste
* no CPU-intensive on serverside
* shows full images in raw, css scaling to 100% of width
Cons:
* Don’t use it in directory where are lot of files and those files are big. All those images will be loaded into browser! Will eat all your computer’s free memory and CPU time
Short gallery
COMING SOON
Pros:
* Thumbnails will be shown instead of large images
* each original image will be displayed on separate page
* links to files (thumb, original) are secured with md5
Cons:
* Bit longer code
* Will be CPU intensive on serverside if lot of (big) images are going to be loaded
Larger gallery
Development not yet started
Pros:
* Thumbnails will be shown instead of large images
* Pagination
* Easier navigation if watching original files
Cons:
* Longer code (but still copy-pasteable)
* Will be CPU intensive on serverside if lot of (big) images are going to be loaded
Installation
a) Copy-paste code into file which is located at your images directory in your webserver. Save file. Open it over webserver in your browser.
b) COMING SOON: navigate to your images directory and directly download gallery file. Open it over webserver in your browser.
Greetings! I know this is kind of off topic but I was wondering if you knew where I could find a captcha plugin for my comment form?
I’m using the same blog platform as yours and I’m having
trouble finding one? Thanks a lot!
I’m using this: http://wordpress.org/plugins/captcha/
but there’s a lot more to try