Gossamer Forum
Home : Products : Links 2.0 : Discussions :

new link notification to specific person

Quote Reply
new link notification to specific person
how can I make it that a link that is suggested by a user will be send to me while a link which belongst to a different (sub-)category will be send to my co-worker(s)

It would be good if I'm able to set this in the admin area

can anyone help me with this problem?

Quote Reply
Re: new link notification to specific person In reply to
Code:

if ($in{'Category'} eq "Something") {
&send_coworker_email;
}
else {
&send_email;
}


in the add.cgi script....look for &send_email; codes and replace them with the codes above.

Copy the sub send_email subroutine and name it sub send_coworker_email YET in this new subroutine change $db_admin_email to your co-worker's email address....or you could define the following variable in the links.cfg file:

Code:

$db_coworker_email = 'something@yourdomain.com';


Regards,

Eliot Lee
Quote Reply
Re: new link notification to specific person In reply to
thx - i will try it a soon as possible - but do I have to enter the code for every category or is it also for all the subcategories?

And is this right - If I have more than one co-workers tha I have to reneme &send_coworker_email eg. in &send_coworker1_email, &send_coworker2_email and so on?

Sorry for the questions but I am a beginner in doing sth like this
Quote Reply
Re: new link notification to specific person In reply to
In Reply To:
thx - i will try it a soon as possible - but do I have to enter the code for every category or is it also for all the subcategories?
You could...but putting the categories into an array in the links.cfg file would be much easier.

In Reply To:
And is this right - If I have more than one co-workers tha I have to reneme &send_coworker_email eg. in &send_coworker1_email, &send_coworker2_email and so on?
Well, if you are sending notification to different co-workers for different categories, then yes.

Regards,

Eliot Lee
Quote Reply
Re: new link notification to specific person In reply to
In Reply To:
You could...but putting the categories into an array in the links.cfg file would be much easier.
ok i'm a totally beginner in perl, cgi and co - all that i did before i tried links 2.0 was hacking an freeware version of an UBB - and that only with help of some friends who helped me when sth went wrong (and that was quite a little often) - so what do you mean with array? - is that sth mith an $ in front of the code - and how does this work - sorry but as I said I'm a totally beginner in that

Quote Reply
Re: new link notification to specific person In reply to
ARRAY...

Code:

@coworkers = ('worker1@domain.com','worker2@domain.com');


Now you will need to pull this array into a hash to send the emails out to the prospective coworkers...look at the built-in sub array_to_hash routine in the db_utils.pl or db.pl file.

Regards,

Eliot Lee
Quote Reply
Re: new link notification to specific person In reply to
OK I will try it as fast as i can solve thisproblem - as I tested links2.0 offline all was fin but now I got the following error message:

Error including libraries: Can't locate /alex/links/cgi-bin/admin/db.pl in @INC (@INC contains: /usr/lib/perl5/5.005/i386-linux /usr/lib/perl5/5.005 /usr/local/lib/site_perl/i386-linux /usr/local/lib/site_perl /usr/lib/perl5 .) at admin.cgi line 28.

Make sure they exist, permissions are set properly, and paths are set correctly.

although i did everything what the readme said - i uploaded everything in ascii, i changed the chmods, I edited the links.cfg ....

My hoster ist www.GNW.de - maybe someone has similar problems with links

but there did it get these /alex/links/cgi-bin/admin/db.pl - i didn't found any /alex/... in any of the files after editing the links.cfg

Quote Reply
Re: new link notification to specific person In reply to
ok now i changen once again the chmods and now I get an Internal server error (HTTP 500) (I changed the cgi to 777 and then back to 755)

Quote Reply
Re: new link notification to specific person In reply to
i don't know what I did but now it works - so I will try your hint about the array and so on

@AnthroRules: OK I read the first code you posted here - that one with the change of &send_email; - but if I have to enter every category - or better subcategory than i have a large list of the same code with only one veriable change (the 'something' if i understood it right) - but is there a chance that i can enter a placeholder there so that i can enter an asterix (*) there and it knows he has to send all new links which were submitted for the subcategories to the person who is responsible for the main categoriy (eg I have a category games with subcategories 3d-action, strategy, rpgs.... and in this categories lets take 3d-action i have subcategories like ut, quake, doom... and eg in ut i have the following subcategories clans, maps, newspages,mods,) - you see there are a lot of subcategories in each category - and if I have to enter everything myself in the add.cgi then i'd have a really large add.cgi (and possible slow add.cgi)

or my secound thought was - if you don't use placeholder - then let them only submit pages in the main category (I mean that if you click on add a resource/link then in the drop down box appears only the main category - except the whole subcategories - so the editor of the category can decide by himself where the link should be)

But it would be nice if you could tell me where excactly I have to modify the files - in eather the first or the second case

cYa
DW