Gossamer Forum
Home : Products : Links 2.0 : Installation -- Unix :

Unkown Tag: link_results

Quote Reply
Unkown Tag: link_results
Ok, I've spent a lot of time now trying to get Links working the way I want it to. I've managed to configure the site_html_templates.pl to get my headers and footers ok, get all of the build paths right on my confusing server and now I'm presented with "Unknown Tag: link_results" when I click on the links to preform functions like searching.

Since I now now how the site_html_templates.pl works for defining headers I am assuming it works something similar for the link_results tag, except that I can't find it? I tried comparing it to a backup version before I added the header and footer but I didn't notice anything different. I know that there is something wrong here and I be grateful if someone could tell me where to look to fix this annoying new problem. Is it in site_html_templates? Where should I look to 'restore' the code and what am I restoring? Thanks!

Quote Reply
Re: Unkown Tag: link_results In reply to
I'd open your templates up in a text editor to check the tags cause if you use an editor such as netscape composer they mess up the tags.

Good Luck!

Glenn
Host Links
http://cgi-resource.co.uk/links
Quote Reply
Re: Unkown Tag: link_results In reply to
Thanks, I tried that.. opened up every single one of them. The tag itself is still showing as: <%link_results%> so its got to be something with the code. Any other thoughts?

Quote Reply
Re: Unkown Tag: link_results In reply to
That tag can only be used in the following template files:

1) new.html
2) cool.html
3) top_rating.html
4) search_results.html

You cannot use this tag in the other template files...if you do, then you will get that error message.

Regards,

Eliot Lee
Quote Reply
Re: Unkown Tag: link_results In reply to
Thanks Eliot, maybe I wasn't too clear with the last post. Those are the only places that I have the <%link_results%> tags. (I checked all of that with the original templates). I would really appreciate some help here.

Here is the code for the site_html_templates.pl file, could someone do a quick scan to see if they can spot any problems?:

In Reply To:
$footer = qq~
<table width="100%" border="0">
<tr>
<td width="12%"> </td>
<td colspan="3">
<div align="center"><font face="Arial, Helvetica, sans-serif"><small class="menu"><a class="menulink" href="http://www.agspy.com"><font size="2">Home</font></a><font size="2">
| <a class="menulink" href="http://www.agspy.com/cgi-bin/add.cgi">Add a Site</a> | <a class="menulink" href="http://www.agspy.com/cgi-bin/modify.cgi">Modify
a Site</a> | <a class="menulink" href="http://www.agspy.com/New">What's
New</a> | <a class="menulink" href="http://www.agspy.com/Cool">What's Cool</a>
| <a class="menulink" href="http://www.agspy.com/Ratings">Top Rated</a>
| <a class="menulink" href="<http://www.agspy.com/cgi-bin/jump.cgi?ID=random">Random
Link</a> | <a href="/help/help-central.htm">Help Central</a></font></small></font></div>
</td>
<td width="12%"> </td>
</tr>
<tr>
<td width="12%"> </td>
<td colspan="3">
<p align="center"><font face="Arial, Helvetica, sans-serif" size="2"> <a href="http://www.agspy.com/info/company-information.htm">Company
Info</a> <a href="http://www.agspy.com/info/user-agreement.htm">User Agreement</a> </font></p>
<p align="center"><font face="Arial, Helvetica, sans-serif" size="2">Copyright&copy;
AgSpy Inc. 2001

<a href="http://www.agspy.com/info/privacy-policy.htm">Privacy Policy</a></font>

<small class="update">
<%time%>
</small> </p>
</td>
<td width="12%"> </td>
</tr>
</table>
~;
$header = qq~
<table width="100%" border="0">
<tr>
<td width="12%">
<div align="center"><font face="Arial, Helvetica, sans-serif" size="2"></font></div>
</td>
<td width="20%">
<div align="center"><font face="Arial, Helvetica, sans-serif" size="2"></font></div>
</td>
<td width="37%">
<div align="center"><font face="Arial, Helvetica, sans-serif" size="2"><img src="http://www.agspy.com/graphics/agspy.gif" width="144" height="41"></font></div>
</td>
<td width="19%">
<div align="center"><font face="Arial, Helvetica, sans-serif" size="2"></font></div>
</td>
<td width="12%">
<div align="center"><font face="Arial, Helvetica, sans-serif" size="2"><a href="http://www.agspy.com/help/help-central.htm">Help Central</a></font></div>
</td>
</tr>
<tr>
<td width="12%">
<div align="center"><font face="Arial, Helvetica, sans-serif" size="2"></font></div>
</td>
<td colspan="3">
<div align="center"></div>
</td>
<td width="12%"><font face="Arial, Helvetica, sans-serif" size="2"></font></td>
</tr>
</table>

~;


%globals = (
date => &get_date,
time => &get_time,
db_cgi_url => $db_cgi_url,
build_root_url => $build_root_url,
site_title => $build_site_title,
css => $build_css_url,
header => $header,
footer => $footer,
banner => ''

);


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

my %rec = @_;

# Set new and pop to either 1 or 0 for templates.
($rec{'isNew'} eq 'Yes') ? ($rec{'isNew'} = 1) : (delete $rec{'isNew'});
($rec{'isPopular'} eq 'Yes') ? ($rec{'isPopular'} = 1) : (delete $rec{'isPopular'});

return &load_template ('link.html', {
detailed_url => "$db_detailed_url/$rec{'ID'}$build_extension",
%rec,
%globals
});
}

sub site_html_home {
# --------------------------------------------------------
# This routine will build a home page. It is not meant to have any
# links on it, only subcategories.

return &load_template ('home.html', {
category => $category,
grand_total => $grand_total,
%globals

});
}

sub site_html_new {
# --------------------------------------------------------
# This routine will build a what's new page.

return &load_template ('new.html', {
total => $total,
grand_total => $grand_total,
link_results => $link_results,
title_linked => $title_linked,
%globals
} );
}

sub site_html_cool {
# --------------------------------------------------------
# This routine will build a what's new page.

return &load_template ('cool.html', {
total => $total,
grand_total => $grand_total,
percent => $percent,
link_results => $link_results,
title_linked => $title_linked,
%globals
} );
}

sub site_html_detailed {
# --------------------------------------------------------
# This routine will build a single page per link. It's only
# really useful if you have a long review for each link --
# or more information then can be displayed in a summary.
#
my %rec = @_;
return &load_template ('detailed.html', {
total => $total,
grand_total => $grand_total,
title_linked => $title_linked,
%rec,
%globals
} );
}

sub site_html_category {
# --------------------------------------------------------
# This rountine will build a page based for the current category.

return &load_template ( 'category.html', {
date => $date,
time => $time,
category => $category,
links => $links,
title_linked => $title_linked,
title => $title,
total => $total,
grand_total => $grand_total,
category_name => $category_name,
category_name_escaped => $category_name_escaped,
category_clean => $category_clean,
description => $description,
meta_name => $meta_name,
meta_keywords => $meta_keywords,
header => $header,
footer => $footer,
prev => $prev,
next => $next,
related => $related,
build_links_per_page => $build_links_per_page,
%globals
} );
}

sub site_html_ratings {
# --------------------------------------------------------
# This routine determines how the top rated page will look like.

return &load_template ( 'rate_top.html', {
top_rated => $top_rated,
top_votes => $top_votes,
%globals
});
}

########################################################################################
# THE FOLLOWING ARE CGI GENERATED PAGES AND THE TEMPLATE MUST BE PRINTED, NOT RETURNED!#
########################################################################################

sub site_html_add_form {
# --------------------------------------------------------
# This routine determines how the add form page will look like.
#
&html_print_headers;

my $category = shift;
if ($category) { ($category = qq~$category<input type=hidden name="Category" value="$category">~); } else { if (!@exclude_categories) { ($category = &build_select_field ("Category")); } else { ($category = &get_cat_select_list); } }


print &load_template ('add.html', {
Category => $category,
%globals
});
}

sub site_html_add_success {
# --------------------------------------------------------
# This routine determines how the add success page will look like.

&html_print_headers;

print &load_template ('add_success.html', {
%in,
%globals
});
}

sub site_html_add_failure {
# --------------------------------------------------------
# This routine determines how the add failure page will look like.

my ($errormsg) = shift;
if (defined $in{'Category'}) { $category = qq~$in{'Category'} ~; } else { if (!@exclude_categories) { $category = &build_select_field ("Category"); } else { $category = &get_cat_select_list; } }


&html_print_headers;
print &load_template ('add_error.html', { error => $errormsg, %in, Category => $category, %globals });


}

sub site_html_modify_form {
# --------------------------------------------------------
# This routine determines how the modify form page will look like.

if (!@exclude_categories) { ($category = &build_select_field ("Category")); } else { ($category = &get_cat_select_list); }


&html_print_headers;
print &load_template ('modify.html', {
Category => $category,
%globals
});
}

sub site_html_modify_success {
# --------------------------------------------------------
# This routine determines how the modify success page will look like.

&html_print_headers;
print &load_template ('modify_success.html', {
%in,
%globals
});
}

sub site_html_modify_failure {
# --------------------------------------------------------
# This routine determines how the modify failure page will look like.

my $errormsg = shift;
if ($in{'Category'}) { ($in{'Category'} = qq~$in{'Category'}<input type=hidden name="Category" value="$in{'Category'}">~); } else { if (!@exclude_categories) { ($in{'Category'} = &build_select_field ("Category")); } else { ($in{'Category'} = &get_cat_select_list); } }


&html_print_headers;
print &load_template ('modify_error.html', {
error => $errormsg,
%in,
%globals
});
}

sub site_html_search_results {
# --------------------------------------------------------
# This routine displays the search results.
#
my $term = &urlencode ($in{'query'});
&html_print_headers;
print &load_template ('search_results.html', {
term => $term,
link_results => $link_results,
category_results => $category_results,
next => $next,
cat_hits => $cat_hits,
link_hits => $link_hits,
%in,
%globals
});
}

sub site_html_search_failure {
# --------------------------------------------------------
# This routine displays a failed search page with error in $error.
#
my $error = shift;
my $term = &urlencode ($in{'query'});
&html_print_headers;

print &load_template ('search_error.html', {
term => $term,
error => $error,
%in,
%globals
});
}

sub site_html_search_form {
# --------------------------------------------------------
# This routine displays the search form.

&html_print_headers;
print &load_template ('search.html', {
term => $term,
error => $error,
%in,
%globals
});
}

sub site_html_mailing {
# --------------------------------------------------------
# This routine displays your mailing list subscribe/unsubscribe form.
#
my $action = shift;
my $message;
($action eq 'subscribe') and ($message = qq~You've been successfully subscribed to the mailing list!~);
($action eq 'unsubscribe') and ($message = qq~You've been successfully removed from the mailing list!~);

&html_print_headers;
print &load_template ('email.html', {
message => $message,
%in,
%globals
});
}

sub site_html_mailing_error {
# --------------------------------------------------------
# This routine is displayed if there was a problem subscribing.
#
my $error = shift;

&html_print_headers();
print &load_template ('email_error.html', {
error => $error,
%in,
%globals
});
}

sub site_html_rate_form {
# --------------------------------------------------------
# This routine determines how the rate form page will look like.
#
my %rec = @_;

&html_print_headers;
print &load_template ('rate.html', {
%rec,
%globals
});
}

sub site_html_rate_success {
# --------------------------------------------------------
# This routine determines how the rate success page will look like.

&html_print_headers;
print &load_template ('rate_success.html', {
%in,
%globals
});
}

sub site_html_rate_failure {
# --------------------------------------------------------
# This routine determines how the rate failure page will look like.

my ($errormsg) = shift;

&html_print_headers;
print &load_template ('rate_error.html', {
error => $errormsg,
%in,
%globals
});

}

########################################################################################
# THE FOLLOWING DETERMINES YOUR CATEGORY LISTING, IT'S NOT TEMPLATE BASED (YET)! #
########################################################################################

sub site_html_print_cat {
# --------------------------------------------------------
# This routine determines how the list of categories will look.
# We now use a table to split the category name up into two columns.
# For each category you can use the following variables:
#
# $url : The URL to go to that category
# $category_name : The category name with _ and / removed.
# $category_descriptions{$subcat}: The category description (if any).
# $numlinks : The number of links inside that category (and subcategories).
# $mod : The newest link inside of that category.
#

my (@subcat) = @_;
my ($url, $numlinks, $mod, $subcat, $category_name, $description, $output, $i);
my ($half) = int (($#subcat+2) / 2);

# Print Header.
$output = qq|<div class="margin"><table width="80%" border="0" cellspacing="0" cellpadding="0"><tr><td class="catlist" valign="top">\n|;

foreach $subcat (sort @subcat) {
($description) = @{$category{$subcat}}[2];

# First let's get the name, number of links, and last modified date...
$url = "$build_root_url/" . &urlencode($subcat) . "/";
if ($subcat =~ m,.*/([^/]+)$,) { $category_name = &build_clean($1); } else { $category_name = &build_clean($subcat); }
$numlinks = $stats{"$subcat"}[0];
$mod = $stats{"$subcat"}[1];

# We check to see if we are half way through, if so we stop this table cell
# and begin a new one (this lets us have category names in two columns).
if ($i == $half) {
$output .= qq|</td><td class="catlist" valign="top">\n|;
}
$i++;

# Then we print out the name linked, new if it's new, and popular if its popular.
$output .= qq|<dl><dt><strong><a class="link" href="$url">$category_name</a></strong> <small class="numlinks">($numlinks)</small> |;
$output .= qq|<small><sup class="new">new</sup></small>| if (&days_old($mod) < $db_new_cutoff);
$output .= qq|</dt>|;
$output .= qq|<dd><span class="descript">$description </span></dd>| if (!($description =~ /^[\s\n]*$/));
$output .= qq|</dl>|;
}
sub site_html_cat_select_list {
# --------------------------------------------------------
# This routine builds the options for the category select list.
my (@subcat) = @_;
my $output;

CAT: foreach $subcat (sort @subcat) {
if (@exclude_categories) {
foreach (@exclude_categories) {
($subcat eq $_) and next CAT;
}
}
$category_name = &build_clean($subcat);
$output .= qq| <option value="$subcat">$category_name\n|;
}
return $output;
}

sub get_cat_select_list {
# --------------------------------------------------------
# This routine retrieves the category select list.
my $cat_select_list;
open (SELECT, "<$db_script_path/data/cat_sel.txt")
or &cgierr("unable to open $db_script_path/data/cat_sel.txt. Reason: $!");
while (<SELECT> )
{ $cat_select_list .= $_; }
close SELECT;
return $cat_select_list;
}

# Don't forget to end the unordered list..
$output .= "</td></tr></table></div>\n";
return $output;
}

1;
Once again, thank you for your help!

Quote Reply
Re: Unkown Tag: link_results In reply to
Ok, I've double checked all of the tags as per your advice Elliot. I've found and extra links_results tag on one of the pages. I'm working on the rest now, but I think that should do it! Thanks!