X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Images won't show up after moving them... (https://forum.x-cart.com/showthread.php?t=31668)

laxelrod 06-05-2007 09:57 AM

Images won't show up after moving them...
 
So today I have tried to both put my subcategories into a multiple column layout and I have also tried to put my products detailed images into the product details section. When I make these changes the image no longer shows up and I get code like this:

Code:

[img]../product_image.php?imageid=997[/img]

Does anyone know why this is happening? I tried searching the forums and I couldn't find much, but maybe I didn't search hard enough. Could this have to do with my images being stored in the database? If so is there any easy way to transfer my images to the file server, I have hundreds of products on my website so far.

Thanks

balinor 06-05-2007 10:13 AM

Re: Images won't show up after moving them...
 
You copied some code that has been corrupted. The forum was upgraded a while back and some of the image tags broke. Post the original image code that you used and I'll give you the correct code for the images.

laxelrod 06-05-2007 10:49 AM

Re: Images won't show up after moving them...
 
I tried to move the detailed image into the product description using the code from the following thread: http://forum.x-cart.com/viewtopic.php?t=2006.

I'm trying to find the code for the multiple columns of subcategories that I used and I will post that as soon as I find it.

Lesson learned: bookmark pages.

laxelrod 06-05-2007 10:59 AM

Re: Images won't show up after moving them...
 
For putting subcategories in multpile columns I found the following code:

Code:

{* $Id: subcategories.tpl,v 1.43.2.9 2006/06/27 08:22:01 svowl Exp $ *}
{if $active_modules.Bestsellers ne "" and $config.Modules.bestsellers_menu ne "Y"}
{include file="modules/Bestsellers/bestsellers.tpl"}
{/if}
{if $active_modules.Special_Offers and $category_offers}
<BR><BR>
{include file="modules/Special_Offers/customer/category_offers_short_list.tpl"}
{/if}
{if ($navigation_page eq "")||($navigation_page eq "1")}{$current_category.description}<BR><BR>{/if}
{capture name=dialog}
{assign var="tmp" value="0"}
{section name=cat_num loop=$subcategories}
{if $subcategories[cat_num].category}{assign var="tmp" value="1"}{/if}
{/section}
{if $subcategories}
<table cellspacing="5" width="100%" border="0">
<tr>
{foreach from=$subcategories item=subcat}
{if $tmp is div by 3}
</tr><tr><td colspan="3"></td></tr><tr valign="top">
{/if}
{ if $tmp and $first_subcat ne "Y" }
{assign var="tmp" value=0}
{assign var="first_subcat" value="Y"}
{/if}
<td class="ColumnTitles" valign="top"><a title="{$subcat.description}" href="home.php?cat={ $subcat.categoryid }"><img src="{if $subcat.icon_url}{$subcat.icon_url}{else}{$xcart_web_dir}/default_image.gif{/if}" alt="" align="middle" <br><left>
<font class="ItemsList">{ $subcat.category|escape }</font></a>
{if $config.Appearance.count_products eq "Y"}
 
{/if}
{assign var="tmp" value=$tmp+1}
{/foreach}
</table>
{/if}
{if $tmp and $products ne "" }
<BR clear="left">
<HR size="1" noshade>
{/if}
{if $products}
{if $sort_fields}
<DIV align="right">{include file="main/search_sort_by.tpl" sort_fields=$sort_fields
selected=$search_prefilled.sort_field direction=$search_prefilled.sort_direction
url="home.php?cat=`$cat`&"}</DIV>
{/if}
{if $total_pages gt 2}
<BR>
{ include file="customer/main/navigation.tpl" }
{/if}
<BR>
{include file="customer/main/products.tpl" products=$products}
{/if}
{if $products eq "" and $tmp eq "0"}
{$lng.txt_no_products_in_cat}
{/if}
{/capture}
{include file="dialog.tpl" title=$current_category.category content=$smarty.capture.dialog
extra="width=100%"}
{if $products eq ""}
{if $f_products ne ""}
<P>
{include file="customer/main/featured.tpl"}
{/if}
{/if}
{ include file="customer/main/navigation.tpl" } 


I no longer get the same code showing up I was getting before, I just get the "No Image Available" image instead of the subcategory images, so I'm assuming it is just pulling my images from the wrong place. If you could correct that, that would be great.

Thanks for your help.

balinor 06-05-2007 11:10 AM

Re: Images won't show up after moving them...
 
Which thread did you pull that category column code from? That looks like the one for version 4.1...you want the one for 4.0:

http://forum.x-cart.com/showthread.php?t=3848&highlight=subcategories+icon s

laxelrod 06-05-2007 11:36 AM

Re: Images won't show up after moving them...
 
Alright I found the original code I was using where I get the image coding instead of the image

Code:

{* $Id: subcategories.tpl,v 1.29 2002/11/26 14:55:13 alfiya Exp $ *}
{ include file="location.tpl" }
{if $active_modules.Bestsellers ne "" and $config.Modules.bestsellers_menu ne "Y"}



{include file="modules/Bestsellers/bestsellers.tpl"}
{/if}



{ include file="customer/main/navigation.tpl" }
{if ($navigation_page eq "")||($navigation_page eq "1")}{$current_category.description|regex_replace:"/[\n]/":"
"}

{/if}


{capture name=dialog}
{assign var="tmp" value="0"}

{section name=cat_num loop=$subcategories}
{if $subcategories[cat_num].category}{assign var="tmp" value="1"}{/if}
{/section}

{section name=cat_num loop=$subcategories}

{ if %cat_num.first% }
<table border=0 cellspacing=5 width=100%>
{/if}

  {if $smarty.section.cat_num.index is div by 2}
    </tr><tr valign="top">
  {/if}

<td valign="top" width="70" align="center">
<a class="alt" href="home.php?cat={ $subcategories[cat_num].categoryid }">
[img]../icon.php?categoryid={$subcategories[cat_num].categoryid}[/img]
</a>
</td>
<td align=left><a class="alt" href="home.php?cat={ $subcategories[cat_num].categoryid }">
{$subcategories[cat_num].category|escape}</a>

{ $categories[cat_num].description|escape }
</td>

{ if %cat_num.last% }
</tr></table>
{/if}

{/section}
{if $tmp and $products ne "" }
<br clear=_all>{*<hr size=1 noshade>*}
{/if}

{if $products eq "" and $tmp eq "0"}
{$lng.txt_no_products_in_cat}
{/if}

{/capture}
{include file="dialog.tpl" title=$current_category.category|regex_replace:"/.*\//":"" content=$smarty.capture.dialog extra="width=100%"}




{include file="customer/main/products.tpl" products=$products}

{if $products eq ""}
{if $f_products ne ""}



{include file="customer/main/featured.tpl"}
{/if}
{/if}
{ include file="customer/main/navigation.tpl" }


balinor 06-05-2007 11:46 AM

Re: Images won't show up after moving them...
 
I don't recommend that code for subcategories.tpl. Use this instead (make a backup of your current subcategories.tpl first):

Code:

{capture name=dialog}
{if $current_category.description ne ""}
{$current_category.description}<br>{/if}
{assign var="tmp" value="0"}
{section name=cat_num loop=$subcategories}
{if $subcategories[cat_num].category}{assign var="tmp" value="1"}{/if}
{/section}



{section name=cat_num loop=$subcategories}
{ if %cat_num.first% }
<table width="100%" border="0" align="center" cellpadding="5" cellspacing="0">
{/if}
{ if %cat_num.index% is div by 3}
<tr>
{/if}
<td align="center" valign="top">
<a href="home.php?cat={ $subcategories[cat_num].categoryid }">
{if $subcategories[cat_num].icon_url}<img src="{$subcategories[cat_num].icon_url}" border="0" style="padding-bottom: 5px;">{else}<img src="{$xcart_web_dir}/default_icon.gif" border="0" style="padding-bottom: 5px;">{/if} </a><br>
<a href="home.php?cat={ $subcategories[cat_num].categoryid }">
<span class="SubcategoryName">{$subcategories[cat_num].category|escape }</span></a><br>
</td>
{ if %cat_num.last% }
</tr>
</table>
{/if}
{/section}


{if $tmp and $products ne "" }

{/if}
{if $products}
<br><hr size="1" noshade><br>
{if $sort_fields}
<DIV align="right">{include file="main/search_sort_by.tpl" sort_fields=$sort_fields selected=$search_prefilled.sort_field direction=$search_prefilled.sort_direction url="home.php?cat=`$cat`&"}</DIV>
{/if}
{if $total_pages gt 2}
<br>
{ include file="customer/main/navigation.tpl" }
{/if}

{include file="customer/main/products.tpl" products=$products}
{/if}
{if $products eq "" and $tmp eq "0"}
{$lng.txt_no_products_in_cat}
{/if}
{/capture}
{include file="dialog.tpl" title=$current_category.category content=$smarty.capture.dialog extra="width=100%"}

{if $f_products ne ""}
<br>
{include file="customer/main/featured.tpl"}
{/if}

{ include file="customer/main/navigation.tpl" }


laxelrod 06-05-2007 11:53 AM

Re: Images won't show up after moving them...
 
I tried it...still no images. now nothing shows above the category names though, not even the image code.

laxelrod 06-05-2007 12:16 PM

Re: Images won't show up after moving them...
 
And of course I was stupid and way earlier I had saved my subcategory.tpl but I must have saved something over it so...I'm pretty sure my original one is gone. So I lost my subcategory images totally.

balinor 06-05-2007 12:17 PM

Re: Images won't show up after moving them...
 
Ok, a few questions:

1. Are your images in the filesystem?

2. Do you have images assigned to all sub-cats?

3. Have you made any modifications to any php files trying to get this to work?

laxelrod 06-05-2007 12:23 PM

Re: Images won't show up after moving them...
 
Answers:

1. I believe my images are in the database. do i need to switch them over to the file system? if so how would i go about doing that?

2. I have images assigned to about 85% of my subcats

3. I have not so much as touched a php file because I know nothing about php. I at least know html and css which is why I'm willing to play with smarty...

balinor 06-05-2007 12:30 PM

Re: Images won't show up after moving them...
 
Yea, you are going to want to get them out of the db. Same for your thumbs and detailed images. Good thread on that here:

http://forum.x-cart.com/showthread.php?t=8438

laxelrod 06-06-2007 05:32 AM

Re: Images won't show up after moving them...
 
Alright I'm going to get the pictures out of the database and into the file system right now. Is that going to solve the problem of the pictures showing up?

balinor 06-06-2007 05:33 AM

Re: Images won't show up after moving them...
 
It might, but it needs to be done regardless. Once you have them moved, see if they show up. If not, we'll try something else.

laxelrod 06-06-2007 05:47 AM

Re: Images won't show up after moving them...
 
Ok I'm trying to move them, and this is just going to sound like the stupidest question ever, but the file system would be just folders on my ftp, right? Also, I don't know how to write permissions. I'm pretty new at all of this stuff.

laxelrod 06-06-2007 05:55 AM

Re: Images won't show up after moving them...
 
Alright I tried to transfer the images to the file system so I made folders on my ftp. On my transfer log it said all of these images failed to transfer. So I went into my ftp to delete my folders I made because I figured I had done it wrong and all of a sudden it was deleting images, so I cancelled it, and sure enough all of my images are in those folders. Weird.

balinor 06-06-2007 06:30 AM

Re: Images won't show up after moving them...
 
You sure it said all of them or was it just a few of them? Usually when they fail to copy it is because the folders aren't set to writable (666 or 777).

laxelrod 06-06-2007 06:38 AM

Re: Images won't show up after moving them...
 
I looked at the list and ones that it said failed to copy were in the folders...

balinor 06-06-2007 06:46 AM

Re: Images won't show up after moving them...
 
Ok, what is it now saying in your 'Images Location' - database or filesystem?

laxelrod 06-06-2007 06:47 AM

Re: Images won't show up after moving them...
 
It now says database

balinor 06-06-2007 07:08 AM

Re: Images won't show up after moving them...
 
And are your product images still visible? When you right click on them, does it still say image.php....

laxelrod 06-06-2007 08:09 AM

Re: Images won't show up after moving them...
 
Product images are still visible, but I don't remember it ever saying image.php when I right clicked on them, and it doesn't now.

balinor 06-06-2007 08:11 AM

Re: Images won't show up after moving them...
 
I can't view your site, so I can't see. What I mean is, if you right click and click on 'Properties', does it show the path as image.php or files/imagename.jpg

laxelrod 06-06-2007 08:15 AM

Re: Images won't show up after moving them...
 
image.php?productid=17158

laxelrod 06-06-2007 08:16 AM

Re: Images won't show up after moving them...
 
you can view my site at the following link:

http://www.395caps.com/home.php?shopkey=0065

username: test
password: test

balinor 06-06-2007 08:20 AM

Re: Images won't show up after moving them...
 
That means they are still in the DB. Try moving them again, and this time make sure the folders they are getting moved to are all set to 777 (world writable) and that the .htaccess file inside the folder says "Allow from All"

laxelrod 06-06-2007 08:26 AM

Re: Images won't show up after moving them...
 
I just want to make sure, is there any specific place within the ftp those folders should be? or can they be anywhere? and how do I set the folders to 777?

balinor 06-06-2007 08:30 AM

Re: Images won't show up after moving them...
 
The default location for images is the files/ directory. You set the permissions in your FTP client by right clicking on the folder usually.

laxelrod 06-06-2007 08:41 AM

Re: Images won't show up after moving them...
 
I changed the permissions and retried. Again, it gave me a ridiculously long list of images that failed to transfer and the image location still says database.

balinor 06-06-2007 09:17 AM

Re: Images won't show up after moving them...
 
I think perhaps you should open a ticket with X-Cart at this point.

laxelrod 06-06-2007 09:20 AM

Re: Images won't show up after moving them...
 
Alright, I'll do that. Thank you for all of your help.

herbj 11-10-2007 07:33 AM

Re: Images won't show up after moving them...
 
Quote:

Originally Posted by laxelrod
Alright, I'll do that. Thank you for all of your help.


Any luck with this issue,

I have tried to move my images per the thread here also. I have changed my file chmod to 777 and eliminated the .htaccess file will I tried the move. I get "failed" on all my images in the log.

My path is /home/xxxxxxx/ public_html / files / images_T for my thumbnails and images_D for detailed and images_C for category images.

Do just the new folders need the chmod changed to 777 or the entire tree?

Any help is appreciated.


All times are GMT -8. The time now is 02:00 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.