Creative COW SIGN IN :: SPONSORS :: ADVERTISING :: ABOUT US :: CONTACT US
Creative COW's LinkedIn GroupCreative COW's Facebook PageCreative COW on TwitterCreative COW's Google+ PageCreative COW on YouTube
ADOBE DREAMWEAVER:HomeDreamweaver ForumDreamweaver TutorialsFAQAdobe FlashWeb Design

External Pictures Load

COW Forums : Adobe Dreamweaver

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Share on Facebook
Raymond TuqueroExternal Pictures Load
by on Dec 4, 2008 at 3:54:44 am

Hello,

I was wondering about a simple way of showing pictures in an iFrame from pictures in an asset folder. More specifically ... I am trying to build a page where there is only a [NEXT] butto, a [PREVIOUS] button and an iFrame. And they show the JPEG contents of a targeted folder.

Reason for this idea, is a simple way of just loading pictures into a folder on the server and not have to create thumbnails and more code in dreamweaver.

Any help is appreciated.

Thanks.

-Raymond-


Return to posts index
Reply   Like  

Abraham ChaffinRe: External Pictures Load
by on Dec 4, 2008 at 5:32:36 pm

If you want to use a PHP script to display your images out of a single folder - here's one that I quickly wrote for you. Let me know if you have any questions about it. Whatever you name this file should have a .php at the end of it so that the php executes properly on the web server.:



<?
////////////////////////////////////////////////////////////////
////////THIS IS A PHP GALLERY SCRIPT FOR A SINGLE FOLDER////////
///////custimize by changing the top three variables////////////
//and the bottom display values - nothing else needs to change//
////////////////////////////////////////////////////////////////

//This can also be an absolute path e.g. /var/www/yourwebsite/htdocs/images
$your_image_directory="images";
//the url of the images folder
$absolute_path_of_directory="http://www.whatever.com/images";
//whatever you name this file
$name_of_this_file="myimages.php";



//opens the directory
$dir = opendir($your_image_directory);
//will store the files in the directory
$files = array();
//looks through the folder
while(($file = readdir($dir)) !== false){
//if we found a file
if (is_file($your_image_directory."/".$file)){
//get size of the image for filtering purpose
$size=getimagesize($your_image_directory."/".$file);
//if the size of width and height is more than 1
if($size[0]>1&&$size[1]>1){
//it's an image
$is_image=1;
//or else
}else{
//it's not an image
$is_image=0;
}
//or else
}else{
//not an image
$is_image=0;
}
//if we found the file is an image
if($is_image){
//put the file in the array
$files[]=$file;
}
}
//close the directory
closedir($dir);


//first file in array
$im=0;
//checks if we have an image request
if(is_numeric($_REQUEST[im])){
//if we do make it the current image
$im=$_REQUEST[im];
}


//if the image is 0 or the first image
if(!$im){
//make the previous image the last image in the array
$prev=count($files)-1;
//or else
}else{
//make the image the previous image in the array
$prev=$im-1;
}


//if we've reached the end of the array
if($im>=(count($files)-1)){
//make the next image the first image in the array
$next=0;
//or else
}else{
//make the next image the next image in the array
$next=$im+1;
}



?>
<center>
<? // DISPLAY THE IMAGE IN AN IFRAME OR WHATEVER ?>
<iframe src="<?=$absolute_path_of_directory?>/<?=$files[$im]?>"
width="200" height="200" style="border:0px;"></iframe>
<br><br>
<? // PREVIOUS BUTTON ?>
<a href='<?=$name_of_this_file?>?im=<?=$prev?>'>[ < < Prev ]</a>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
<? // NEXT BUTTON ?>
<a href='<?=$name_of_this_file?>?im=<?=$next?>'>[ Next > > ]</a>
</center>





Abraham


Return to posts index
Reply   Like  

Jeff LombardoRe: External Pictures Load
by on Jan 8, 2009 at 8:31:46 pm

I am trying to generate a cycleing group of pictures, but I am brand new to dreamweaver. Can you explain in a little more detail how to insert this into my index page? Thanks



Return to posts index
Reply   Like  


Richard WilliamsRe: External Pictures Load
by on Jan 8, 2009 at 10:53:44 pm

are you looking to cycle pages when page is visited, or whilst page is loaded?

If you are looking to cycle differnt images every time a page is visited... ie you go to http://www.yourdomain.com and a picture shows, but next time you go to the same page, there is a different picture showing, then you can do this in dreamweaver. there is a nice tutorial form another thread here:
http://www.elated.com/articles/fun-with-random-numbers/

If however, you are looking to cycle images whilst you are on a page, this needs to be done via another route. A Flash movie would be my preference. You then embed the flash movie in your page.

Richard Williams


Return to posts index
Reply   Like  

Jeff LombardoRe: External Pictures Load
by on Jan 9, 2009 at 12:32:54 pm

I thought the php file written in this post would cycle the pictures.

"If you want to use a PHP script to display your images out of a single folder - here's one that I quickly wrote for you. Let me know if you have any questions about it. Whatever you name this file should have a .php at the end of it so that the php executes properly on the web server."

Am I mistaken? I do not have flash, that is why I am trying to find an alternative method.
Thanks



Return to posts index
Reply   Like  

Abraham ChaffinRe: External Pictures Load
by on Jan 9, 2009 at 3:44:34 pm

This is not a Dreamweaver script. It is a PHP script that can be inserted into a PHP web page.

If you want to use this on your page you will need to name your page with a .php extension so that the server parses PHP.

Secondly view the source code of the file and paste the code into your page in the location of where you want your image to rotate.

Thirdly you will need to define the 3 variables in the file:

$your_image_directory="";
$absolute_path_of_directory="";
$name_of_this_file="";

Put up a test page and try to make it work in the test page before putting it in your live site. Let us know if you have any questions.

Abraham


Return to posts index
Reply   Like  

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
Share on Facebook


FORUMSTUTORIALSMAGAZINESTOCKYARDVIDEOSPODCASTSEVENTSSERVICESNEWSLETTERNEWSBLOGS

Creative COW LinkedIn Group Creative COW Facebook Page Creative COW on Twitter
© 2013 CreativeCOW.net All rights are reserved. - Privacy Policy

[Top]