jlhaslip Posted November 11, 2008 Share Posted November 11, 2008 you need to adjust the Folder names and change the folder in the script to be the same as your actual folder on your Site. <?phpecho '<ul class="hoverbox">';$max_num = 15;$j=0;$narray = array();$dir = "images/"; // name of the folder where the Thumbnail images are storedif (is_dir($dir)) ) { $dh= @opendir($dir) or die("Unable to open $path please notify the administrator. Thank you."); // confirm directories exist while (($file = readdir($dh)) !== false) { // read the entire directory if(($file != '.') && ($file != '..') && (stristr($file,'jpg'))) { //jpg files only $narray[]=$file; $n++; } }if ($n < $max_num) { $max_num = $n; }shuffle( $narray); while ( $j <= $max_num-1) { echo "\t" . '<li><a href="' . $dir . $narray[$j] . '" alt="full-size"><img src="' . $dir . $narray[$j] . '" alt="' . $dir . $narray[$j] . '" ><img src="' . dir . $narray[$j] . '" alt="mid-size" class="preview" /></a></li> ' . "\n\r\t"; $j++; }} else { echo 'There is a problem with the directories. Please Notify the Administrator. Thank You.';} closedir($dh);echo '</ul>';?> Try this version. load your images into a folder named "images" (no quotes). Link to comment Share on other sites More sharing options...
Joey46 Posted November 11, 2008 Author Share Posted November 11, 2008 you need to adjust the Folder names and change the folder in the script to be the same as your actual folder on your Site.<?phpecho '<ul class="hoverbox">';$max_num = 15;$j=0;$narray = array();$dir = "images/"; // name of the folder where the Thumbnail images are storedif (is_dir($dir)) ) { $dh= @opendir($dir) or die("Unable to open $path please notify the administrator. Thank you."); // confirm directories exist while (($file = readdir($dh)) !== false) { // read the entire directory if(($file != '.') && ($file != '..') && (stristr($file,'jpg'))) { //jpg files only $narray[]=$file; $n++; } }if ($n < $max_num) { $max_num = $n; }shuffle( $narray); while ( $j <= $max_num-1) { echo "\t" . '<li><a href="' . $dir . $narray[$j] . '" alt="full-size"><img src="' . $dir . $narray[$j] . '" alt="' . $dir . $narray[$j] . '" ><img src="' . dir . $narray[$j] . '" alt="mid-size" class="preview" /></a></li> ' . "\n\r\t"; $j++; }} else { echo 'There is a problem with the directories. Please Notify the Administrator. Thank You.';} closedir($dh);echo '</ul>';?> Try this version. load your images into a folder named "images" (no quotes). Link to comment Share on other sites More sharing options...
Joey46 Posted November 11, 2008 Author Share Posted November 11, 2008 this is what i am getting now so it is getting closer to working" 3 boxes with the names of my images in it and a red cross" same red cross you get when an image does not show" Link to comment Share on other sites More sharing options...
jlhaslip Posted November 11, 2008 Share Posted November 11, 2008 Can you post a link, please Link to comment Share on other sites More sharing options...
Joey46 Posted November 12, 2008 Author Share Posted November 12, 2008 Can you post a link, please http://www.kwilliams.cessnock-ict.net/ICAB...20A/default.htm then you click on view images and then show images Link to comment Share on other sites More sharing options...
Synook Posted November 12, 2008 Share Posted November 12, 2008 Where is the image actually located? Link to comment Share on other sites More sharing options...
Joey46 Posted November 12, 2008 Author Share Posted November 12, 2008 Where is the image actually located? it is located in a folder called graphics inside ICAB5165A_ICAB4220A Link to comment Share on other sites More sharing options...
jlhaslip Posted November 12, 2008 Share Posted November 12, 2008 the Image is at http://www.kwilliams.cessnock-ict.net/ICAB...dison1_2008.jpg, so you need to alter the script to look at the Graphics folder instead of images. $dir = "Graphics/"; // name of the folder where the Thumbnail images are stored Link to comment Share on other sites More sharing options...
Joey46 Posted November 12, 2008 Author Share Posted November 12, 2008 the Image is at http://www.kwilliams.cessnock-ict.net/ICAB...dison1_2008.jpg, so you need to alter the script to look at the Graphics folder instead of images.$dir = "Graphics/"; // name of the folder where the Thumbnail images are stored I have already changed that one and that is how the n i got the squares with the crosses in them mate Link to comment Share on other sites More sharing options...
jlhaslip Posted November 12, 2008 Share Posted November 12, 2008 There is a Forbidden error when i access the image link directly. Do you have hotlinking disabled on those files/folders? Link to comment Share on other sites More sharing options...
Joey46 Posted November 12, 2008 Author Share Posted November 12, 2008 There is a Forbidden error when i access the image link directly. Do you have hotlinking disabled on those files/folders?Not that I know of mate Link to comment Share on other sites More sharing options...
jlhaslip Posted November 12, 2008 Share Posted November 12, 2008 must be a path or permissions error some place.Is that a Server at your school? Can you access the pictures from a local Computer? Link to comment Share on other sites More sharing options...
Joey46 Posted November 12, 2008 Author Share Posted November 12, 2008 must be a path or permissions error some place.Is that a Server at your school? Can you access the pictures from a local Computer?that is the tafe web site that i am using......yes i can access the images from my computer Link to comment Share on other sites More sharing options...
jlhaslip Posted November 12, 2008 Share Posted November 12, 2008 Can you post an URL that will display an Image by direct access, please. Link to comment Share on other sites More sharing options...
Joey46 Posted November 12, 2008 Author Share Posted November 12, 2008 Can you post an URL that will display an Image by direct access, please. http://www.kwilliams.cessnock-ict.net/ICAB...20A/default.htmthen you click "View Gallery" then click "show images" and that will take you to the page where the boxes are with the red crosses Link to comment Share on other sites More sharing options...
jlhaslip Posted November 12, 2008 Share Posted November 12, 2008 Indeed, but that is not a direct linking URL to the images for the page. Link to comment Share on other sites More sharing options...
Joey46 Posted November 12, 2008 Author Share Posted November 12, 2008 Indeed, but that is not a direct linking URL to the images for the page.would you like me to copy and paste it or give you my ftp site? Link to comment Share on other sites More sharing options...
jlhaslip Posted November 12, 2008 Share Posted November 12, 2008 No need for the ftp, cut and paste the file address here for now. Link to comment Share on other sites More sharing options...
Joey46 Posted November 12, 2008 Author Share Posted November 12, 2008 No need for the ftp, cut and paste the file address here for now.i do not know the file address i'm sorry once i put it up online it is supose to just open up unless you type in http://www.kwilliams.cessnock-ict.net/ICAB...default.htm/phpor is the php supose to be in its own folder maybe??? Link to comment Share on other sites More sharing options...
jlhaslip Posted November 12, 2008 Share Posted November 12, 2008 If we could know where the Image is located on the Server, in which folder, it would solve this issue, as I think the path to the image is incorrect, so the Alt text and the red 'x' box is displayed instead of the Image. Link to comment Share on other sites More sharing options...
Joey46 Posted November 12, 2008 Author Share Posted November 12, 2008 If we could know where the Image is located on the Server, in which folder, it would solve this issue, as I think the path to the image is incorrect, so the Alt text and the red 'x' box is displayed instead of the Image.the image is located in a folder called Graphics in that module it is also on my pc Link to comment Share on other sites More sharing options...
Synook Posted November 12, 2008 Share Posted November 12, 2008 Well, check whether that image (e.g. /ICAB5165A_ICAB4220A/Graphics/maddison1_2008.jpg) exists. I get permission denied. Link to comment Share on other sites More sharing options...
Joey46 Posted November 12, 2008 Author Share Posted November 12, 2008 Well, check whether that image (e.g. /ICAB5165A_ICAB4220A/Graphics/maddison1_2008.jpg) exists. I get permission denied.Yes i know mate and i have just remembered my teacher told me to change the rights on the images so no-one could delete them on me, and as i have never doneit before or since i am unsure how to change it back i'm afraid so if you know how to change the rights back by all means please let me know how to do it and i willThank you Link to comment Share on other sites More sharing options...
jlhaslip Posted November 12, 2008 Share Posted November 12, 2008 In your Account Manager, find the file and Change permissions to at least 0644. Most Cpanel-like systems have a link to do that. Or ask your Teacher. Link to comment Share on other sites More sharing options...
Joey46 Posted November 12, 2008 Author Share Posted November 12, 2008 In your Account Manager, find the file and Change permissions to at least 0644. Most Cpanel-like systems have a link to do that. Or ask your Teacher.will ask her on Monday how to change the permissions seeing as she told me to change them thank you for your help much appreciated Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.