PDA

View Full Version : bug in suggest-link.tpl


wasserfall
01-07-2007, 10:34 AM
hi folks!

I think I found a bug, but need help fixing it.

I will try to explain the poroblem.
I translated nearly all the english to german language sql-file, and have translated the entries description, title, backlink, pp.
On the suggest link page suggest-link.tpl (I use the pornstar one) the translated name_var dont show up.
I had a look at the html-code and couldnt find the "$lang." variable in the following scriptcode, maybe its missing.

You can see the problem @ http://www.wasserfall-server.de/lovelist-de/suggest-link.php?id=0



The code (from suggest-link.tpl):

{foreach from=$fields item=field}
{assign var="key" value=$field.name}

{if ($key eq 'email') AND $editor}
<input type="hidden" name="email" value="{$editor.email}" id="{$key}" />
{else}
<p class="field">
{assign var="field_title" value="field_"|cat:$field.name}
<strong>{$lang.$field_title}:</strong><br />
{/if}

{if $field.type eq 'text'}
{if $key eq 'email' AND $editor}
{else}
<input type="text" name="{$key}" value="{if $link.$key}{$link.$key}{else}{$field.default}{/if}" size="30" id="{$key}" /><br />
{/if}
{elseif $field.type eq 'textarea'}
{if $field.name eq 'description'}
<textarea name="description" cols="60" rows="8" onKeyDown="textCounter(document.suggest_link.description,docu ment.suggest_link.length,{$config.description_max_ chars})" onKeyUp="textCounter(document.suggest_link.description,docu ment.suggest_link.length,{$config.description_max_ chars})">{if $link.$key}{$link.$key}{else}{$field.default}{/if}</textarea><br />
<input type="text" name="length" size="3" maxlength="3" value="{$config.description_max_chars}" readonly /> {$lang.characters_left}<br />
{else}
<textarea name="{$key}" cols="60" rows="8" id="{$key}">{if $link.$key}{$link.$key}{else}{$field.default}{/if}</textarea><br />
{/if}
{elseif $field.type eq 'combo'}
<select name="{$field.name}">
{if $link.$key || ($link.$key eq '0')}
{assign var="def_combo" value=$link.$key}
{else}
{assign var="def_combo" value=$field.default}
{/if}
{foreach from=$field.values item=combo name=combo_field}
{if $combo eq $def_combo}
{assign var="selected" value='selected="selected"'}
{else}
{assign var="selected" value=''}
{/if}
{assign var="field_title_val" value='field_'|cat:$field.name|cat:'_'|cat:$smarty .foreach.combo_field.iteration-1}
<option value="{$combo}" {$selected}>{$lang.$field_title_val}</option>
{/foreach}
</select>
{elseif $field.type eq 'radio'}
{if $link.$key || ($link.$key eq '0')}
{assign var="def_radio" value=$link.$key}
{else}
{assign var="def_radio" value=$field.default}
{/if}
{foreach from=$field.values item=radio name=radio_field}
{if $radio eq $def_radio}
{assign var="checked" value='checked="checked"'}
{else}
{assign var="checked" value=''}
{/if}
{assign var="field_title_val" value='field_'|cat:$field.name|cat:'_'|cat:$smarty .foreach.radio_field.iteration-1}
<input type="radio" name="{$key}" value="{$radio}" id="r{$radio}" {$checked}/><label for="r{$radio}">{$lang.$field_title_val}</label>
{/foreach}
{elseif $field.type eq 'checkbox'}
{if $link.$key || ($link.$key eq '0')}
{assign var="def_check" value=$link.$key}
{else}
{assign var="def_check" value=$field.default}
{/if}
{foreach from=$field.values item=checkbox name=checkbox_field}
{in_array_exist values=$def_check def=$checkbox}
{if $result_valid}
{assign var="checked" value='checked="checked"'}
{else}
{assign var="checked" value=''}
{/if}

{assign var="field_title_val" value='field_'|cat:$field.name|cat:'_'|cat:$smarty .foreach.checkbox_field.iteration-1}
<input type="checkbox" name="{$key}[]" value="{$checkbox}" id="ch{$checkbox}" {$checked} /><label for="ch{$checkbox}">{$lang.$field_title_val}</label>
{/foreach}
{elseif $field.type eq 'storage'}
<input type="file" name="{$key}" id="{$key}" size="30" />
{elseif $field.type eq 'image'}
<input type="file" name="{$key}" id="{$key}" size="30" />
{/if}</p>
{/foreach}


Thanks for your help.
Jan

Dave Baker
01-08-2007, 05:37 PM
Hello wasserfall,
It's not bug in template or in suggest-link.tpl, you've lost some data at translating. You had same problem here: http://www.esyndicat.com/forum/showthread.php?t=8277&highlight=german
Please try it:
Go to Admin Panel » Language Manager » Add Phrase
Key: field_title
Value: German Equivalent Title Field Name
Language: yourGermanFileName
Category: common
Key: field_description/field_url/field_reciprocal and ....
Value: German Equivalent Description/ Listing URL/Reciprocal URL and .... Field Name
Language: yourGermanFileName
Category: common
Please use search in phrases for searching necessary key.
p.s. It seems you have same problem with bottom menu.

wasserfall
01-14-2007, 10:59 AM
thanks dave for your help.

I had a look at the problem with botton menue, and you are right.
The problem is, that I dont know the varables that I have to re-name into german in the language panel.

I had a look at the footer.tpl, but could figureout which I would have to change. Because you can name the titles at the page manaager, and all pages are active.

Could you tell me which ones I would have to change? I have added the var. "page_title", but nothing seems to change.

Thanks,
Jan

{foreach from=$menus item=menu_item name=bottom_menus}

{in_array_exist def=2 values=$menu_item.menus}
{if $result_valid}
{assign var="inc" value=$inc+1}
{if $inc eq $menu_item.num_bottom}
{assign var="divider" value=""}
{else}
{assign var="divider" value=" | "}
{/if}

{assign var="page_title" value='page_'|cat:$menu_item.id|cat:'_name'}
{if $menu_item.unique_url}
<a href="{$menu_item.unique_url}"{if $menu_item.nofollow eq '1'} rel="nofollow"{/if}>{$lang.$page_title}</a>
{else}
{if $config.mod_rewrite}
<a href="{$config.base}{$config.dir}p{$menu_item.name}.html"{if $menu_item.nofollow eq '1'} rel="nofollow"{/if}>{$lang[$page_title]}</a>
{else}
<a href="{$config.base}{$config.dir}page.php?name={$menu_it em.name}"{if $menu_item.nofollow eq '1'} rel="nofollow"{/if}>{$lang[$page_title]}</a>
{/if}
{/if}
{$divider}
{/if}
{/foreach}

Dave Baker
01-15-2007, 12:14 AM
Hello wasserfall,
I have found information connected with the standard menu, but here all variables related in the script with bottom menu .
key/Value/Category

page_19_name / About Us / Common
page_19_content / About Us Content Page / Common
about / About Us / User Frontend

page_22_name / Contact Us / Common
contact_us / Contact Us / User Frontend
transaction_failed / Transaction failed! / Please contact us! User Frontend

manage_news / Manage News / Administration Board
page_21_name / News / Common
news_added / News added. / Administration Board
news / News / Common
no_news / No news. Click here to add news. / Administration Board
news / News / User Frontend
no_news / No news. / User Frontend
view_news / View news

page_17_name / Privacy Policy / Common
page_17_content / Privacy Policy Page Content / Common
policy / Privacy Policy / User Frontend

page_16_name / Terms Of Use / Common
page_16_content / Terms Of Use Page Content / Common
terms / Terms of Use / User Frontend

help / Help / Common
page_18_name / Help / Common
page_18_content / Help Page Content / Common
help / Help / User Frontend
help_content / Here you should place short or long help. / User Frontend

page_20_name / Tell A Friend / Common
tell_friend / Tell a Friend / User Frontend

page_15_name / Advertise With Us / Common
page_15_content / Advertise With Us Page Content / Common
advertise / Advertise with Us / User Frontend