Okay, I have done searches but haven't found this problem....I am using the 3-level new graphic usage mod. The only changes I made to it ending dates of 7/14/21 but only the first new graphic is showing. Does anyone know what might cause this?
check path to your images in site_html_templates. Find this:
$new_1 = qq|<img src="../images/new_1.gif" border="0" width=34 height=12 alt="New0-2" align="absmiddle">|;
$new_3 = qq|<img src="http://www.wincamcs.com/niweb/new_3.gif" border="0" width=34 height=12 alt="New3-7" align="absmiddle">|;
$new_7 = qq|<img src="http://www.wincamcs.com/niweb/new_7.gif" border="0" width=34 height=12 alt="New8-14" align="absmiddle">|;
then fix URL to your immages
www.midi-studio.com
$new_1 = qq|<img src="../images/new_1.gif" border="0" width=34 height=12 alt="New0-2" align="absmiddle">|;
$new_3 = qq|<img src="http://www.wincamcs.com/niweb/new_3.gif" border="0" width=34 height=12 alt="New3-7" align="absmiddle">|;
$new_7 = qq|<img src="http://www.wincamcs.com/niweb/new_7.gif" border="0" width=34 height=12 alt="New8-14" align="absmiddle">|;
then fix URL to your immages
www.midi-studio.com
Jul 5, 2001, 5:24 AM
Veteran / Moderator (18441 posts)
Jul 5, 2001, 5:24 AM
Post #4 of 10
Views: 2766
How about a URL? I bet you just need to rename the images to the place where the script is looking for them
Andy
webmaster@ace-installer.com
http://www.ace-installer.com
Andy
webmaster@ace-installer.com
http://www.ace-installer.com
Jul 5, 2001, 5:45 AM
Enthusiast (582 posts)
Jul 5, 2001, 5:45 AM
Post #5 of 10
Views: 2761
I think I got them all correct...:P...I did a cut-n-paste from the script into the address bar and they came off fine. I'll double-check everything again.
The site I'm working on is at: http://www.fanficweb.net/rpfdir/
I just took a closer look and it's obvious that it's not even calling on the 2nd/3rd graphic...that only the first graphic is coming up. I have been updating a number of sites but the update isn't showing up either. It did for the first week.
The site I'm working on is at: http://www.fanficweb.net/rpfdir/
I just took a closer look and it's obvious that it's not even calling on the 2nd/3rd graphic...that only the first graphic is coming up. I have been updating a number of sites but the update isn't showing up either. It did for the first week.
Jul 5, 2001, 9:07 AM
Enthusiast (582 posts)
Jul 5, 2001, 9:07 AM
Post #6 of 10
Views: 2751
Here are my changes as per the instruction for the 3-level new/updated mod...I can't spot any errors but maybe someone else can. Also, the New page is only showing news from the last seven days...I think it should show the last 21 days? On a side-note, I have done the 1 column category for the first page so site_html_templates.pl, sub site_print_cat is repeated as site_html_templates.pl, sub site_print_subcat with minto changes.
links.def
# Definition of your database file.
%db_def = (
ID => [0, 'numer', 5, 8, 1, '', ''],
Title => [1, 'alpha', 40, 75, 1, '', ''],
URL => [2, 'alpha', 40, 75, 1, '', '^http|news|mailto|ftp'],
Date => [3, 'date', 15, 15, 1, \&get_date, ''],
Category => [4, 'alpha', 0, 150, 1, '', ''],
AltCategories => [5, 'alpha', 0, 500, 0, '', ''],
Description => [6, 'alpha', '40x3', 500, 0, '', ''],
'Contact Name' => [7, 'alpha', 40, 75, 1, '', ''],
'Contact Email' => [8, 'alpha', 40, 75, 1, '', '.+@.+\..+'],
Hits => [9, 'numer', 10, 10, 1, '0', '\d+'],
isNew => [10, 'alpha', 0, 5, 0, 'No', ''],
isPopular => [11, 'alpha', 0, 5, 0, 'No', ''],
Rating => [12, 'numer', 10, 10, 1, 0, '^[\d\.]+$'],
Votes => [13, 'numer', 10, 10, 1, 0, '^\d+$'],
ReceiveMail => [14, 'alpha', 10, 10, 1, 'Yes', 'No|Yes'],
DateAdded => [15, 'date', 15, 15, 0, \&get_date, '']
);
# Field Number of some important fields. The number is from %db_def above
# where the first field equals 0.
$db_alt = 5;
$db_category = 4; $db_modified = 3; $db_url = 2;
$db_hits = 9; $db_isnew = 10; $db_ispop = 11;
$db_contact_name = 7; $db_contact_email = 8; $db_title = 1;
$db_votes = 13; $db_rating = 12; $db_mail = 14;
$db_dateadded = 15;
add.cgi
# Set modified and added date variables to today's date.
$in{$db_cols[$db_dateadded]} = $in{$db_cols[$db_modified]} = &get_date;
modify.cgi
# Print out the modified record to a "modified database" where it is stored until
# the admin decides to add it into the real database. Ensure we retain the original
# date the record was added.
$in{$db_cols[$db_dateadded]} = $original{'DateAdded'};
open (MOD, ">>$db_modified_name") or &cgierr("error in modify.cgi. unable to open modification database: $db_modified_name. Reason: $!");
flock(MOD, $LOCK_EX) unless (!$db_use_flock);
print MOD &join_encode(%in);
close MOD; # automatically removes file lock
nph_build.cgi, sub build_update_newpop:
# Now go through the links database and update new links, and
# add the hits.
open (DB, "<$db_file_name") or &cgierr("unable to open database: $db_file_name.\nReason: $!");
if ($db_use_flock) { flock(DB, 1); }
LINE: while (<DB>) {
/^#/ and next LINE; # Skip comment Lines.
/^\s*$/ and next LINE; # Skip blank lines.
chomp; # Remove trailing new line.
@values = &split_decode($_);
if ((!$values[$db_date]) || (!$values[$db_dateadded])) {
print "Warning: No date for line: $_. Skipping..\n" and next LINE;
}
# Calculate days old and then mark new.
$days = &days_old($values[$db_dateadded], $date);
($days <= $db_new_cutoff) and ($new_records{$values[$db_key_pos]}++);
nph_build.cgi, sub build_category_information:
# We also need to intialize a links counter for the category,
# flags for new or modified links, and date fields (set to 1-Jan-1990)
# in case there are no links in the category to get a date from.
$stats{$name}[0] = 0; # storage for number of links
$stats{$name}[1] = "1-Jan-1990"; # storage for date modified
$stats{$name}[2] = "1-Jan-1990"; # storage for date added
$stats{$name}[3] = "No"; # modified record flag
$stats{$name}[4] = "No"; # new record flag
nph_build.cgi, sub build_stats:
# Store the most recent modification date for links in this category.
if ((!$stats{$cat}[1]) ||
&compare_dates($values[$db_modified], $stats{$cat}[1])) {
$stats{$cat}[1] = $values[$db_modified];
}
# Store the most recent add date for links in this category.
if ((!$stats{$cat}[2]) ||
&compare_dates($values[$db_dateadded], $stats{$cat}[2])) {
$stats{$cat}[2] = $values[$db_dateadded];
}
# Is (modified) Date more recent than DateAdded?
if (&compare_dates($stats{$cat}[1], $stats{$cat}[2])) {
# Yes, so does it qualify as an "updated" link?
if (&days_old($stats{$cat}[1]) <= $db_new_cutoff) {
# Yes, so set updated link flag for this category.
$stats{$cat}[3] = "Yes";
}
}
# Is this a new link?
if (&days_old($stats{$cat}[2]) <= $db_new_cutoff) {
# Yes, so set new link flag for this category.
$stats{$cat}[4] = "Yes";
}
nph_build.cgi, sub build_new_page:
# Now we go through all the new_links (which are organized by category), and
# build the html in array indexed by date then category.
$total = 0;
CATEGORY: foreach $category (sort keys %new_links) {
LINK: for ($i = 0; $i < ($#{$new_links{$category}}+1) / ($#db_cols + 1); $i++) {
$total++;
%tmp = &array_to_hash ($i, @{$new_links{$category}});
${$link_output{$tmp{'DateAdded'}}}{$category} .= &site_html_link (%tmp) . "\n";
$span_totals{$tmp{'DateAdded'}}++;
}
}
site_html_templates.pl
$new_1 = qq|<img src="http://www.fanficweb.net/rpfdir/images/new_1.gif" border="0" width=28 height=11 alt="New0-7" align="absmiddle">|;
$new_3 = qq|<img src="http://www.fanficweb.net/rpfdir/images/new_3.gif" border="0" width=28 height=11 alt="New8-14" align="absmiddle">|;
$new_7 = qq|<img src="http://www.fanficweb.net/rpfdir/images/new_7.gif" border="0" width=28 height=11 alt="New15-21" align="absmiddle">|;
$updated = qq|<img src="http://www.fanficweb.net/rpfdir/images/updated.gif" width=60 height=12 border=0 alt="Updated" align="absmiddle">|;
site_html_templates.pl, sub site_html_link:
my %rec = @_;
my $days_old;
my $new_mod_img = "";
# Set new and pop to either 1 or 0 for templates.
# The record is either New, Updated, or neither. Only a New or Updated
# graphic can be displayed for a link, but never both.
# First, check to see if the link is new.
if ($rec{'isNew'} eq "Yes") {
# Calculate age of link based on Date Added, not Date Modified.
$days_old = &days_old($rec{'DateAdded'});
# Display appropriate New graphic based on age of link.
if ($days_old <= 7) { $new_mod_img = $new_1; }
elsif ($days_old <= 14) { $new_mod_img = $new_3; }
elsif ($days_old <= $db_new_cutoff) { $new_mod_img = $new_7; }
}
# If the link is not new, check to see if it has been updated.
elsif (&compare_dates($rec{'Date'}, $rec{'DateAdded'})) {
# Calculate age of link based on Date Modified, not Date Added.
$days_old = &days_old($rec{'Date'});
if ($days_old <= $db_new_cutoff) { $new_mod_img = qq~ $updated~; }
}
($rec{'isPopular'} eq 'Yes') ? ($rec{'isPopular'} = 1) : (delete $rec{'isPopular'});
return &load_template ('link.html', {
new_mod_img => $new_mod_img,
detailed_url => "$build_detail_url/$rec{'ID'}$build_extension",
%rec,
%globals
});
}
site_html_templates.pl, sub site_print_cat:
foreach $subcat (sort @subcat) {
my $mod = $stats{"$subcat"}[3];
my $new_add = $stats{"$subcat"}[4];
($description) = @{$category{$subcat}}[2];
# Then we print out the name linked, new if it's new, and popular if its popular.
$output .= qq|<td vAlign="top" width="33%">\n|;
$output .= qq|<a class="catlink" href="$url">$category_name</a>\n|;
$output .= qq|<small class="numlinks">($numlinks)</small> \n|;
if ($new_add eq "Yes") {
$days_old = &days_old($stats{"$subcat"}[2]);
if ($days_old <= 7) { $output .= qq| $new_1|; }
elsif ($days_old <= 14) { $output .= qq| $new_3|; }
elsif ($days_old <= 21) { $output .= qq| $new_7|; }
}
if ($mod eq "Yes") { $output .= qq~ $updated~; }
links.def
# Definition of your database file.
%db_def = (
ID => [0, 'numer', 5, 8, 1, '', ''],
Title => [1, 'alpha', 40, 75, 1, '', ''],
URL => [2, 'alpha', 40, 75, 1, '', '^http|news|mailto|ftp'],
Date => [3, 'date', 15, 15, 1, \&get_date, ''],
Category => [4, 'alpha', 0, 150, 1, '', ''],
AltCategories => [5, 'alpha', 0, 500, 0, '', ''],
Description => [6, 'alpha', '40x3', 500, 0, '', ''],
'Contact Name' => [7, 'alpha', 40, 75, 1, '', ''],
'Contact Email' => [8, 'alpha', 40, 75, 1, '', '.+@.+\..+'],
Hits => [9, 'numer', 10, 10, 1, '0', '\d+'],
isNew => [10, 'alpha', 0, 5, 0, 'No', ''],
isPopular => [11, 'alpha', 0, 5, 0, 'No', ''],
Rating => [12, 'numer', 10, 10, 1, 0, '^[\d\.]+$'],
Votes => [13, 'numer', 10, 10, 1, 0, '^\d+$'],
ReceiveMail => [14, 'alpha', 10, 10, 1, 'Yes', 'No|Yes'],
DateAdded => [15, 'date', 15, 15, 0, \&get_date, '']
);
# Field Number of some important fields. The number is from %db_def above
# where the first field equals 0.
$db_alt = 5;
$db_category = 4; $db_modified = 3; $db_url = 2;
$db_hits = 9; $db_isnew = 10; $db_ispop = 11;
$db_contact_name = 7; $db_contact_email = 8; $db_title = 1;
$db_votes = 13; $db_rating = 12; $db_mail = 14;
$db_dateadded = 15;
add.cgi
# Set modified and added date variables to today's date.
$in{$db_cols[$db_dateadded]} = $in{$db_cols[$db_modified]} = &get_date;
modify.cgi
# Print out the modified record to a "modified database" where it is stored until
# the admin decides to add it into the real database. Ensure we retain the original
# date the record was added.
$in{$db_cols[$db_dateadded]} = $original{'DateAdded'};
open (MOD, ">>$db_modified_name") or &cgierr("error in modify.cgi. unable to open modification database: $db_modified_name. Reason: $!");
flock(MOD, $LOCK_EX) unless (!$db_use_flock);
print MOD &join_encode(%in);
close MOD; # automatically removes file lock
nph_build.cgi, sub build_update_newpop:
# Now go through the links database and update new links, and
# add the hits.
open (DB, "<$db_file_name") or &cgierr("unable to open database: $db_file_name.\nReason: $!");
if ($db_use_flock) { flock(DB, 1); }
LINE: while (<DB>) {
/^#/ and next LINE; # Skip comment Lines.
/^\s*$/ and next LINE; # Skip blank lines.
chomp; # Remove trailing new line.
@values = &split_decode($_);
if ((!$values[$db_date]) || (!$values[$db_dateadded])) {
print "Warning: No date for line: $_. Skipping..\n" and next LINE;
}
# Calculate days old and then mark new.
$days = &days_old($values[$db_dateadded], $date);
($days <= $db_new_cutoff) and ($new_records{$values[$db_key_pos]}++);
nph_build.cgi, sub build_category_information:
# We also need to intialize a links counter for the category,
# flags for new or modified links, and date fields (set to 1-Jan-1990)
# in case there are no links in the category to get a date from.
$stats{$name}[0] = 0; # storage for number of links
$stats{$name}[1] = "1-Jan-1990"; # storage for date modified
$stats{$name}[2] = "1-Jan-1990"; # storage for date added
$stats{$name}[3] = "No"; # modified record flag
$stats{$name}[4] = "No"; # new record flag
nph_build.cgi, sub build_stats:
# Store the most recent modification date for links in this category.
if ((!$stats{$cat}[1]) ||
&compare_dates($values[$db_modified], $stats{$cat}[1])) {
$stats{$cat}[1] = $values[$db_modified];
}
# Store the most recent add date for links in this category.
if ((!$stats{$cat}[2]) ||
&compare_dates($values[$db_dateadded], $stats{$cat}[2])) {
$stats{$cat}[2] = $values[$db_dateadded];
}
# Is (modified) Date more recent than DateAdded?
if (&compare_dates($stats{$cat}[1], $stats{$cat}[2])) {
# Yes, so does it qualify as an "updated" link?
if (&days_old($stats{$cat}[1]) <= $db_new_cutoff) {
# Yes, so set updated link flag for this category.
$stats{$cat}[3] = "Yes";
}
}
# Is this a new link?
if (&days_old($stats{$cat}[2]) <= $db_new_cutoff) {
# Yes, so set new link flag for this category.
$stats{$cat}[4] = "Yes";
}
nph_build.cgi, sub build_new_page:
# Now we go through all the new_links (which are organized by category), and
# build the html in array indexed by date then category.
$total = 0;
CATEGORY: foreach $category (sort keys %new_links) {
LINK: for ($i = 0; $i < ($#{$new_links{$category}}+1) / ($#db_cols + 1); $i++) {
$total++;
%tmp = &array_to_hash ($i, @{$new_links{$category}});
${$link_output{$tmp{'DateAdded'}}}{$category} .= &site_html_link (%tmp) . "\n";
$span_totals{$tmp{'DateAdded'}}++;
}
}
site_html_templates.pl
$new_1 = qq|<img src="http://www.fanficweb.net/rpfdir/images/new_1.gif" border="0" width=28 height=11 alt="New0-7" align="absmiddle">|;
$new_3 = qq|<img src="http://www.fanficweb.net/rpfdir/images/new_3.gif" border="0" width=28 height=11 alt="New8-14" align="absmiddle">|;
$new_7 = qq|<img src="http://www.fanficweb.net/rpfdir/images/new_7.gif" border="0" width=28 height=11 alt="New15-21" align="absmiddle">|;
$updated = qq|<img src="http://www.fanficweb.net/rpfdir/images/updated.gif" width=60 height=12 border=0 alt="Updated" align="absmiddle">|;
site_html_templates.pl, sub site_html_link:
my %rec = @_;
my $days_old;
my $new_mod_img = "";
# Set new and pop to either 1 or 0 for templates.
# The record is either New, Updated, or neither. Only a New or Updated
# graphic can be displayed for a link, but never both.
# First, check to see if the link is new.
if ($rec{'isNew'} eq "Yes") {
# Calculate age of link based on Date Added, not Date Modified.
$days_old = &days_old($rec{'DateAdded'});
# Display appropriate New graphic based on age of link.
if ($days_old <= 7) { $new_mod_img = $new_1; }
elsif ($days_old <= 14) { $new_mod_img = $new_3; }
elsif ($days_old <= $db_new_cutoff) { $new_mod_img = $new_7; }
}
# If the link is not new, check to see if it has been updated.
elsif (&compare_dates($rec{'Date'}, $rec{'DateAdded'})) {
# Calculate age of link based on Date Modified, not Date Added.
$days_old = &days_old($rec{'Date'});
if ($days_old <= $db_new_cutoff) { $new_mod_img = qq~ $updated~; }
}
($rec{'isPopular'} eq 'Yes') ? ($rec{'isPopular'} = 1) : (delete $rec{'isPopular'});
return &load_template ('link.html', {
new_mod_img => $new_mod_img,
detailed_url => "$build_detail_url/$rec{'ID'}$build_extension",
%rec,
%globals
});
}
site_html_templates.pl, sub site_print_cat:
foreach $subcat (sort @subcat) {
my $mod = $stats{"$subcat"}[3];
my $new_add = $stats{"$subcat"}[4];
($description) = @{$category{$subcat}}[2];
# Then we print out the name linked, new if it's new, and popular if its popular.
$output .= qq|<td vAlign="top" width="33%">\n|;
$output .= qq|<a class="catlink" href="$url">$category_name</a>\n|;
$output .= qq|<small class="numlinks">($numlinks)</small> \n|;
if ($new_add eq "Yes") {
$days_old = &days_old($stats{"$subcat"}[2]);
if ($days_old <= 7) { $output .= qq| $new_1|; }
elsif ($days_old <= 14) { $output .= qq| $new_3|; }
elsif ($days_old <= 21) { $output .= qq| $new_7|; }
}
if ($mod eq "Yes") { $output .= qq~ $updated~; }
Jul 6, 2001, 8:13 AM
Enthusiast (582 posts)
Jul 6, 2001, 8:13 AM
Post #8 of 10
Views: 2730
Okay, let's try this....as a test, I went in and redid it for updated graphic only mod. I have the new cutoff set for 30 days but the new indicator is still showing up only for new within 7 days and the updated isn't showing up at all for sites that have been updated. I did change the cutoff in links.cfg for 30.
Jul 7, 2001, 10:42 AM
Enthusiast (582 posts)
Jul 7, 2001, 10:42 AM
Post #9 of 10
Views: 2713
Okay, I finally just went through and removed all coding for the 3-level new/updated. I want the sites to stay new for 30 days and have changed the cutoff in links.cfg but the new indicator still dissappears after 7 days. Does anyone have any ideas as to what might cause this and how I can fix it?
Aug 15, 2001, 1:56 PM
Novice (11 posts)
Aug 15, 2001, 1:56 PM
Post #10 of 10
Views: 2676
I've had this script installed for several months and all links graphics are working fine. I've re-checked the mods to each sub routine and all looks fine.....but I cannot get any new or pop icons to display next to the Category names. If it works for the Links, why wouldn't it work for the Categories? I want the New/Pop icons to show up next to any Category names that hold new links within them. Any suggestions????