Skip to content

Display all images, video, audio files in a folder onto one html page

License

Notifications You must be signed in to change notification settings

dvdn/show-all-media-in-a-folder-with-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Show all media in a folder with PHP

A simple webpage to display all images, video and audio files in a folder with PHP.

Large images will be displayed smaller than their original dimensions.

Video and Audio files will display HTML5 controls and can be played by HTML5 player.

You can specify how many media you want to display per pages.

See Demo

Setup

The easy way

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

The other way

Copy 'inc' folder inc in your root folder (or wherever your index file is).

In your index page :

in the head

<!-- style for media insertion -->
<link rel="stylesheet" type="text/css" href="inc/ins-media.css">

in the body

<!-- media insertion -->
<?php include "ins-media.php"; ?>

Settings

Adapt values in config.php according to your needs.

*   folderPath : path to media folder,
*   types : which Media file types will be displayed,
*   sortByName : to sort by name. Default false, Media will be sorted by last modified date,
*   reverseOrder : to invert sort order, if 'true'
*                   if sorted by date, ordered by newests Media (uses EXIF data if possible),
*                   if sorted by name order is naturally inverted,
*   dateFormat : date format in label (http://php.net/manual/en/function.date.php)
*   usePagination : true/false,
*   mediaPerPage : number of Media per pages if usePagination true

Origin

This project is an evolution of https://github.com/dvdn/show-all-images-in-a-folder-with-php.

Features addition :

  • support for Audio and Video files

Contributions

Very welcomed.

About

Display all images, video, audio files in a folder onto one html page

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published