PDA

View Full Version : Email


shelly
02-05-2007, 09:49 PM
Hi

I am showing the users Email on the details page - but how can I make it clickable please?

Dave Baker
02-05-2007, 10:17 PM
Go to Admin Panel » Manage Listing Fields » Add Field
Name: user_email_field
Title: User Email
Show On Pages: Suggest Listing/Listing Details
Required Field: No
Visible for admin only: No
Field Type: text
Field Length: 50
» "Add Field" button
***Open templates/yourTemplate/view-link.tpl and find code***

{foreach from=$fields item=field}
{assign var="key" value=$field.name}
<tr>
{assign var="field_name" value='field_'|cat:$field.name}
<td><strong>{$lang.$field_name}:</strong></td>
<td>
{if $link.$key || ($link.$key eq '0')}
{if ($field.type eq 'text') || ($field.type eq 'textarea')}
{if $config.html_tags}
{$link.$key}
{else}
{text_html aText=$link.$key}
{/if}
{elseif $field.type eq 'checkbox'}
{array_to_lang values=$link.$key name=$field.name}
{elseif $field.type eq 'storage'}
<a href="{$config.base}{$config.dir}uploads/{$link.$key}">{$lang.download}</a>
{elseif $field.type eq 'image'}
<img src="{$config.base}{$config.dir}uploads/{$link.$key}" width="{$field.image_width}" height="{$field.image_height}" />
{elseif $field.type eq 'combo'}
{assign var="field_combo" value="field_"|cat:$field.name|cat:'_'|cat:$link.$key}
{$lang.$field_combo}
{elseif $field.type eq 'radio'}
{assign var="field_radio" value="field_"|cat:$field.name|cat:'_'|cat:$link.$key}
{$lang.$field_radio}
{/if}
{else}
{$lang.not_available}
{/if}
</td>
</tr>
{/foreach}

***Replace with the following code***

{foreach from=$fields item=field}
{assign var="key" value=$field.name}
<tr>
{assign var="field_name" value='field_'|cat:$field.name}
<td><strong>{$lang.$field_name}:</strong></td>
<td>
{if $field.name eq 'user_email_field' AND $link.$key}
<a href="{$link.$key}">{$link.$key}</a>
<a href="mailto:{$link.$key}">{$link.$key}</a>
{elseif $link.$key || ($link.$key eq '0')}
{if ($field.type eq 'text') || ($field.type eq 'textarea')}
{if $config.html_tags}
{$link.$key}
{else}
{text_html aText=$link.$key}
{/if}
{elseif $field.type eq 'checkbox'}
{array_to_lang values=$link.$key name=$field.name}
{elseif $field.type eq 'storage'}
<a href="{$config.base}{$config.dir}uploads/{$link.$key}">{$lang.download}</a>
{elseif $field.type eq 'image'}
<img src="{$config.base}{$config.dir}uploads/{$link.$key}" width="{$field.image_width}" height="{$field.image_height}" />
{elseif $field.type eq 'combo'}
{assign var="field_combo" value="field_"|cat:$field.name|cat:'_'|cat:$link.$key}
{$lang.$field_combo}
{elseif $field.type eq 'radio'}
{assign var="field_radio" value="field_"|cat:$field.name|cat:'_'|cat:$link.$key}
{$lang.$field_radio}
{/if}
{else}
{$lang.not_available}
{/if}
</td>
</tr>
{/foreach}

***Save file***
Replace "user_email_field" in the code with your name of field.

omaron
02-05-2007, 10:46 PM
Hi

I am showing the users Email on the details page - but how can I make it clickable please?

I know is not my business.. but your users may not be happy with that.

Showing email, and makeing it even clickable, would allow spammer to easy harvest all the addresses and then filk their emails with junk.

shelly
02-05-2007, 10:51 PM
Hi Dave Many Thanks

But I want to display the email ( clickable ) that the user signs up with

I enabled it to show in the details page and the code you supplied I kept the oeiginal field "email"

It works bur there is now 2 email addresses shown instead of 1

The reason I want to do it this way rather than a custom email is because I want to retain the site email functions for it such as - confirmation emails etc

is there any way I can do this?

Many thanks for your help

shelly
02-05-2007, 11:01 PM
Good thinking Omaron

It never crossed my mind - you are right thank you

and ermmm Dave sorry for the trouble you went to - but please cancel that last request

Dave Baker
02-05-2007, 11:16 PM
ok,
***Open templates/yourTemplate/view-link.tpl and find code***

{foreach from=$fields item=field}
{assign var="key" value=$field.name}
<tr>
{assign var="field_name" value='field_'|cat:$field.name}
<td><strong>{$lang.$field_name}:</strong></td>
<td>
{if $link.$key || ($link.$key eq '0')}
{if ($field.type eq 'text') || ($field.type eq 'textarea')}
{if $config.html_tags}
{$link.$key}
{else}
{text_html aText=$link.$key}
{/if}
{elseif $field.type eq 'checkbox'}
{array_to_lang values=$link.$key name=$field.name}
{elseif $field.type eq 'storage'}
<a href="{$config.base}{$config.dir}uploads/{$link.$key}">{$lang.download}</a>
{elseif $field.type eq 'image'}
<img src="{$config.base}{$config.dir}uploads/{$link.$key}" width="{$field.image_width}" height="{$field.image_height}" />
{elseif $field.type eq 'combo'}
{assign var="field_combo" value="field_"|cat:$field.name|cat:'_'|cat:$link.$key}
{$lang.$field_combo}
{elseif $field.type eq 'radio'}
{assign var="field_radio" value="field_"|cat:$field.name|cat:'_'|cat:$link.$key}
{$lang.$field_radio}
{/if}
{else}
{$lang.not_available}
{/if}
</td>
</tr>
{/foreach}

***Replace with the following code***

{foreach from=$fields item=field}
{assign var="key" value=$field.name}
<tr>
{assign var="field_name" value='field_'|cat:$field.name}
<td><strong>{$lang.$field_name}:</strong></td>
<td>
{if $field.name eq 'email' AND $link.$key}
<a href="mailto:{$link.$key}">{$link.$key}</a>
{elseif $link.$key || ($link.$key eq '0')}
{if ($field.type eq 'text') || ($field.type eq 'textarea')}
{if $config.html_tags}
{$link.$key}
{else}
{text_html aText=$link.$key}
{/if}
{elseif $field.type eq 'checkbox'}
{array_to_lang values=$link.$key name=$field.name}
{elseif $field.type eq 'storage'}
<a href="{$config.base}{$config.dir}uploads/{$link.$key}">{$lang.download}</a>
{elseif $field.type eq 'image'}
<img src="{$config.base}{$config.dir}uploads/{$link.$key}" width="{$field.image_width}" height="{$field.image_height}" />
{elseif $field.type eq 'combo'}
{assign var="field_combo" value="field_"|cat:$field.name|cat:'_'|cat:$link.$key}
{$lang.$field_combo}
{elseif $field.type eq 'radio'}
{assign var="field_radio" value="field_"|cat:$field.name|cat:'_'|cat:$link.$key}
{$lang.$field_radio}
{/if}
{else}
{$lang.not_available}
{/if}
</td>
</tr>
{/foreach}

***Save file***

Dave Baker
02-05-2007, 11:20 PM
and ermmm Dave sorry for the trouble you went to - but please cancel that last request
Too late ,but it's ok. Maybe someone will need in this modification ;)