Home : Products : DBMan : Customization :

Products: DBMan: Customization: Re: [LoisC] Top 10 rcds and export to excel: Edit Log

Here is the list of edits for this post
Re: [LoisC] Top 10 rcds and export to excel
Lois,
Excuse me if I ramble ... My $countup ref's how many times a record has been viewed
Code:
print qq|
<TR>
<TD COLSPAN="100%"><center>This record has been viewed <b>$countup</b>
|;
if ($countup == 1) {
print "time.</td></tr>\n";
}
else {
print "times.</td></tr>\n";
}

My issue I think is the Top Ten routine that identifies which records have been accessed the most ...
Code:
sub html_topten {
#----------------
opendir (TEMPDIR, "$counter_dir");
@files = readdir(TEMPDIR);
closedir (TEMPDIR);
FILE: foreach $file (@files) {
next if ($file =~ /^\./);
next if ($file =~ /^index/);
next if ($file =~ /^iplog/);
open (COUNTER, "<$counter_dir/$file");
$count{$file} = int(<COUNTER> );
close COUNTER;
}
foreach $key (sort {$count{$b} <=> $count{$a} } keys %count) { push (@top_ten,$key); }
&html_print_headers;
$page_title="Top 10 Records";
&html_page_top;
print qq|
<table border="0" cellpadding="5" cellspacing="0" width="100%">
<tr>
<td align="center"><$font>Listing of the Top 10 visited records in the database.</td>
</tr>
<tr>
<td valign="top" colspan="3" width="100%"><font color="#003399" size="2" face="Verdana, Arial, Helvetica">
<table>
|;
for ($i=0;$i<10 ;$i++) { $toparray .= "$top_ten[$i],"; }
chop $toparray;
$row=0;
foreach my $toplist (split(/,/,$toparray)) {
%rec = (&get_record($toplist));
$row++;
print "<TR>";
if ($row == 1) {
print '<TD bgcolor=#DEDCDC>';
}
elsif ($row == 2) {
print '<TD bgcolor=#FFFFFF>';
$row=0;
}
if ($per_mem) {
print qq|
<a href="$db_script_link_url&$db_key=$rec{$db_key}&view_records=1&ww=1">$rec{'LastNameinSchool'}</a>
|;
}
else {
print qq|
$rec{'LastNameinSchool'}
|;
}
if ($rec{'Married Name'}) {
print "$rec{'Married Name'} ";
}
else {
print "&nbsp;";
}
if ($rec{'First Name (Nickname) & Spouses Name'}) {
print "$rec{'First Name (Nickname) & Spouses Name'} ";
}
else {
print "&nbsp;";
}
if ($rec{'YearGrad'}) {
print "$rec{'YearGrad'}";
}
else {
print "&nbsp;";
}
print "</TD></TR>\n";
}
print "</table>\n";
print qq|
</td>
</tr>
</table>
|;
&html_footer;
&html_page_bottom;
}

I see from the above where it's supposed to open a temp $counter_dir, but not sure I understand your
Quote:
download the counter files from the server

I don't see the counter dir w/FTP access--where are they in the tree?
Lastly, my FTP access shows me "256" in my default.count file, BUT, there's 674 records in the default.db ... BINGO????????.

Oh, I do have a sub validate_record { in db.cgi, but I don't think it's that validate mod yr talking about

So ... sorry for the rambling ... any of the above help ... or am I really hurting yr head at this point Crazy

Webmaster
http://www.izmirhigh.com/

Last edited by:

joebagodonuts: Aug 31, 2005, 4:14 PM

Edit Log: