Gossamer Forum
Home : Products : DBMan : Customization :

Top 10 rcds and export to excel

Quote Reply
Top 10 rcds and export to excel
I'll prob get flamed for not doing the search, but I haven't been here in EONs, basically looking for which doc/search criteria to diagnose this...

1. My top 10 records mod now has the 3rd position as blank, others are fine. Where to look to fix?

2. Export to excel gives me the .csv file, but doesn't open Excel. Where to look?

JR
Webmaster
http://www.izmirhigh.com/
Quote Reply
Re: [joebagodonuts] Top 10 rcds and export to excel In reply to
JR:

The flamers are gone :)

1) This sounds like maybe your database file could have become corrupted? Which version of the top 10 are you using?

I prefer this version myself:

http://gossamer-threads.com/p/002878
Topic: Updated MOD: Top 10/Record Hit Counter (More Accurate)
TheFew May 06, 2000

2) I haven't used that mod, but I would think by searching the FAQ noted below you may be able to find your answer. The FAQ is now within a database and it's much easier to do a search and find solutions.

Hope this helps

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [joebagodonuts] Top 10 rcds and export to excel In reply to
OK, I'm back to this again...now the 5th row is blank, see it at http://www.izmirhigh.com/...default&topten=1 All I can think is there's some character in my default.db that DBMan is not liking.

What characters should NOT be used?
Webmaster
http://www.izmirhigh.com/

Last edited by:

joebagodonuts: Aug 29, 2005, 6:36 PM
Quote Reply
Re: [joebagodonuts] Top 10 rcds and export to excel In reply to
I'm thinking you may need to download the counter files from the server and then search to locate which record is not showing. Then check to see if it contains any weird characters. or if there is a blank record in the database.

Is it possible that this one record has been deleted but it's counter file is still there?

Are you using the validation mod and could it be that the record is not validated and therefore isn't displaying for that reason? To only display validated records I use:

if ($rec{'Validated'} eq 'Yes') {
print qq|<A HREF="$db_script_link_url&$db_key=$rec{$db_key}&view_records=1&ww=1">$rec{'Title'}</A> &nbsp; ($countup)<BR> |;
}

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] Top 10 rcds and export to excel In reply to
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
Quote Reply
Re: [joebagodonuts] Top 10 rcds and export to excel In reply to
Yes, the files i was referring to are the ones in your default.count file directory. You should be able to sort the list (by number) to see if any are missing.

If you added the mod after you already had records then those records could be missing a count file.

Not sure what else to suggest.

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/