Gossamer Forum
Home : Products : Links 2.0 : Customization :

Statistics to Owner

Quote Reply
Statistics to Owner
I'm using links 2.0 as an file archiv. So there is not only one "link owner" but many users uploading more than one file.

The srcipt owner-email.cgi (see attachment) sends one statistic to every link owner for every entry.
So a user on my site gets 50 emails when he was uploading 50 files Crazy

Is it possible to change the owner-email.cgi?
Every user should only get one email with the stats of all his files inside?

I think it's difficult, but may be someone has a solution!

Matthias

Matthias
gpaed.de

Last edited by:

Matthias70: Feb 5, 2006, 1:57 AM
Quote Reply
Re: [Matthias70] Statistics to Owner In reply to
Add something like this (from admin_html.pl, sub html_mail_form):

my (%tmp, %seen);
my ($status, @hits) = &query();
my ($numhits) = ($#hits+1) / ($#db_cols+1);
for (0 .. $numhits - 1) {
%tmp = &array_to_hash($_, @hits);
($seen{$tmp{$db_cols[$db_contact_email]}}++) ?
($audience .= qq!Owner of link ($tmp{$db_key}) is already being emailed.<br>!) :
($audience .= qq!<input type=checkbox name="$tmp{$db_key}" value="mail" checked> $tmp{$db_cols[$db_contact_name]} - $tmp{$db_cols[$db_contact_email]}<br>!);
}

The "seen" part compares the contact email addresses, and skips repeats. I did not study the code you attached... can you translate it to english?


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Statistics to Owner In reply to
In Reply To:
Add something like this (from admin_html.pl, sub html_mail_form):

my (%tmp, %seen);
my ($status, @hits) = &query();
my ($numhits) = ($#hits+1) / ($#db_cols+1);
for (0 .. $numhits - 1) {
%tmp = &array_to_hash($_, @hits);
($seen{$tmp{$db_cols[$db_contact_email]}}++) ?
($audience .= qq!Owner of link ($tmp{$db_key}) is already being emailed.
!) :
($audience .= qq!<input type=checkbox name="$tmp{$db_key}" value="mail" checked> $tmp{$db_cols[$db_contact_name]} - $tmp{$db_cols[$db_contact_email]}
!);
}

Hi Leonard, don't know if that's enough? Perhaps there is sent only one mail but is the info about the 50 files from this user in this mail, too? I tried to translate the german file (it's attached) Note: in german links version the %XXXX% are different to the english version. I tried to translate them to, but I dont know if they are correct.
Code:

my $message = qq|Hallo <%Name%>,
Email: <%Email%>
LinkID: <%ID%>
Datum der Eintragung: <%Date%>
Titel: <%Title%>
Beschreibung: <%Description%>
URL: <%URL%>
Kategorie: <%Category%>
Besuche: <%Visits%>
Your File was <%Vote%> times voted and is voted with <%Rating%>.




Matthias
gpaed.de
Quote Reply
Re: [Matthias70] Statistics to Owner In reply to
No, they would not receive info on all their uploads...

Take a look at these sites, they're in German...

http://www.links2x.de/.../downloads.php?cat=2
http://www.imagefolio.de/links_mods/

The first one used to have a LOT of mods available (in German), but it looks like they have changed their site around. The second one has templates, but may link to more.

I will look at the code you attached later... busy right now.


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Statistics to Owner In reply to
First link to the german forum is dead.
This forum does not exist anymore Unsure
This was the german links 2.0 reference.

The second link I know as well. But there are only templates and no links to more...

I'm not in hurry, thank you
Matthias

Matthias
gpaed.de