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

Grand Total in Detail.html

Quote Reply
Grand Total in Detail.html
Hi all, I read here in the admin help edit templates thingy that you could:-

By default you can use the following codes:
  • <%date%> - Current date.
  • <%time%> - Current time.
  • <%db_cgi_url%> - URL to your user cgi directory.
  • <%build_root_url%> - URL to your user home directory.
  • <%site_title%> - Title of your Links directory.
  • <%css%> - URL to your links.css file.


You can also use the following fields for this template: detailed.html

  • <%grand_total%> - Total number of links in your database.
  • <%title_linked%> - A linked title bar.


When I try and add <%grand_total%> in my detail.html template, nothing prints out, no bad tag nothing.

Here are my globals

%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,

category_name => $category_name,

build_image_url => $build_image_url,

dead_total => $deadtotal,

topsites => &top_ten,

banner => ''



);



also my detail sub

return &load_template ('detailed.html', {

total => $total,

grand_total => $grand_total,

title_unlinked => $title_unlinked,

title_linked => $title_linked,

category_name => $category_name,

category_name_escaped => $category_name_escaped,

category_clean => $category_clean,

thiscat => $thiscat,

flag => $langimg,

new_update => $new_mod_img,

rate_img => $rate_img,

%rec,

%globals

} );

}



and my nph build.cgi

sub build_detailed_view {

# --------------------------------------------------------

# This routine build a single page for every link.

#

my (@values, $id, %rec, $count);

if ($build_detail_path =~ m,^$build_root_path/(.*)$,) {

&build_dir ($1);

}

print "\t";

open (DB, "<$db_file_name") or &cgierr("unable to open database: $db_file_name. Reason: $!");

LINE: while (<DB>) {

/^#/ and next LINE; # Skip comment Lines.

/^\s*$/ and next LINE; # Skip blank lines.

chomp;

@values = &split_decode ($_);

$id = $values[$db_key_pos];

%rec = &array_to_hash (0, @values);

$title_linked = &build_linked_title ("$rec{'Category'}/$rec{'Title'}");

open (DETAIL, ">$build_detail_path/$id$build_extension") or &cgierr ("Unable to build detail page: $build_detail_path/$id$build_extension. Reason: $!");

print DETAIL &site_html_detailed (%rec);

close DETAIL;

$use_html ?

print qq~<a href="$build_detail_url/$id$build_extension" target="_blank">$id</a> ~ :

print qq~$id ~;

(++$count % 10) or print "\n\t";

}

close DB;

print "\n";

}



###############################

Is it just me or can this not be done even though it says it can. I even tried using the orignal links 2.0.



Please help a damsel in distress, my weee puppies life depends on it.



Sly
Quote Reply
Re: [thicko!!] Grand Total in Detail.html In reply to
Its definatly in that format? i.e. not &gt;grand_total&lt; ??? Otherwise it should report an error is nothing is reported....try printing it again at the very top, or very bottom, of the page...and see what that gives.

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Grand Total in Detail.html In reply to
Hi Andy,

Here is part of my detail.html template:-


<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<div align="center"><center><table border="0" width="99%" cellspacing="1" cellpadding="0"><tr><td width="100%">

<table border="0" width="100%" cellspacing="1" cellpadding="0"><tr>
<td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td colspan="2"><%grand_total%>
<a href="javascript:history.back(1)"><img border=0 src="<%build_image_url%>/21.gif" width="32" height="32" alt="Click here to go back to your last page"></a>

and here is my source code of the html after I rebuild in admin, as you see theres no mention of error - nothing !!!

<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<div align="center"><center><table border="0" width="99%" cellspacing="1" cellpadding="0"><tr><td width="100%">

<table border="0" width="100%" cellspacing="1" cellpadding="0"><tr>
<td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td colspan="2">
<a href="javascript:history.back(1)"><img border=0 src="http://www....../links/images/21.gif" width="32" height="32" alt="Click here to go back to your last page"></a>

(I had to blank out my URL above as my admin page is not secured)

I would really like this too work, but having major problems.

<sniff>!!!
Quote Reply
Re: [thicko!!] Grand Total in Detail.html In reply to
I have also noticed in my nph build.cgi, sub build_detailed_view above that there is no mention of a grand total. Is that the problem.

I also have Paul Wilsons deadlink reporter installed but thats seems to be ok, is there a conflict ???


Quote Reply
Re: [thicko!!] Grand Total in Detail.html In reply to
It prints out OK on my homepage (home.html) so I looked a the sub home routine and saw it had these extra codes in there (in red). I tried adding these but still shows nothing.

I have also tried <%total%>, which again shows no error message and <%grand total%> but this comes up with bad tag name. The tag that is in place at the moment is <%grand_total%>, with this I get no error message and no coding. See source codes above etc.

sub build_detailed_view {
# --------------------------------------------------------
# This routine build a single page for every link.
#
my (@values, $id, %rec, $count);
local ($total);
if ($build_detail_path =~ m,^$build_root_path/(.*)$,) {
&build_dir ($1);
}
print "\t";
open (DB, "<$db_file_name") or &cgierr("unable to open database: $db_file_name. Reason: $!");
LINE: while (<DB>) {
/^#/ and next LINE; # Skip comment Lines.
/^\s*$/ and next LINE; # Skip blank lines.
chomp;
@values = &split_decode ($_);
$id = $values[$db_key_pos];
%rec = &array_to_hash (0, @values);
$total = $grand_total;
$title_linked = &build_linked_title ("$rec{'Category'}/$rec{'Title'}");
open (DETAIL, ">$build_detail_path/$id$build_extension") or &cgierr ("Unable to build detail page: $build_detail_path/$id$build_extension. Reason: $!");
print DETAIL &site_html_detailed (%rec);
close DETAIL;
$use_html ?
print qq~<a href="$build_detail_url/$id$build_extension" target="_blank">$id</a> ~ :
print qq~$id ~;
(++$count % 10) or print "\n\t";
}
close DB;
print "\n";
}



Using the above code did not get me anywhere. Please help.

It definately says in admin.html that it can be used

sub html_template_help {

# --------------------------------------------------------

# Lists what you can use in what template.

#

my $template = $in{'template'};

my %fields = ( 'home.html' => qq~

<li>&lt;%category%&gt; : Listing of all the main categories and category descriptions<br>

<li>&lt;%grand_total%&gt; : The total number of links in the database.

~,

'new.html' => qq~

<li>&lt;%total%&gt; : Total number of new links.

<li>&lt;%grand_total%&gt; : The total number of links in the database.

<li>&lt;%link_results%&gt; : List of new links.

<li>&lt;%title_linked%&gt; : A linked title bar.

~,

'cool.html' => qq~

<li>&lt;%total%&gt; : Total number of new links.

<li>&lt;%grand_total%&gt; : The total number of links in the database.

<li>&lt;%title_linked%&gt; : A linked title bar.

<li>&lt;%link_results%&gt; : List of new links.

<li>&lt;%percent%&gt; : The top x % of links or the top n links.

~,

'category.html' => qq~

<li>&lt;%total%&gt; : Total number of new links.

<li>&lt;%grand_total%&gt; : The total number of links in the database.

<li>&lt;%title%&gt; : The category title.

<li>&lt;%title_linked%&gt; : A linked title bar.

<li>&lt;%category%&gt; : The list of sub-categories.

<li>&lt;%links%&gt; : The list of links in this category.

<li>&lt;%category_name%&gt; : The category name including _ and / characters.

<li>&lt;%category_clean%&gt; : The category name with _ and / converted.

<li>&lt;%category_name_converted%&gt; : The category name url escaped.

<li>&lt;%description%&gt; : The category description.

<li>&lt;%meta_name%&gt; : Meta name information.

<li>&lt;%meta_keywords%&gt; : The meta keywords information.

<li>&lt;%header%&gt; : Custom header.

<li>&lt;%footer%&gt; : Custom footer.

<li>&lt;%prev%&gt; : Link to previous page (if build span pages turned on).

<li>&lt;%next%&gt; : Link to next page (if build span pages turned on).

<li>&lt;%related%&gt; : Related categories.

~,

'link.html' => qq~

<li>&lt;$detailed_url%&gt; : Link to a detailed page if you have this option set.

<li>You can use &lt;%Field Name%&gt; where Field Name is any field in your

links database like: Title, URL, etc.

~,

'detailed.html' => qq~

<li>&lt;%grand_total%&gt; - Total number of links in your database.

<li>&lt;%title_linked%&gt; - A linked title bar.

~,

'search_results.html' => qq~

<li>&lt;%term%&gt; - A URL escaped version of the search term.

<li>&lt;%category_results%&gt; - A list of all the category matches.

<li>&lt;%link_results%&gt; - A list of all the link matches.

<li>&lt;%next%&gt; - A toolbar to go to the next search results page.

<li>&lt;%cat_hits%&gt; - Total number of category hits.

<li>&lt;%link_hits%&gt; - Total number of link hits.
Quote Reply
Re: [thicko!!] Grand Total in Detail.html In reply to
This is actually a bug...grand_total is not defined anywhere else, but for building the homepage. What you will need to do is copy the grand_total variable configurations and put them in the sub build_detailed_page routine in the nph-build.cgi file...OR create a separate global that can be used throughout any template.
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [Stealth] Grand Total in Detail.html In reply to
Quote:
OR create a separate global that can be used throughout any template
Thanx for the advice, but how would I do such an exhausting task, I do not even know where to start on this solution