Jump to content

how to show images


Joey46

Recommended Posts

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

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

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

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

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

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

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

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...