What I would like to to is to display some user account info on my home page.
Users are allowed a max of 5 recs, and I'm using your mod(JPD) to return the amount of used recs and what they have left, as per below.
$db_file_name.\nReason: $!");
if ($db_use_flock) { flock(DB, 1); }
$count = 0;
LINE: while (<DB> ) {
(/^#/) and next LINE;
(/^\s*$/) and next LINE;
$line = $_;
chomp ($line);
@data = &split_decode($line);
if ($data[$auth_user_field] eq $db_userid) {
++$count;
}
}
close DB;
$left = $db_maximum_records - $count;What I would like to do is to collect the dates of added recs, if any. I am also going to use the autodelete mod, which I havent yet Installed. That would be set to say 30days.
I would like to return that as well, which may be as simple as deducting 30days from the rec date.
Also I have a couple of if else statements based on $left, which work well, and I tried to do the same with the add link in html_footer, but I couldn't get it to work.
ie,
else {
print qq!| <A HREF="$db_script_link_url&add_form=1">Add</A> ! if ($per_add);}although it would have to stay there for admin.
This is 2 questions in 1, sorry
thanks
bob
Users are allowed a max of 5 recs, and I'm using your mod(JPD) to return the amount of used recs and what they have left, as per below.
Code:
open (DB, "<$db_file_name") or &cgierr("error in validate_records. unable to open db file: $db_file_name.\nReason: $!");
if ($db_use_flock) { flock(DB, 1); }
$count = 0;
LINE: while (<DB> ) {
(/^#/) and next LINE;
(/^\s*$/) and next LINE;
$line = $_;
chomp ($line);
@data = &split_decode($line);
if ($data[$auth_user_field] eq $db_userid) {
++$count;
}
}
close DB;
$left = $db_maximum_records - $count;
I would like to return that as well, which may be as simple as deducting 30days from the rec date.
Also I have a couple of if else statements based on $left, which work well, and I tried to do the same with the add link in html_footer, but I couldn't get it to work.
ie,
Code:
if ($left==5){} else {
print qq!| <A HREF="$db_script_link_url&add_form=1">Add</A> ! if ($per_add);}
This is 2 questions in 1, sorry
thanks
bob