Gossamer Forum
Home : Products : Links 2.0 : Discussions :

Requiring Email in admin add

Quote Reply
Requiring Email in admin add
Is there a way to NOT require putting a name and email when I am adding links within the admin script? It is annoying to have to do this during admin stuff.
Quote Reply
Re: [VirginiaB] Requiring Email in admin add In reply to
Yes, a little code hack.

In the db_utils.pl, sub build_html_record_form,

Add the two following line beneath the foreach loop

($field eq 'Contact Name' and $rec{$field} eq '') and ($rec{$field} ='tandat');
($field eq 'Contact Email' and $rec{$field} eq '') and ($rec{$field} ='tandat@atlas.com');

Hope this helps

Cheers,

Dat

Programming and creating plugins and templates
Blog
Quote Reply
Re: [tandat] Requiring Email in admin add In reply to
Mmm why not just change 1 to 0 in links.def Wink
Quote Reply
Re: [Paul] Requiring Email in admin add In reply to
hi,

>Mmm why not just change 1 to 0 in links.def

This will cause these empty fields when a user add a link in the add.cgi. Is that right?Smile

Cheers,

Dat

Programming and creating plugins and templates
Blog
Quote Reply
Re: [tandat] Requiring Email in admin add In reply to
Yeah but the question was:

>>
Is there a way to NOT require putting a name and email when I am adding links within the admin script?
<<
Quote Reply
Re: [Paul] Requiring Email in admin add In reply to
That's right. If he asked just in add link not in admin, I would tell him that or something else

Cheers,

Dat

Programming and creating plugins and templates
Blog
Quote Reply
Re: [tandat] Requiring Email in admin add In reply to
I don't understand what you mean.

To allow admin to add links without entering a name or email you just change the def.

I don't understand why you are disagreeing?
Quote Reply
Re: [Paul] Requiring Email in admin add In reply to
I don't know how to explain to you. To do your way will let the user does not input his/her name and email in the add link page

Cheers,

Dat

Programming and creating plugins and templates
Blog
Quote Reply
Re: [tandat] Requiring Email in admin add In reply to
So then that doesn't make sense as if users are forced to enter their name and email and then the administrator is just going to delete them before adding the record, what is the point in forcing it to be entered in the first place?

Maybe I just don't understand the qn.
Quote Reply
Re: [Paul] Requiring Email in admin add In reply to
Oh, my! :) I am the admin. What I want is NOT to have to enter my name and email every time I add a link to the database *from the admin script*. I do want(but can live with not having this) *users* to enter names and emails when adding links. That is why the hack of the script given to me. Unfortunately, I don't know Perl(or have a real sense of what a 'loop' is) so I am not sure I can do the hack.
Quote Reply
Re: [VirginiaB] Requiring Email in admin add In reply to
Virginia,

what you would like to achieve is actually quite easy (if I got you right). Smile

Change these two fields in links.def as follows:

'Contact Name' => [6, 'alpha', 40, 75, 1, 'CONTACT NAME', ''],
'Contact Email' => [7, 'alpha', 40, 75, 1, 'CONTACT EMAIL', '.+@.+\..+'],


In your admin panel the two fields will now display the values in capital letters (see above), change them to whatever you like. Webmasters however who submit their links can still enter their names and email addresses.
Quote Reply
Re: [Tho:mas] Requiring Email in admin add In reply to
That did it! Thanks !