Gossamer Forum
Home : Products : Links 2.0 : Customization :

Put admin email in all pages

Quote Reply
Put admin email in all pages
Hello,

Can I put in all pages the administrator email with a tag like
<%build_email%> ?

How I can do it ?


Thanks
Quote Reply
Re: [carlosca] Put admin email in all pages In reply to
Like so... in db_utils.pl, just before the 1; at the bottom of the file, add this:


Code:

sub admin_email {
#----------------------------------------------------------------------
# put the admin email anywhere, called with <%admin_email%>
$output .= qq|<a href="mailto: admin\@yoursite.com">Send us a note!</a>|;
return $output;
}


Of course, change the green to whatever you want, but remeber to \escape the @. Then, look in site_html_templates.pl, and add this to the globals at the top of the file (remember to put a comma after what is currently last in the list, then add this under it with NO comma on the end):

admin_email => &admin_email


Leonard
aka PerlFlunkie

Last edited by:

PerlFlunkie: May 22, 2004, 12:40 PM
Quote Reply
Re: [PerlFlunkie] Put admin email in all pages In reply to
It occured to me later to do this:

$output .= qq|<a href="mailto: $db_admin_email">Send us a note!</a>|;

This will use the same address you set in links.cfg. The fewer places that there are variables to change, the better!Cool

You could also define a different address, if desired. In links.cfg, under

# Email address of the administrator. BE SURE TO SET!
$db_admin_email = '';

add something like...

# Email address for contact info. BE SURE TO SET!
$db_contact_email = '';

...then in the mailto code above, use $db_contact_email. This is so that you could have an address such as info @ whatever to keep your admin functions (add, etc) separate from general user contacts.


Leonard
aka PerlFlunkie

Last edited by:

PerlFlunkie: May 22, 2004, 2:37 PM