Gossamer Forum
Home : Products : Links 2.0 : Customization :

Admin Addition

Quote Reply
Admin Addition
Normally Links2 only sends emails to users when their link has been added through add.pl and NOT through the admin.

I would like to know how I can enable a successful submission email when I manually add a link through the admin.
Quote Reply
Re: [troyid] Admin Addition In reply to
Here ya go

http://www.gossamer-threads.com/...i?post=150200#150200


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Admin Addition In reply to
Wink Thanks PerlFunkie. Exactly what I need. I have been searching the forums for this info for hours. Saved me more time.
Quote Reply
Re: [troyid] Admin Addition In reply to
In the thread you linked to it says:

You'll also need to change this line:
print VAL &join_encode(%in);
Cause at the moment it would add this mail field to the db.

What exactly do I need to change it to?
Quote Reply
Re: [LordStryfe] Admin Addition In reply to
Actually, ignore that. The first code (second post in that thread) would send you, the admin, and email when you, the admin, add a link. Not neccessary. Use the code in the post after that to send an email to the site owner of an added site when you, the admin, add it.


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Admin Addition In reply to
So what I'm looking for is the third post then to set the website owner know about the addition of their site?
Quote Reply
Re: [LordStryfe] Admin Addition In reply to
Look at yogi's posts, #3 and #5. This mod works fine, I use it.


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Admin Addition In reply to
I didn't fully understand where to put certain items in it so I gave up on it. If their a more detailed explaination of it as far as where to put the codes?
Quote Reply
Re: [LordStryfe] Admin Addition In reply to
Here is a copy of my sub, with the new code in red. I recall this part did take a bit of figurin', but the rest of it's pretty strightforward, I think.



sub html_add_form {
# --------------------------------------------------------
# The add form page where the user fills out all the details
# on the new record he would like to add. You should use
# &html_record_form to print out the form as it makes
# updating much easier. Feel free to edit &get_defaults
# to change the default values.
## next added LT admin-add emails link owner (aaelo)
my $radio_html;

if ($html_object eq "Link") {$radio_html = qq~
Email link owner: <input type="radio" name="emailowner" value="yes" checked>Yes
<input type="radio" name="emailowner" value="no">No~;}
else
{$radio_html = ""};
## end added LT aaelo


&html_print_headers();
print qq|
<html>
<head>
<title>$html_title: Add a New $html_object.</title>
</head>

<body bgcolor="#DDDDDD">
<form action="$db_script_url" method="POST">
<input type=hidden name="db" value="$in{'db'}">
<table border=1 bgcolor="#FFFFFF" cellpadding=5 cellspacing=3 width=500 valign=top>
<tr><td colspan=2 bgcolor="navy">
<FONT FACE="MS Sans Serif, arial,helvetica" size=1 COLOR="#FFFFFF">
<b>$html_title: Add a New $html_object</b>
</td></tr>
<tr><td>
<p><center><$font_title><b>
Add a New $html_object
</b></font></center><br>
<$font>
|; &html_record_form (&get_defaults); print qq|
</font></p>
$radio_html

<p><center> <INPUT TYPE="SUBMIT" NAME="add_record" VALUE="Add $html_object"> <INPUT TYPE="RESET" VALUE="Reset Form"></center></p>
|; &html_footer; print qq|
</td></tr>
</table>
</form>
</body>
</html>
|;
}

Do the same for the for the add_failure routine, and I think I also put it in the modify routine. This will put the select buttons just below the add form fields, but above the add button. Hope this helps...


Leonard
aka PerlFlunkie

Last edited by:

PerlFlunkie: Nov 30, 2003, 4:42 PM