PDA

View Full Version : Pictures


Viszt Peter
06-17-2006, 01:36 PM
Can I do this?

http://kepfeltoltes.hu/060617/8875784931_www.kepfeltoltes.hu_.jpg

http://kepfeltoltes.hu/060617/8757806792_www.kepfeltoltes.hu_.jpg

Nick Collins
06-19-2006, 06:11 AM
Hello Viszt Peter! Here is a solution for you:
1) Create new text field via admin CP with name "image". "Suggest Link" and "Link Details" should must be marked. "Field default value" should be equal "http://"

2) Add the following line to your language file:
'image' => 'Picture',
3)
***open templates/TemplateName/view-link.tpl***
***find the following code***
<!-- START LINK FIELDS DISPLAY -->
{foreach from=$fields item=field}
{assign var="key" value=$field.name}
<tr>
<td><strong>{$lang.$key}:</strong></td>
<td>
{if $link.$key}
{if $field.type eq 'textarea' AND $config.esc_codes}
{text_to_html aText=$link.$key aParagraph=true}
{elseif $field.type eq 'checkbox'}
{array_to_lang values=$link.$key}
{else}
{if ($link.$key eq $field.default) AND (($field.type neq 'textarea') AND ($field.type neq 'text'))}
{assign var="lang_key" value=$field.default}
{$lang.$lang_key}
{else}
{if ($field.type neq 'textarea') AND ($field.type neq 'text')}
{assign var="lang_key" value=$link.$key}
{$lang.$lang_key}
{else}
{$link.$key}
{/if}
{/if}
{/if}
{else}
{$lang.not_available}
{/if}
</td>
</tr>
{/foreach}
<!-- END LINK FIELDS DISPLAY --> ***replace with***
<!-- START LINK FIELDS DISPLAY -->
{foreach from=$fields item=field}
{assign var="key" value=$field.name}
<tr>
<td><strong>{$lang.$key}:</strong></td>
<td>
{if $link.$key}
{if $field.type eq 'textarea' AND $config.esc_codes}
{text_to_html aText=$link.$key aParagraph=true}
{elseif $field.type eq 'checkbox'}
{array_to_lang values=$link.$key}
{else}
{if ($link.$key eq $field.default) AND (($field.type neq 'textarea') AND ($field.type neq 'text'))}
{assign var="lang_key" value=$field.default}
{$lang.$lang_key}
{else}
{if ($field.type neq 'textarea') AND ($field.type neq 'text')}
{assign var="lang_key" value=$link.$key}
{$lang.$lang_key}
{else}
{if $field.name eq 'image' && $field.value neq 'http://'}<img src="{$link.image}" />{else}{$link.$key}{/if}
{/if}
{/if}
{/if}
{else}
{$lang.not_available}
{/if}
</td>
</tr>
{/foreach}
<!-- END LINK FIELDS DISPLAY --> ***save changes***

That's all!