Jump to content

Recommended Posts

Posted
Ok Here is the issue. I have a folder the photos are put into and taken out of. this folder syncs with a web folder. What I want to do is create a webpage that takes the photos in the folder and displays them as a slideshow. I can do this manually but when the photos get changed weekly it becomes a bit of a nightmare I am not the best at coding I know basic php and a little java. even if there was a script that i could get to run nightly to rename old and new photos to add them to slidshow. any ideas would be good.
Posted

I don't think there is a way for a webpage to read a set of filenames on the server but you could set up the slideshow to use specific file names i.e slide1 slide2 slide3 etc.

Then simply replace the slides with new ones using the same names.

Posted
the problem is we just need it local as its part of our digital display we did use powerpoint but it like to crash a lot. so I have been doing it via a webpage. I may have to look at the auto rename just its a lot of work for me every time a picture is changed
  • 1 month later...
Posted

I link to a webpage slideshow using this.

 

PHP Photo browser and x-fading slideshow script

 

It looks greate embedded in Xibo.

 

I just chuck images in the folder, it does not seem to care what they are called.

 

Every time xibo refreshes the region it reloads and includes the new images.

 

Dont try to edit the generated php file, just seems to break it. Go to the website to generate a new one. Here

 

BoX

Posted (edited)

I had a quick look around and have written the following PHP function that will look in a specified folder and then add an img tag for each image to a variable which is then returned at the end of the function.

 

function slideshow()
{
//creating variables
$data = '';
$root = $_SERVER['DOCUMENT_ROOT'];
$path = '/images/slideshow/';
$fileTypes = '*.{jpg,png,bmp,gif}';
$serverPath = 'C:\inetpub\wwwroot';

//adding the images to the data variable
foreach( glob( $root . $path . $fileTypes, GLOB_BRACE ) as $filename )
{
	$data .= '' . str_replace( $serverPath, '', $filename ) . '';
}

return $data;
}
?>

 

Below is the example html code with nivo-slider and a refresh every 6 hours

 












	
		
	



<br />
		$(window).load(function()<br />
		{<br />
			$('#slider').nivoSlider();<br />
		});<br />
	

 

Please let me know if I have confused you I'm not brilliant with english.

 

EDIT: Here is the link to the Nivo Slider website http://dev7studios.com/nivo-slider/

Edited by thesk8rjesus
Posted

UPDATE: Removed $serverPath and replaced it with $root as both the same.

 

function slideshow()
{
//creating variables
$data = '';
$root = $_SERVER['DOCUMENT_ROOT'];
$path = '/images/slideshow/';
$fileTypes = '*.{jpg,png,bmp,gif}';

//adding the images to the data variable
foreach( glob( $root . $path . $fileTypes, GLOB_BRACE ) as $filename )
{
	$data .= '' . str_replace( $root, '', $filename ) . '';
}

return $data;
}
?>

Posted

I use a similar script to the one thesk8rjesus suggests to do slideshows and to automatically build file lists for things like policy documents on our website.

 

If you want to only show newer photos then you could add a date check and return only images with a newer date than your limit.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...