Help please - Photos are not showing

Hello

on my site, uploaded photos are not showing, only “No Image Available”

on the Sell & Wanted Ads pages is a upload a photo option to display a photo with the Ad,

I have listed a couple of Sell and Wanted Ads, yet no photos are showing, only the “No Image Available”

I looked in: /public_html /uplimg and yes the photos/images have been uploaded to the server,

if you look at the Home page http://numberthree.netne.net/index.php you will see the “No Image Available”

your help appreciated :slight_smile:

  1. Have you contacted the creator of the script?
  2. It would help to see some relevant code

RayWilk

Have you checked the permission that are set by the upload script (if it does indeed set permissions). I have seen scripts that upload images with root permission yet the apache server is set with www-data permissions. Images uploaded will not be shown until they are mapped to www-data. I know on some server configurations, masks are needed to set correct permissions on uploading things. A different angle I know, but one you might want to check.

One way to determine this is try to browse to the uploaded image folder and read an image. So if you site was abc.com then you might go abc.com/uploads/big_table.jpg. See if it loads. If it does then permissions are fine, it is your script or a path set incorrectly.

Steve

Hello Steve (ServerStorm)

good to hear from you, and your ideas

ok I can confirm that the image/photo is in the uplimg folder and readable,

http://numberthree.netne.net/uplimg/img_A_100031_fbc5219b6af0176a1e4625209d08f7e6.jpg

so it is seems to be my script, or script path,

could someone please help me in finding the script fault?

:slight_smile:

Hello litebearer

I appreciated your reply,

please tell me what code you would like to see?

I am on a learning curve here :slight_smile:

As your code is brought there may be a control pannel with the settings; check there and see if you need to set a path to the image folder.

It looks like the code is searching for the image and if it is not found it displays the “No image available” image.

Is the data is stored in a database? You could use phpmyadmin to see what is stored there for the image path.

The simplest and quickest way to get the answer would be as Liteberer said - contact the people who sold you the software.

Hello Rubble,

good to hear from you,

I have had a look in Admin Area, I can not find any area requiring a path setting, or a path needing setting for images/photos

I just had a look in my Servers Control Panel phpmyadmin, and can see no reference to images/photos in the database names,

Yes I agree if no image found it displays the “No image available” image.

your ideas/help appreciated

:slight_smile:

I am just guessing here, yet I have had trouble with several php’s in this script, would it be the thumbnail.php ?

idea 2: should the image be loaded to cache ?

<?
#################################################################

PHP Pro Bid v6.10

##-------------------------------------------------------------##

thumbnail.php

##-------------------------------------------------------------##
#################################################################

include_once(‘includes/class_image.php’);

$image = new image();

(string) $pic = null;

$pic = str_ireplace(’ ‘,’%20’,$_GET[‘pic’]);

$thumbnail_width = abs(intval($_GET[‘w’]));

$is_square = ($_GET[‘sq’]==‘Y’)? true : false;
$is_border = ($_GET[‘b’]==‘Y’) ? true : false;

$pic_no_spaces = str_ireplace(‘%20’,‘’,$pic);

$pic_cached = str_ireplace($image->image_basedir,‘’,$pic_no_spaces);

$allowed_extension = $image->allowed_extension($pic);

/* check to see if file already exists in cache, and output it with no processing if it does */
$cached_filename = $image->set_cache_filename($pic_cached, $thumbnail_width, $is_square, $is_border);

if (is_file($cached_filename) && $allowed_extension) /* display cached filename */
{
$photo = file_get_contents($cached_filename);

ob_start();
header("Content-type: image/jpeg");
print($photo);
ob_end_flush();

}
else /* create new thumbnail, and add it into the cache directory as well */
{

$allowed_widths = array(50, 55, 60, 70, 75, 80, 90, 100, 150, 250, 275, 300, 500, 750, $layout['hpfeat_width'], $layout['catfeat_width']);
//$allowed_widths = sort($allowed_widths, SORT_NUMERIC);

if (!in_array($thumbnail_width, $allowed_widths))
{
	$difference = 0;
	$new_width = $thumbnail_width;
	foreach ($allowed_widths as $value)
	{
		$diff = abs($thumbnail_width - $value);

		if ($diff &lt; $difference || $difference == 0)
		{
			$difference = $diff;
			$new_width = $value;
		}
	}

	$thumbnail_width = $new_width;
}

(array) $info = null;

$info = null;

$info = @getimagesize($pic);
list($im_width, $im_height, $im_type, $im_attr) = $info;

if (empty($info) || $im_type&gt;3) $pic = 'images/broken.gif';

if (isset($pic) && $thumbnail_width&gt;0 && $allowed_extension)
{
	$cache_output = $image-&gt;set_cache_filename($pic_cached, $thumbnail_width, $is_square, $is_border);
	$image-&gt;generate_thumb($pic, $thumbnail_width, $is_square, $is_border, $cache_output);
	//header('Location: ' . $cache_output);			
	
	$photo = file_get_contents($cached_filename);
	
	ob_start();
	header("Content-type: image/jpeg");
	print($photo);
	ob_end_flush();		
}	
else if (!isset($pic))
{
	echo "&lt;strong&gt;ERROR:&lt;/strong&gt; No image submitted";
}
else if ($thumbnail_width&lt;=0)
{
	echo "&lt;strong&gt;ERROR:&lt;/strong&gt; Invalid resizing option";
}
else if (!$allowed_extension)
{
	echo "&lt;strong&gt;ERROR:&lt;/strong&gt; Prohibited file extension";
}

}
?>

I would say you are looking for “noimg.gif” within the code somewhere and it is not here.

You could check: includes/class_image.php but there are so many files and the database it could be like looking for a needle in a haystack.

Hello Rubble,

I did a search for “noimg.gif” the search results are in the attached screen print

:slight_smile:

This is from auction_details.tpl.php

<td width=“20%” align=“center”>
<table width=“100%” border=“0” cellspacing=“3” cellpadding=“3”>
<? if (!empty($item_details[‘ad_image’][0])) { ?>
<tr>
<td align=“center”>
<? $ad_image = (!empty($item_details[‘ad_image’][0])) ? $item_details[‘ad_image’][0] : ‘themes/’ . $setts[‘default_theme’] . ‘/img/system/noimg.gif’; ?>
<div class=“wraptocenter” id=“ad_image”><span></span>
<img <? echo ($setts[‘thumb_display_type’] == ‘h’) ? ‘name=“main_ad_image”’ : ‘’; ?> src=“thumbnail.php?pic=<?=$ad_image;?>&w=250&sq=Y” border=“0” alt=“<?=$item_details[‘name’];?>”>
</div>
<? if (item::count_contents($item_details[‘ad_image’]) && $setts[‘thumb_display_type’] == ‘h’) { ?>
<div style=“padding-top: 10px; width: 250px;”><?=$ad_image_thumbnails;?></div>
<? } ?>
</td>

Check this in your database ‘ad_image’

Hello Rubble

ok went to phpMyAdmin

searched for “ad_image”

1 match(es) inside table content_pages

Clicked on Browse, info below

COLLATE latin1_general_ci
OR topic_content LIKE CONVERT( _utf8 ‘%ad_image%’
USING latin1 )
COLLATE latin1_general_ci
OR topic_lang LIKE CONVERT( _utf8 ‘%ad_image%’
USING latin1 )
COLLATE latin1_general_ci
OR topic_order LIKE ‘%ad_image%’
OR reg_date LIKE ‘%ad_image%’
OR page_id LIKE CONVERT( _utf8 ‘%ad_image%’
USING latin1 )
COLLATE latin1_general_ci
OR page_handle LIKE CONVERT( _utf8 ‘%ad_image%’
USING latin1 )
COLLATE latin1_general_ci
OR show_link LIKE ‘%ad_image%’
)
LIMIT 0 , 30