GithubHelp home page GithubHelp logo

tennisfar / show-all-images-in-a-folder-with-php Goto Github PK

View Code? Open in Web Editor NEW
55.0 4.0 21.0 6.62 MB

Show all images in a folder with PHP. A simple PHP tool to list all images in a folder.

HTML 13.44% CSS 18.30% PHP 68.27%
php photo-gallery

show-all-images-in-a-folder-with-php's Introduction

Show all images in a folder with PHP

A simple webpage to display all images in a folder. It requires PHP.

Images will display up to a max width of 900 pixels. Images larger than 900 pixels will show their full size if you click it.

You can link to a specific image as they're link anchored. Just click on the specific image and copy the browser URL.

Demo

Setup

The easy way

This works out of the box, so you can either Git clone the repository, or download the zip.

The other way

Add ins-imgs.php and ins-imgs.css in your root folder (or wherever your index file is).

In your index HTML, insert this:

<!-- insert images here -->
<script src="ins-imgs.php"></script>

Settings

In ins-imgs.php you can find the following settings:

    # Path to image folder
    $imageFolder = 'img/';

    # Show only these file types from the image folder
    $imageTypes = '{*.jpg,*.JPG,*.jpeg,*.JPEG,*.png,*.PNG,*.gif,*.GIF}';

    # Set to true if you prefer sorting images by name
    # If set to false, images will be sorted by date
    $sortByImageName = false;

    # Set to false if you want the oldest images to appear first
    # This is only used if images are sorted by date (see above)
    $newestImagesFirst = true;

Make the changes needed for your setup.

Help, bugs, pull requests, etc.

Very welcomed.

Customized implementations

Easy Folio (Demo) by Lukas Spieker

show-all-images-in-a-folder-with-php's People

Contributors

gitter-badger avatar slowzone avatar tennisfar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

show-all-images-in-a-folder-with-php's Issues

display images in a table?

Is it possible to display the images in a table? By changing the display size of the images, means you can fit more on a page, but if you have a larger selection of images, it would be more efficient to display them in a table.

XSS sanitization?

I noticed that you could just put a piece of code as the name (on linux of course) and it would automatically execute. No tricks needed. Is there any simple sanitation that I could use? like replace < and > with _

Display only a certain amount of pictures per page

Hi,

this is not an issue! Your app is amazing, thanks for sharing this!
Is there a way to set the amount of picutures showen per page?
For example:
exmaple.com/pictures&amount=10

Or that the script it self only display 10 in a row and adds a button to display 10 more.
Something like that would be awesome!

Thanks for reading, i hope you understand my thoughts:)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.