NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Problems with a tpl file


Joined: 26 Nov 2006
Posts: 8
Reply with quote
Hi just upgraded and have a problem.
When editing a smarty template the cpu usage shoots up to 50-80% and locks up the editor.

using windows xp / pentium 4 3.06ghz 1gb ram

Anyone have any idea what the problem is?

Thanks.
Mike.
View user's profileFind all posts by mikedownSend private message
Veteran

Joined: 24 Jan 2006
Posts: 311
Reply with quote
Would it be possible to post the tpl file or even better a snippet of the code that causes this to happen? if you are a customer, you can submit it to the techsupport directly. Many thanks!
View user's profileFind all posts by yfaktorSend private message


Joined: 26 Nov 2006
Posts: 8
Reply with quote
Will post to support. Thanks
View user's profileFind all posts by mikedownSend private message


Joined: 26 Nov 2006
Posts: 8
Reply with quote
Err.. Where to I submit support and how do i find out if I have support included in my purchase?
Mike.
View user's profileFind all posts by mikedownSend private message


Joined: 26 Nov 2006
Posts: 8
Reply with quote
Found it, sorry for posts.
here's the template that's causing the crash.. its a skin from xcart.

thanks
mike.

Code:
{* $Id: buy_now.tpl,v 1.30.2.2 2006/06/14 11:06:25 max Exp $ *}
{if $product.price gt 0}
<form name="orderform_{$product.productid}_{$product.add_date}" method="post" action="{if $product.is_product_options eq 'Y' && $config.Product_Options.buynow_with_options_enabled eq 'Y'}product.php?productid={$product.productid}{else}cart.php?mode=add{/if}">
<input type="hidden" name="productid" value="{$product.productid}" />
<input type="hidden" name="cat" value="{$smarty.get.cat|escape:"html"}" />
<input type="hidden" name="page" value="{$smarty.get.page|escape:"html"}" />
{/if}

<table width="100%" cellpadding="0" cellspacing="0">
{if $product.price eq 0}
<tr>
   <td height="25">
{assign var="button_href" value=$smarty.get.page|escape:"html"}
{include file="buttons/buy_now.tpl" style="button" href="product.php?productid=`$product.productid`&cat=`$cat`&page=`$button_href`"}
   </td>
</tr>
{else}
{if $product.is_product_options ne 'Y' || $config.Product_Options.buynow_with_options_enabled ne 'Y'}
<tr>
{if $product.distribution eq "" and !($active_modules.Subscriptions ne "" and $products[product].catalogprice)}
   <td class="BuyNowQuantity">{$lng.lbl_quantity}</td>
   <td width="20%" nowrap="nowrap">
{if $config.General.unlimited_products ne "Y" and ($product.avail le 0 or $product.avail lt $product.min_amount)}
<b>{$lng.txt_out_of_stock}</b>
{else}
{if $config.General.unlimited_products eq "Y"}
{assign var="mq" value=$config.Appearance.max_select_quantity}
{else}
{math equation="x/y" x=$config.Appearance.max_select_quantity y=$product.min_amount assign="tmp"}
{if $tmp<2}
{assign var="minamount" value=$product.min_amount}
{else}
{assign var="minamount" value=1}
{/if}
{math equation="min(maxquantity+minamount, productquantity+1)" assign="mq" maxquantity=$config.Appearance.max_select_quantity minamount=$minamount productquantity=$product.avail}
{/if}
{if $product.min_amount le 1}
{assign var="start_quantity" value=1}
{else}
{assign var="start_quantity" value=$product.min_amount}
{/if}
{if $config.General.unlimited_products eq "Y"}
{math equation="x+y" assign="mq" x=$mq y=$start_quantity}
{/if}
<select name="amount">
{section name=quantity loop=$mq start=$start_quantity}
   <option value="{%quantity.index%}"{if $smarty.get.quantity eq %quantity.index%} selected="selected"{/if}>{%quantity.index%}</option>
{/section}
</select>
{/if}
   </td>
{else}
<tr style="display: none;">
   <td><input type="hidden" name="amount" value="1" /></td>
</tr>
{/if}
   <td class="BuyNowPrices">
<input type="hidden" name="mode" value="add" />
{include file="customer/main/product_prices.tpl" no_span=true}
   </td>
</tr>
{/if}
<tr>
   <td colspan="3">
{if $config.General.unlimited_products eq "Y" or ($product.avail gt 0 and $product.avail ge $product.min_amount)}
<br />

<table cellpadding="0" cellspacing="0">
<tr>
{if $js_enabled}
{if $special_offers_add_to_cart eq 'Y'} 
   <td>{include file="buttons/add_to_cart.tpl" style="button" href="javascript: document.orderform_`$product.productid`_`$product.add_date`.submit();"}</td>
{else}
   <td>{include file="buttons/buy_now.tpl" style="button" href="javascript: document.orderform_`$product.productid`_`$product.add_date`.submit();"}</td>
{/if}


{if ($login ne "" || $config.Wishlist.add2wl_unlogged_user eq 'Y') && $active_modules.Wishlist ne "" && $special_offers_add_to_cart eq "" && ($product.is_product_options ne 'Y' || $config.Product_Options.buynow_with_options_enabled ne 'Y')}
   <td style="padding-left: 20px;">
{include file="buttons/add_to_wishlist.tpl" style="button" href="javascript:document.orderform_`$product.productid`_`$product.add_date`.mode.value='add2wl'; document.orderform_`$product.productid`_`$product.add_date`.submit()"}
   </td>
{/if}
{else}
   <td>{include file="submit_wo_js.tpl" value=$lng.lbl_buy_now}</td>
{/if}
</tr>
</table>

{/if}
   </td>
</tr>
{if $product.min_amount gt 1}
<tr>
   <td colspan="3"><font class="ProductDetailsTitle">{$lng.txt_need_min_amount|substitute:"items":$product.min_amount}</font></td>
</tr>
{/if}
{/if}
</table>
{if $product.price gt 0}
</form>
{/if}

View user's profileFind all posts by mikedownSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8340
Reply with quote
What's wrong with this file?
I did not encounter any, loaded it in phped 4.6.2/4630, edited it for a while and so forth.
What PhpED version are you running?

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website
Hello.


Joined: 26 Nov 2006
Posts: 8
Reply with quote
That's exactly what I would like to know.

version: 4.6.2 4630

I've been using phped since before it was a nusphere product and up untill now never had a problem like this.

Mike.
View user's profileFind all posts by mikedownSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8340
Reply with quote
probably I did not make it clear.
I opened this file and worked with it for a while. NO PROBLEMS happened.
Would you try again and let me know after what specific step(s) the problem happens on your machine?

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 26 Nov 2006
Posts: 8
Reply with quote
1. open the file from with project, which file path is a mounted samba folder on a freebsd server sitting next to me.
2. edit.
3. cpu shoots up in the range of 50% to 80%
4. phped crashes.

There is svn folders within the filesystem, but it's only the phped process that shoots up.

It's a weird problem, I have around 30 development sites on 2 servers here and this is the only file that is causing the problem.



1.Uninstalled new version. (moved nusphere folder)
2. installed 4.01 and tried. no crash. file edited fine.
3. installed upgrade tried that file on any host that i have running xcart. skin/customer/main/buy_now.tpl (crashes)

I've tried sevaral variations of this , even just removing everything and just installing the upgrade.

I'm willing to do a go-to meeting to show you the error, it does not happen with the old version of phped, so it's definatly something with the new version.

Thanks
mike.
View user's profileFind all posts by mikedownSend private message


Joined: 26 Nov 2006
Posts: 8
Reply with quote
Even when I move the file to my desktop and edit from there... it crashes

Also, I use alt-f-s to save..
View user's profileFind all posts by mikedownSend private message
Veteran

Joined: 24 Jan 2006
Posts: 311
Reply with quote
Could you please submit .rip file (or .rip.gzip) which should have been generated in phped folder directly to the techsupport.
View user's profileFind all posts by yfaktorSend private message


Joined: 26 Nov 2006
Posts: 8
Reply with quote
no .rip or .rip.gzip in the phped folder.
View user's profileFind all posts by mikedownSend private message
Problems with a tpl file
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic