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?


All times are GMT -8. The time now is 02:03 PM.

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