Gossamer Forum
Home : Products : Links 2.0 : Customization :

Widgetz's Expired Mod Question

Quote Reply
Widgetz's Expired Mod Question
Hi All,

I have a couple questions about Widgetz's Expired Link Mod. What is the date format to add in the add link? Like is it 06-11-01, 6-11-01, 6/11/01, etc...? And second, is there a way to make the script send the warning message to the link owner AND the admin, and is there a way to make it send daily messages starting a certin amount of days before the expiration date? Sorry, guess that's really more then "a couple" questions Blush.

Thanks,

Mike

Quote Reply
Re: Widgetz's Expired Mod Question In reply to
1) Uh...it is by days, not date (e.g., 1,14,30,60)
2) Copy the send_email code and re-name the new sub-routine send_copy. Change the $to configuration to $db_admin_email and change $from to the sender email address codes.

Regards,

Eliot Lee
Quote Reply
Re: Widgetz's Expired Mod Question In reply to
------------------------------------------------------------

2) Copy the send_email code and re-name the new sub-routine send_copy. Change the $to configuration to $db_admin_email and change $from to the sender email address codes.

------------------------------------------------------------

Is this in the nph-expired.cgi? The closest I can seem to find is:

------------------------------------------------------------

if ($expired{$values[$db_key_pos]}) {
$expired{$values[$db_key_pos]} = 0;
@{$info{$values[$db_key_pos]}} = @values;

if (!$in{'debug'} && $values[$db_contact_email]) {
$msg = $in{'message_to_email_body'};
$msg =~ s/%%ID%%/$values[0]/mig;
$msg =~ s/%Ętegory%%/$values[$db_category]/mig;
$msg =~ s/%%modified%%/$values[$db_modified]/mig;
$msg =~ s/%%url%%/$values[$db_url]/mig;
$msg =~ s/%%hits%%/$values[$db_hits]/mig;
$msg =~ s/%%isnew%%/$values[$db_isnew]/mig;
$msg =~ s/%%ispop%%/$values[$db_ispop]/mig;
$msg =~ s/%%contact_name%%/$values[$db_contact_name]/mig;
$msg =~ s/%%contact_email%%/$values[$db_contact_email]/mig;

# my $mailer = new Mailer ( { smtp => $db_smtp_server, sendmail => $db_mail_path, from => $db_admin_email, subject => $in{'message_to_email_subject'}, to => $values[$db_contact_email], msg => $msg, log => $db_mailer_log } ) or $status{$values[0]} = "Error";
# $mailer->send or $status{$values[0]} = "Error";
}
}
else {
$output .= "$_\n";
}
}
close DB;

------------------------------------------------------------

Has Always, Thanks For Your Help!

Mike


Quote Reply
Re: Widgetz's Expired Mod Question In reply to
Okay....

Copy the following codes:

Code:

if (!$in{'debug'} && $values[$db_contact_email]) {
$msg = $in{'message_to_email_body'};
$msg =~ s/%%ID%%/$values[0]/mig;
$msg =~ s/%Ętegory%%/$values[$db_category]/mig;
$msg =~ s/%%modified%%/$values[$db_modified]/mig;
$msg =~ s/%%url%%/$values[$db_url]/mig;
$msg =~ s/%%hits%%/$values[$db_hits]/mig;
$msg =~ s/%%isnew%%/$values[$db_isnew]/mig;
$msg =~ s/%%ispop%%/$values[$db_ispop]/mig;
$msg =~ s/%%contact_name%%/$values[$db_contact_name]/mig;
$msg =~ s/%%contact_email%%/$values[$db_contact_email]/mig;

# my $mailer = new Mailer ( { smtp => $db_smtp_server, sendmail => $db_mail_path, from => $values[$db_contact_email], subject => $in{'message_to_email_subject'}, to => $db_admin_email, msg => $msg, log => $db_mailer_log } ) or $status{$values[0]} = "Error";
# $mailer->send or $status{$values[0]} = "Error";
}
}


and paste them after the following codes:

Code:

# $mailer->send or $status{$values[0]} = "Error";
}
}


BTW: I did not see this Mod in your laundry list of requested Mods to install....Have you figured out the other Modifications already? That was quick. Wink

Regards,


Eliot Lee
Quote Reply
Re: Widgetz's Expired Mod Question In reply to
Hi Anthro,

Ok I added the code like so:

------------------------------------------------------------
# my $mailer = new Mailer ( { smtp => $db_smtp_server, sendmail => $db_mail_path, from => $db_admin_email, subject => $in{'message_to_email_subject'}, to => $values[$db_contact_email], msg => $msg, log => $db_mailer_log } ) or $status{$values[0]} = "Error";
# $mailer->send or $status{$values[0]} = "Error";
}
}


if (!$in{'debug'} && $values[$db_contact_email]) {
$msg = $in{'message_to_email_body'};
$msg =~ s/%%ID%%/$values[0]/mig;
$msg =~ s/%Ętegory%%/$values[$db_category]/mig;
$msg =~ s/%%modified%%/$values[$db_modified]/mig;
$msg =~ s/%%url%%/$values[$db_url]/mig;
$msg =~ s/%%hits%%/$values[$db_hits]/mig;
$msg =~ s/%%isnew%%/$values[$db_isnew]/mig;
$msg =~ s/%%ispop%%/$values[$db_ispop]/mig;
$msg =~ s/%%contact_name%%/$values[$db_contact_name]/mig;
$msg =~ s/%%contact_email%%/$values[$db_contact_email]/mig;
# my $mailer = new Mailer ( { smtp => $db_smtp_server, sendmail => $db_mail_path, from => $values[$db_contact_email], subject => $in{'message_to_email_subject'}, to => $db_admin_email, msg => $msg, log => $db_mailer_log } ) or $status{$values[0]} = "Error";
# $mailer->send or $status{$values[0]} = "Error";
}
}


else {
$output .= "$_\n";
}
}

------------------------------------------------------------

But when I run it I get:

------------------------------------------------------------

'D:\WWW\yourmaine\cgi-bin\links2\admin\nph-expired.cgi' script produced no output

------------------------------------------------------------

It was working, so I don't think it's the LWP.

------------------------------------------------------------

BTW: I did not see this Mod in your laundry list of requested Mods to install....Have you figured out the other Modifications already? That was quick.

------------------------------------------------------------

HA-HA, actually it was in the list, this is just to tweak the expiration date mod a little bit.

Thanks!

Mike



Quote Reply
Re: Widgetz's Expired Mod Question In reply to
Oops...the codes I gave you should have gone before the second right bracket....

Use the following codes:

Code:

if (!$in{'debug'} && $values[$db_contact_email]) {
$msg = $in{'message_to_email_body'};
$msg =~ s/%%ID%%/$values[0]/mig;
$msg =~ s/%Ętegory%%/$values[$db_category]/mig;
$msg =~ s/%%modified%%/$values[$db_modified]/mig;
$msg =~ s/%%url%%/$values[$db_url]/mig;
$msg =~ s/%%hits%%/$values[$db_hits]/mig;
$msg =~ s/%%isnew%%/$values[$db_isnew]/mig;
$msg =~ s/%%ispop%%/$values[$db_ispop]/mig;
$msg =~ s/%%contact_name%%/$values[$db_contact_name]/mig;
$msg =~ s/%%contact_email%%/$values[$db_contact_email]/mig;

my $mailer = new Mailer ( { smtp => $db_smtp_server, sendmail => $db_mail_path, from => $db_admin_email, subject => $in{'message_to_email_subject'}, to => $values[$db_contact_email], msg => $msg, log => $db_mailer_log } ) or $status{$values[0]} = "Error";

$msg = $in{'message_to_email_body'};
$msg =~ s/%%ID%%/$values[0]/mig;
$msg =~ s/%Ętegory%%/$values[$db_category]/mig;
$msg =~ s/%%modified%%/$values[$db_modified]/mig;
$msg =~ s/%%url%%/$values[$db_url]/mig;
$msg =~ s/%%hits%%/$values[$db_hits]/mig;
$msg =~ s/%%isnew%%/$values[$db_isnew]/mig;
$msg =~ s/%%ispop%%/$values[$db_ispop]/mig;
$msg =~ s/%%contact_name%%/$values[$db_contact_name]/mig;
$msg =~ s/%%contact_email%%/$values[$db_contact_email]/mig;

my $mailer = new Mailer ( { smtp => $db_smtp_server, sendmail => $db_mail_path, from => $values[$db_contact_email], subject => $in{'message_to_email_subject'}, to => $db_admin_email, msg => $msg, log => $db_mailer_log } ) or $status{$values[0]} = "Error";
}


BTW: Did you notice that you commented out the actual mailing codes???

You need to remove the # in order for messages to be sent.

Wink

Regards,


Eliot Lee
Quote Reply
Re: Widgetz's Expired Mod Question In reply to
I think that did it!

You da Man!

Thanks!

Mike

Quote Reply
Re: Widgetz's Expired Mod Question In reply to
Oh, one last (hopfully!) question about this mod. Is it still going to send the emails only the day they expire? I'd like to get it to start sending 2 weeks before that date and send them on a daily basis, if this is possable...

Thanks,

Mike

Quote Reply
Re: Widgetz's Expired Mod Question In reply to
You would have to write another script and use Cron to execute the script. Yet since you are on NT (virtual account), you will not be able to schedule the execution of the script....

See...you should really move to a UNIX server. Smile

Regards,

Eliot Lee
Quote Reply
Re: Widgetz's Expired Mod Question In reply to
------------------------------------------------------------

You would have to write another script and use Cron to execute the script.

------------------------------------------------------------
Now that stinks.....Shoot, I really need to be able to do this....

------------------------------------------------------------

Yet since you are on NT (virtual account), you will not be able to schedule the execution of the script....

------------------------------------------------------------
Ahh, but I'm not on a virtual account, I have a dedicated server so I can run stuff using MS schedule!

------------------------------------------------------------

See...you should really move to a UNIX server.

------------------------------------------------------------
Naw.... I like Windows! Cool

Thanks!

Mike



Quote Reply
Re: Widgetz's Expired Mod Question In reply to
I maintained a NT network of web servers for two years and it was much more challenging than UNIX.

Trust me!

Regards,

Eliot Lee
Quote Reply
Re: Widgetz's Expired Mod Question In reply to
You know how you get used to something, or doing something a certain way, and you just don't like to change? That's me and Windows. I went out and bought Red Hat Linux, but found it very archic (sp?). It seemed like working with really old Netware, worse then DOS ever was. I think it was mostly the lack of easy to access docs for it, the book that came with it sucked. Anyway, since this is a forum for Links Customization, and all of a sudden something's not working.....

I'm getting this error when running the Verifing Links:

'D:\WWW\yourmaine\cgi-bin\links2\admin\nph-verify.cgi' script produced no output

I havn't touched the nph-verify.cgi at all, but have added the following mods:

Expired Link
Upload Image
View/Delete Email Subscribers
Enhanced Template.pm

and added the code you posted for me to jump to the detailed page instead of to the link. If you can help me just tell me what else you need to know!

Thanks in advance!

Mike

Quote Reply
Re: Widgetz's Expired Mod Question In reply to
Look in your Perl Error Log and see if there are any other errors.

Check the require line to make sure that you have the complete ABSOLUTE path to the links.cfg file (includint the drive letter and paths....)

Example:

Code:

require "C:/InetPub/wwwroot/unixisbetter/windowssucks/cgi-bin/links/admin/links.cfg";


Wink

And when you added the following Mods, did you update your database to include two delimiters and default values for these new fields in your links.db file???

Expired Link
Upload Image

BTW: It is archaic.

Regards,

Eliot Lee
Quote Reply
Re: Widgetz's Expired Mod Question In reply to
Duh, that was stupid of me, guess it was because I was a little punchy due to lack of sleep yesterday or I should have figured that out myself. It was the require line, has soon has I put the full path it worked.

Anyway, I have a quick question that only has a round about involvment to this subject. Could you recommand a good BEGINERS book on Perl? Something for someone who doesn't already know any programming besides some basic HTML? I've bought books on Java and C++ and they all assume you already have some basic programming knowlege.

Thanks again, so far the mods haven't been too bad....

------------------------------------------------------------

require "C:/InetPub/wwwroot/unixisbetter/windowssucks/cgi-bin/links/admin/links.cfg";

------------------------------------------------------------

Laugh I didn't even notice the "directory path" till this morning, funny guy!

Mike




Quote Reply
Re: Perl book In reply to
You might want to try "Learning Perl, 2nd (or whatever it is now) Edition".

Quote Reply
Re: Perl book In reply to
Thanks for the info!

Mike

Quote Reply
Re: Widgetz's Expired Mod Question In reply to
Hey Anthro,

Got another (when don't I?) question. I want to be able to have a password option. When the link owner goes to the add a link they should have to input a password, and that password would be needed for modifying there link, they also can get their password via email if they forgot it. I know this has been done, but when I looked at all the different password mods I get lost. It seems like more then one mod has to be used to do this. Can you recommand one that does all this or tell me which ones have to be added to do all this?

Thanks!

Mike

Quote Reply
Re: Widgetz's Expired Mod Question In reply to
1) Modify Password Mod in the Resource Center for adding passwords to your links.def and also in your add and modify forms.

2) Link Lookup Information Mod in the Resource Center for allowing Link Owners to lookup their passwords.

Regards,

Eliot Lee
Quote Reply
Re: Widgetz's Expired Mod Question In reply to
Hi Anthro,

------------------------------------------------------------

1) Modify Password Mod in the Resource Center for adding passwords to your links.def and also in your add and modify forms.

2) Link Lookup Information Mod in the Resource Center for allowing Link Owners to lookup their passwords.

------------------------------------------------------------

I did this and now if I try and have the password emailed to me I get the following error in my browser:

Error Message : fatal error: Undefined subroutine &main::site_html_password_success called at D:\WWW\yourmaine\cgi-bin\links2\password.cgi line 115.

But the password was emailed to me. Any ideas?

Thanks,

Mike

Quote Reply
Re: Widgetz's Expired Mod Question In reply to
Uh...because you have NOT added all the subs in your site_html_templates.pl.

Undefined means NO sub routine defined in that .pl file.

Wink

Regards,

Eliot Lee
Quote Reply
Re: Widgetz's Expired Mod Question In reply to
Duh....Since my earlier failures at adding the mods I've taken to making a backup copy of the whole directory before I add the mod. Well, I uploaded a older copy of site_html_templates.pl, once I went snopping around I found the problem.

Thanks!

Mike

Quote Reply
Re: Widgetz's Expired Mod Question In reply to
You're welcome.

Regards,

Eliot Lee