How do you add the grand total of links in the database to the left frame of the admin area?
Jul 1, 2000, 11:19 AM
Veteran (17240 posts)
Jul 1, 2000, 11:19 AM
Post #2 of 6
Views: 1570
Read the following FAQ, which is linked in the Resource Center (You will have to tweak the codes a bit to work in the admin_html.pl file.)
http://www.anthrotech.com/cgi/links/faqs/numbers/
Have you even been to the Resource Center? Doesn't seem like it.
Regards,
Eliot Lee
http://www.anthrotech.com/cgi/links/faqs/numbers/
Have you even been to the Resource Center? Doesn't seem like it.
Regards,
Eliot Lee
Jul 1, 2000, 11:33 AM
Novice (17 posts)
Jul 1, 2000, 11:33 AM
Post #3 of 6
Views: 1565
I have looked there, I have been trying for a few hours to get that 'sub numlinks' thing to work in admin_html.pl, and I can't seem to get it to work, tried [uttin it in db_utils.pl and that and still no luck.
That's why I am posting here, hoping that someone can give me some advice on how I can do it.
That's why I am posting here, hoping that someone can give me some advice on how I can do it.
Jul 1, 2000, 11:39 AM
Veteran (17240 posts)
Jul 1, 2000, 11:39 AM
Post #4 of 6
Views: 1563
Okay...well the next thing you should've done is search the forum (because I have posted the codes for the admin_html.pl about three times in the past two months)!
Okay...for the third time....
1) Add the following in your admin_html.pl file:
sub numlinks {
#------------------------------------------------------------------
# Displays number of links
my $count = 0;
open (DB, "<$db_links_name") or
&cgierr("error in numlinks. unable to open database:$db_links_name.\nReason:
$!");
LINE: while (<DB> ) {
if (!(/^#/) && !(/^\s*$/)) {
$line = $_;
chomp ($line);
@fields = &split_decode ($line);
++$count;
}
}
close DB;
return $count;
}
2) Then add the following codes in any of the pages in the admin_html.pl where you want the total number of links to appear:
|;
print &numlinks;
print qq|
Got it?
Eliot Lee
Okay...for the third time....
1) Add the following in your admin_html.pl file:
Code:
sub numlinks {
#------------------------------------------------------------------
# Displays number of links
my $count = 0;
open (DB, "<$db_links_name") or
&cgierr("error in numlinks. unable to open database:$db_links_name.\nReason:
$!");
LINE: while (<DB> ) {
if (!(/^#/) && !(/^\s*$/)) {
$line = $_;
chomp ($line);
@fields = &split_decode ($line);
++$count;
}
}
close DB;
return $count;
}
2) Then add the following codes in any of the pages in the admin_html.pl where you want the total number of links to appear:
Code:
|;
print &numlinks;
print qq|
Got it?
Eliot Lee