+ Post New Thread
Results 1 to 9 of 9
Web Development Thread, website Slideshow in Coding and Web Development; Ok Here is the issue. I have a folder the photos are put into and taken out of. this folder ...
  1. #1
    alonebfg's Avatar
    Join Date
    Aug 2006
    Location
    south west some of the time
    Posts
    834
    Thank Post
    12
    Thanked 34 Times in 21 Posts
    Blog Entries
    5
    Rep Power
    24

    website Slideshow

    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.

  2. #2
    SneakyBeaky's Avatar
    Join Date
    May 2010
    Location
    Gosport
    Posts
    141
    Thank Post
    7
    Thanked 22 Times in 19 Posts
    Rep Power
    15
    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.

  3. #3

    Join Date
    Apr 2010
    Posts
    2,032
    Thank Post
    82
    Thanked 187 Times in 154 Posts
    Rep Power
    83
    Google picasa with Google sites does this and you could probably just use the code created on Google sites in any website.

  4. #4
    alonebfg's Avatar
    Join Date
    Aug 2006
    Location
    south west some of the time
    Posts
    834
    Thank Post
    12
    Thanked 34 Times in 21 Posts
    Blog Entries
    5
    Rep Power
    24
    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

  5. #5
    thesk8rjesus's Avatar
    Join Date
    Sep 2008
    Posts
    107
    Thank Post
    11
    Thanked 6 Times in 6 Posts
    Rep Power
    13
    Do you have php installed on the server?

  6. #6
    box_l's Avatar
    Join Date
    May 2007
    Location
    Herefordshire
    Posts
    427
    Thank Post
    68
    Thanked 90 Times in 75 Posts
    Rep Power
    61
    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

  7. #7
    thesk8rjesus's Avatar
    Join Date
    Sep 2008
    Posts
    107
    Thank Post
    11
    Thanked 6 Times in 6 Posts
    Rep Power
    13

    Post

    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.

    Code:
    <?php
    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 .= '<img src="' . str_replace( $serverPath, '', $filename ) . '" alt="' . str_replace( $serverPath . $path, '', $filename ) . '">';
    	}
    	
    	return $data;
    }
    ?>
    Below is the example html code with nivo-slider and a refresh every 6 hours

    Code:
    <head>
    	<link rel="stylesheet" type="text/css" href="/css/themes/default/default.css" media="screen" />
    	<link rel="stylesheet" type="text/css" href="/css/themes/light/light.css" media="screen" />
    	<link rel="stylesheet" type="text/css" href="/css/themes/dark/dark.css" media="screen" />
    	<link rel="stylesheet" type="text/css" href="/css/themes/bar/bar.css" media="screen" />
    	<link rel="stylesheet" type="text/css" href="/css/nivo-slider.css" media="screen" />
    	<meta http-equiv="refresh" content="21600">
    </head>
    
    <body>
    	<div id="slideshow" class="slider-wrapper theme-default">
    		<div id="slider" class="nivoSlider">
    			<?php echo slideshow(); ?>
    		</div>
    	</div>
    	<script type="text/javascript" src="/scripts/jquery-1.7.1.min.js"></script>
    	<script type="text/javascript" src="/scripts/jquery.nivo.slider.js"></script>
    	<script type="text/javascript">
    		$(window).load(function()
    		{
    			$('#slider').nivoSlider();
    		});
    	</script>
    </body>
    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/
    Last edited by thesk8rjesus; 12th July 2013 at 05:29 PM.

  8. #8
    thesk8rjesus's Avatar
    Join Date
    Sep 2008
    Posts
    107
    Thank Post
    11
    Thanked 6 Times in 6 Posts
    Rep Power
    13
    UPDATE: Removed $serverPath and replaced it with $root as both the same.

    Code:
    <?php
    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 .= '<img src="' . str_replace( $root, '', $filename ) . '" alt="' . str_replace( $root . $path, '', $filename ) . '">';
    	}
    	
    	return $data;
    }
    ?>

  9. #9

    CESIL's Avatar
    Join Date
    Nov 2006
    Location
    Hampshire
    Posts
    1,403
    Thank Post
    109
    Thanked 267 Times in 198 Posts
    Rep Power
    168
    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.

SHARE:
+ Post New Thread

Similar Threads

  1. [Website] How NOT to design a website...
    By Gatt in forum Jokes/Interweb Things
    Replies: 67
    Last Post: 26th April 2012, 10:03 AM
  2. Photo slideshow for website homepage
    By zx2012 in forum AV and Multimedia Related
    Replies: 6
    Last Post: 21st March 2012, 01:53 PM
  3. [Website] Cool website
    By NikChillin in forum Jokes/Interweb Things
    Replies: 1
    Last Post: 26th January 2010, 03:33 PM
  4. [Website] Examples Of Notes Left For The Milkman [Website Claims They Are Genuine]
    By DaveP in forum Jokes/Interweb Things
    Replies: 1
    Last Post: 13th August 2009, 11:58 AM
  5. [Website] Govt, uni and school websites insecure
    By localzuk in forum Jokes/Interweb Things
    Replies: 3
    Last Post: 10th June 2009, 01:18 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •