Gossamer Forum
Home : Products : Links 2.0 : Customization :

Error in Site_Html_Templates.pl

Quote Reply
Error in Site_Html_Templates.pl
I am installing a new links due to a problem with the old one and have rung into a problem that seems to be related to the NEW & Updated Mod. This is the error I get:
Error including libraries: syntax error at D:/domains/speedo/cgi-bin/links/admin/site_html_templates.pl line 35, near "qq| |;" syntax error at D:/domains/speedo/cgi-bin/links/admin/site_html_templates.pl line 114, near ")" Make sure they exist, permissions are set properly, and paths are set correctly.

And I am including the line area that is affected:


%globals = (

$new_1 = qq|<img src="../Images/Buttons/new_1.gif" border="0" width=34 height=12 alt="New0-2" align="middle">|;

$new_3 = qq|<img src="../Images/Buttons/new_3.gif" border="0" width=34 height=12 alt="New3-7" align="middle">|;

$new_7 = qq|<img src="../Images/Buttons/new_7.gif" border="0" width=34 height=12 alt="New8-14" align="middle">|;

$updated = qq|<img src="../Images/Buttons/updated.gif" width=34 height=12 border=0 alt="Updated" align="middle">|;



date => &get_date,
time => &get_time,
db_cgi_url => $db_cgi_url,
build_root_url => $build_root_url,

site_title => $build_site_title,
color1 => $color1,
color2 => $color2,
color3 => $color3,
color4 => $color4,
color5 => $color5,
color6 => $color6,
color7 => $color7,

bkgd => $bkgd,

special1 => $special1,
special2 => $special2,
special3 => $special3,
special4 => $special4,
special_url1 => $special_url1,
special_url2 => $special_url2,
special_url3 => $special_url3,
special_url4 => $special_url4,

logob => $logob,
logos => $logos,

event => $event,
event_url => $event_url,
event_desc => $event_desc,

copyright => $copyright,

feature1 => $feature1,
feature2 => $feature2,
feature3 => $feature3,
feature4 => $feature4,
feature_desc1 => $feature_desc1,
feature_desc2 => $feature_desc2,
feature_desc3 => $feature_desc3,
feature_desc4 => $feature_desc4,
feature_url1 => $feature_url1,
feature_url2 => $feature_url2,
feature_url3 => $feature_url3,
feature_url4 => $feature_url4,
feature_more => $feature_more,
feature_more_url => $feature_more_url,

news1 => $news1,
news2 => $news2,
news3 => $news3,
news4 => $news4,
news_url1 => $news_url1,
news_url2 => $news_url2,
news_url3 => $news_url3,
news_url4 => $news_url4,
news_more => $news_more,
news_more_url => $news_more_url,

highlight1 => $highlight1,
highlight2 => $highlight2,
highlight_url1 => $highlight_url1,
highlight_url2 => $highlight_url2,
highlight_desc1=> $highlight_desc1,
highlight_desc2=> $highlight_desc2,
css => $build_css_url,


);

Please help with this if you can!

Kurt
Quote Reply
Re: Error in Site_Html_Templates.pl In reply to
The links to the NEW Graphics has to be out of the global settings. Put the codes before the %globals = {. The NEW graphics are NOT global variables.

Regards,

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
Quote Reply
Re: Error in Site_Html_Templates.pl In reply to
Eliot,

Thanks, that almost worked. It did resolve that error but now I get:

including libraries: syntax error at D:/domains/speedo/cgi-bin/links/admin/site_html_templates.pl line 136, near "elsif"
Make sure they exist, permissions are set properly, and paths are set correctly.

Here is that section:

sub site_html_link {
# --------------------------------------------------------
# This routine is used to display what a link should look
# like.

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 <= 2) { $new_mod_img = $new_1; }
elsif ($days_old <= 7) { $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 });
}


Thanks again,

Kurt
Quote Reply
Re: Error in Site_Html_Templates.pl In reply to
Your codes are a bit messy and you seem to have an extra right bracket, which is causing the syntax error. Delete the following codes:

Code:
# 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 <= 2) { $new_mod_img = $new_1; }
elsif ($days_old <= 7) { $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~; } }

And replace them with the following:

Code:
my $days_old = &days_old($rec{'Date'});
my $new_img = "";
($rec{'isNew'} eq 'Yes') ? ($rec{'isNew'} = 1) : (delete $rec{'isNew'});

$new_img = $new_1;
}
elsif ($days_old <= 7) {
$new_img = $new_3;
}
elsif ($days_old <= 14) {
$new_img = $new_7;
}
else {
(delete $rec{'isNew'});
}

Then you can add the codes for the Updated mod.

Suggestion: It is best to get one mod working, then try additional mods. One of the problems I see in your codes is that you tried to use both the Three New Graphics and Updated Mod at the same time.

Smile

Regards,



------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
Quote Reply
Re: Error in Site_Html_Templates.pl In reply to
Boy now I am totally confused. I copied the instructions direct from the download in the Mods. They were all in one part - can you tell me what part it is that I have to add after this - I don't see them separated in the instructions.

Thanks

Kurt
Quote Reply
Re: Error in Site_Html_Templates.pl In reply to
Eliot,

Thanks for your help - i figured it out, there was one line that was in the comments line and was not being read - fixed that and all is well - sometimes it just takes a rainstorm that makes me stay in the house and read!

Kurt
Quote Reply
Re: Error in Site_Html_Templates.pl In reply to
No problem...Glad it worked!

Regards,

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
Quote Reply
Re: Error in Site_Html_Templates.pl In reply to
Eliot:

Quote:
One of the problems I see in your codes is that you tried to use both the Three New Graphics and Updated Mod at the same time.

That mod IS one mod. Actually, there are three separate mods:

1. "Updated" & 3-Level "New" Modification.
2. 3-Level "NEW" Graphic Usage Modification.
3. "Updated" Graphic Usage Modification.

It looks like he was applying the first one.