• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 247
  • Last Modified:

Picture not displaying

Does anyone know why this isn't displaying the pic? When I view the webpage and check the properties of the picture, the path to the pic is almost correct except for some reason it cuts the T off thumbnails so i have /umnails which is really weird.

<img src="../images/<?php echo tNG_showDynamicThumbnail("", "../images", "{$eCart1->DisplayInfo("Thumbnail")}", 100, 100, true); ?>" border="0" align="middle" class="picborder"/>

Open in new window

0
jonofat
Asked:
jonofat
  • 18
  • 10
  • 3
2 Solutions
 
Ray PaseurCommented:
Well, you might try showing us the code that generates the web page and posting a link to the web page itself.  There is nothing in the script above that would cut a T off of a string.
0
 
jonofatAuthor Commented:
I can't give you a link as the site isn't live, I am still working on my local server.

All I can show you is the block of code that is in:

<?php
//WA eCart Show If Start
if (!$eCart1->IsEmpty())     {
?>
                <h2 >Your Shopping Cart</h2>
                <table class="eC_ShoppingCart" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <th >Product thumbnail</th>
                    <th >Name</th>
                    <th >Size</th>
                    <th >Colour</th>
                    <th  class="eC_PriceItem">Quantity</th>
                    <th  class="eC_PriceItem">Price</th>
                    <th  class="eC_PriceItem">Total</th>
                  </tr>
                  <?php
while (!$eCart1->EOF())      {
?>
                    <tr>
                      <td ><img src="../images/<?php echo tNG_showDynamicThumbnail("", "../images", "{$eCart1->DisplayInfo("Thumbnail")}", 100, 100, true); ?>" border="0" align="middle" class="picborder"/></td>
                      <td ><?php echo $eCart1->DisplayInfo("Name"); ?></td>
                      <td ><?php echo $eCart1->DisplayInfo("Size"); ?></td>
                      <td ><?php echo $eCart1->DisplayInfo("Colour"); ?></td>
                      <td align="center"  class="eC_PriceItem"><?php echo $eCart1->DisplayInfo("Quantity"); ?></td>
                      <td  class="eC_PriceItem"><?php echo WA_eCart_DisplayMoney($eCart1, $eCart1->DisplayInfo("Price")); ?></td>
                      <td  class="eC_PriceItem"><?php echo WA_eCart_DisplayMoney($eCart1, $eCart1->DisplayInfo("TotalPrice")); ?></td>
                    </tr>
                    <?php
  $eCart1->MoveNext();
}
$eCart1->MoveFirst();
?>
                </table>
                <div class="eC_OrderSummary">
                  <table border="0" cellpadding="0" cellspacing="0" class="eC_CartSummary">
                    <?php
//WA eCart Merchandizing Show Start
//ecart="eCart1"
if ($eCart1->GetDiscounts() > 0 || $eCart1->GetCharges() > 0 || $eCart1->GetShipping() > 0 || $eCart1->GetTax() > 0)     {
?>
                    <tr>
                      <td class="eC_Subtotal eC_SummaryLabel">Sub-total</td>
                      <td class="eC_Subtotal"><?php echo WA_eCart_DisplayMoney($eCart1, $eCart1->TotalColumn("TotalPrice")); ?></td>
                    </tr>
                    <?php
//WA eCart Merchandizing Show End
//ecart="eCart1"
}
?>
                    <?php
//WA eCart Merchandizing Show Start
//ecart="eCart1"
if ($eCart1->GetDiscounts() > 0)     {
?>
                    <tr>
                      <td class="eC_SummaryLabel">Discounts</td>
                      <td>-<?php echo WA_eCart_DisplayMoney($eCart1, $eCart1->GetDiscounts()); ?></td>
                    </tr>
                    <?php
//WA eCart Merchandizing Show End
//ecart="eCart1"
}
?>
                    <?php
//WA eCart Merchandizing Show Start
//ecart="eCart1"
if ($eCart1->GetCharges() > 0)     {
?>
                    <tr>
                      <td class="eC_SummaryLabel">Charges</td>
                      <td><?php echo WA_eCart_DisplayMoney($eCart1, $eCart1->GetCharges()); ?></td>
                    </tr>
                    <?php
//WA eCart Merchandizing Show End
//ecart="eCart1"
}
?>
                    <?php
//WA eCart Merchandizing Show Start
//ecart="eCart1"
if ($eCart1->GetShipping() > 0)     {
?>
                    <tr>
                      <td class="eC_SummaryLabel">Shipping</td>
                      <td><?php echo WA_eCart_DisplayMoney($eCart1, $eCart1->GetShipping()); ?></td>
                    </tr>
                    <?php
//WA eCart Merchandizing Show End
//ecart="eCart1"
}
?>
                    <?php
//WA eCart Merchandizing Show Start
//ecart="eCart1"
if ($eCart1->GetTax() > 0)     {
?>
                    <tr>
                      <td class="eC_SummaryLabel">Tax</td>
                      <td><?php echo WA_eCart_DisplayMoney($eCart1, $eCart1->GetTax()); ?></td>
                    </tr>
                    <?php
//WA eCart Merchandizing Show End
//ecart="eCart1"
}
?>
                    <tr class="eC_SummaryFooter">
                      <td class="eC_SummaryLabel">Grand Total:</td>
                      <td><?php echo WA_eCart_DisplayMoney($eCart1, $eCart1->GrandTotal()); ?></td>
                    </tr>
                    <tr class="eC_SummaryFooter">
                      <td class="eC_SummaryLabel">&nbsp;</td>
                      <td>&nbsp;
                        <form name="eCart1_Checkout_form_1" method="POST" action="<?php echo $_SERVER["PHP_SELF"];  echo (isset($_SERVER["QUERY_STRING"]) && $_SERVER["QUERY_STRING"] != "")?"?".$_SERVER["QUERY_STRING"]:""; ?>">
                          <input type="image" src="../images/checkout.jpg" border="0" class="eC_ImageButton" value="Checkout" name="eCart1_Checkout_1">
                        </form></td>
                    </tr>
                  </table>
                </div>
                <?php
//WA eCart Show If Middle
}
else     {
?>
<table><tr><td>Cart is empty</td></tr></table>
                <?php
//WA eCart Show If End
}
?>

Open in new window

0
 
jonahzonaCommented:
@jonofat

You can bring up the parsed HTML and let us see that. That will help.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
jonofatAuthor Commented:
Do you mean this? As you can see it cuts the T off of thumbnails for some reason. This exact code works when the page is in the root and then instead of ../images it is just images but I am using a page that is in a folder in the root and so have to use ../images but since I am doing that, it cuts off the T in thumbnail all by itself. Weird.

<table class="eC_ShoppingCart" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <th >Product thumbnail</th>
                    <th >Name</th>
                    <th >Size</th>
                    <th >Colour</th>
                    <th  class="eC_PriceItem">Quantity</th>
                    <th  class="eC_PriceItem">Price</th>
                    <th  class="eC_PriceItem">Total</th>
                  </tr>
                                      <tr>
                      <td ><img src="../images/umbnails/T1234_100x100.jpg" border="0" align="middle" class="picborder"/></td>
                      <td >Circus</td>
                      <td ></td>
                      <td ></td>
                      <td  class="eC_PriceItem">1</td>
                      <td  class="eC_PriceItem">R835.00</td>
                      <td  class="eC_PriceItem">R835.00</td>
                    </tr>
                                    </table>

Open in new window

0
 
jonahzonaCommented:
It looks like you might have an error in your tNG_showDynamicThumbnail call.

The output you just posted shows a directory of ../images/UMBNAILS

Shouldn't that be THUMBNAILS?

You could just try changing the name of that directory to UMBNAILS to see if it works.

Just a thought.
0
 
jonofatAuthor Commented:
No, there isn't an error because I use that call on another page in the root and it works fine. It is also pulling images from a folder called THUMNAILS so if I change it to UMNAILS then this page will work but the other page won't.
0
 
jonahzonaCommented:
I was only recommending changing it momentarily to test and see if that solves your issue.

It is strange that call would work on one page but not another. But if your php is putting out a wrong directory in the parsed HTML, you will never get the image to display.

0
 
jonahzonaCommented:
Oh, and it is UMBNAILS - don't forget the B.....
0
 
Ray PaseurCommented:
Hmm, looks like this may be near the problem:

$eCart1->DisplayInfo("Thumbnail")

Where is the class definition for the $eCart1 object?  If you look at the displayInfo() method, you may find something.
0
 
jonofatAuthor Commented:
Yes, if I changed the folder name to UMBNAILS it worked but then the other page that was workding doesn' t work. LOL.

Ray, there are a lot of external files in a folder with all the functions etc. It is way too much to post here I think. I don't want to "spam" anyone.
0
 
jonahzonaCommented:
Well, at least we nailed down what the issue is.

The problem now is you will need to comb through your PHP. Somewhere a directory was spelled wrong.

I would recommend using some type of text-seach tool through you PHP files and have it search for /umbnails to see if you can locate the problem.
0
 
jonofatAuthor Commented:
If I just use this:

<img src="../images/<?php echo $eCart1->DisplayInfo("Thumbnail"); ?>

Open in new window


it shows the picture but it is massive. This is why I combined it with the tNG_showDynamicThumbnail
0
 
jonofatAuthor Commented:
jonahzona, I can't understand why this would be the case because it works fine on the page that is in the root? Surely it should work anywhere as long as the path to the images folder is correct ie:

images or ../images etc.
0
 
Ray PaseurCommented:
a lot of external files in a folder with all the functions - right, and as a programmer it's your job to know where they are and what they do.  You don't need to post all of them.  You could just start with the displayInfo() method and anything that might be extending it.  

If you need a good code scanner, you can try Textpad "find in files" or a similar function in Notepad++  Either of those can help you look through a pile of things and tease out the important data.  If I were looking for it, I would make a case-insensitive search for "umbnail"
0
 
jonofatAuthor Commented:
Well, I found this, not sure if it helps. It is in connection with the code that displays my thumnails.

function Execute() {
    	$ret = "";
		$relpath = $this->relpath;
		$folder = KT_TransformToUrlPath($this->folder);
		$fileName = KT_DynamicData($this->renameRule, null);
		$fileName = KT_TransformToUrlPath($fileName, false);
		$fullFolder = KT_realpath($folder, true);
		$fullFileName = KT_realpath($fullFolder . $fileName, false);
		$path_info = KT_pathinfo($fullFileName);
		$thumbnailFolder = $path_info['dirname'] . '/thumbnails/';

Open in new window

0
 
jonofatAuthor Commented:
$itemThumbnail = null;
    if (isset($_POST[$this->CartName."_Thumbnail_hid_".$n])) {
      $itemThumbnail = $_POST[$this->CartName."_Thumbnail_hid_".$n];
    }
    if (isset($_POST[$this->CartName."_Thumbnail_list_".$n])) {
      $itemThumbnail = $_POST[$this->CartName."_Thumbnail_list_".$n];
    }
    if (isset($_POST[$this->CartName."_Thumbnail_".$n])) {
      $itemThumbnail = $_POST[$this->CartName."_Thumbnail_".$n];
    }
    if (isset($_POST[$this->CartName."_Thumbnail_check_".$n])) {
      $itemThumbnail = $_POST[$this->CartName."_Thumbnail_check_".$n];

Open in new window

0
 
jonofatAuthor Commented:
There is also an XML file with the following :

<WA_eCartDisplayColumns>
    <WA_eCartDisplayColumn name="Thumbnail" label="Product thumbnail" display_as="image" imageFolder="/images/" />
    <WA_eCartDisplayColumn name="Name" label="Name" />
    <WA_eCartDisplayColumn name="Size" label="Size" />
    <WA_eCartDisplayColumn name="Colour" label="Colour" />
    <WA_eCartDisplayColumn name="Quantity" label="Quantity" />
    <WA_eCartDisplayColumn name="Price" label="Price" />
    <WA_eCartDisplayColumn name="TotalPrice" label="Total" />
  </WA_eCartDisplayColumns>

Open in new window

0
 
jonahzonaCommented:
Are these thumbnails loaded from the backend?

Is it possible the directory for the thumbnail was incorrectly specified in its meta data? Just a thought.

That would eliminate it from being a PHP problem if the thumbnail itself had been given incorrect info.
0
 
jonofatAuthor Commented:
What happens is. I upload the images in the admin section at full size. So, if I upload an image that is 800 x 600 it uploads at that size. Then the resize  happens is in the front end, if I go to a page with the echo tNG_showDynamicThumbnail code in it, it then calls the code in the include file and resizes the image to a thumbnail size and places it in a thumbnails folder. I just tested it and it is so. When I upload the file it doesn't show in the thumbnails folder. When I navigate to the gallery page it then creates the thumbnail and I see it in the thumbnails folder.
0
 
jonahzonaCommented:
What about the page of the item you are working on? Do you have to specify what folder the thumbnail is in the backend?

Basically, think of any place you could have at some point accidentally spelled UMBNAIL. Is there anywhere in the process where this could have happened?
0
 
jonofatAuthor Commented:
No, I don't have to specfiy anything. All I do on every new project is copy the entrire gallery include folder and everything is set up already. It has worked on my last 3 projects and I have got it to work with files not in the root. The only difference this time around is that instead of calling from a recordset like I always do, I am using {$eCart1->DisplayInfo("Thumbnail")} where it would normally be {Recordset1.pic}

here is an example of me using it not in the root on another site and it works 100%

<img src="../images/<?php echo tNG_showDynamicThumbnail("", "../images/", "{Recordset1.pic}", 100, 75, true); ?>" border="1" align="middle" class="picborder"/>

Open in new window

0
 
jonofatAuthor Commented:
Isn''t there a way I can cheat here? I know that the end of each thumbnail is _100x100

So, I already have ../images in the front. Can't I just do this "manually" and do something like

<img src="../images/thumbnails/<?php echo $eCart1->DisplayInfo("Thumbnail")_100x100; ?>" />

Open in new window


just don't know where the _100x100 should go...
0
 
jonofatAuthor Commented:
Hmm. No, don't think that will work.
0
 
jonahzonaCommented:
You could add some size properties. Try this:

<img src="../images/thumbnails/<?php echo $eCart1->DisplayInfo("Thumbnail"); ?>" width="100" height="100" />

Open in new window

0
 
jonofatAuthor Commented:
Thanks jonahzona but I have already had this conversation with someone and if I do that the quality of the picture is very poor.
0
 
jonahzonaCommented:
Yeah, I can believe that.

Without the ability to look through all of your code, the last thing I will recommend as a temporary solution until you can locate what is changing the parsed syntax, is to double up on your thumbnail folder.

Leave the code the way that it was originally.

Create another folder named umbnails.

Reupload all thumbnails into this folder as well.

Obviously, this is just to get it working. Again, without total access to all of your files and the website itself, I am not sure we will be able to locate the reason this is happening.
0
 
jonofatAuthor Commented:
This probably won't help but thought I would show it anyway...

$this->deleteThumbnails($this->dynamicFolder .'thumbnails'.DIRECTORY_SEPARATOR, $oldFileName);
				if ($this->uploadedFileName != '') {
					$this->deleteThumbnails($this->dynamicFolder.'thumbnails'.DIRECTORY_SEPARATOR, $this->uploadedFileName);
				}

				if ($this->dbFieldName != '' && $this->uploadedFileName != "") {
					$ret = $this->tNG->afterUpdateField($this->dbFieldName, $updateDB);

Open in new window

0
 
jonofatAuthor Commented:
I can't do what you suggested jonahzona, as the administrator will be adding pics all the time. I will have to manually update the umbnails folder constantly, just isn't realistic.
0
 
jonofatAuthor Commented:
Hillarious. I fixed it. I just added th after ../images

../images/th/

and now it is thumbnails instead of umbnails.

Haha.
0
 
jonahzonaCommented:
Awesome!
0
 
jonofatAuthor Commented:
okay. I guess I will just give anyone who had a suggestion some points then..
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 18
  • 10
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now