Gossamer Forum
Home : Products : Links 2.0 : Customization :

Another span pages mod...

Quote Reply
Another span pages mod...
Hi !

A few days ago, I had download the links tree mod, that makes a tree directory in all links of the database. I successfuly installed and it works great. However the page that is created, named tree.html is too big, and i'd like to build span pages on this page. I tried so many times to do this modification but I didn't make it up.

The file that contains the code is the nphbuild.cgi file. The following code is where the suppose span pages should come in:

--- TREE MODIFICATION - BEGIN ---

# sub build_tree_page {

# This routine builds a tree from all links/categories

my ($cat, $url, $dir, @related, $relation, $page_num, $next_page, $numlinks);
my ($linkstree, $output, @categorylist, $depth_old, $depth_new);
local ($category, $links, $title_linked, $title, $total, $category_name, $category_name_escaped);
local ($description, $related, $meta_name, $meta_keywords, $header, $footer, $next, $prev);

# set linkstree to 0 if you want only a tree off all categories
# set linkstree to 1 if you want a tree off all categories and links
$linkstree = 1;

$depth_old = 0;
$url = "$build_root_path/tree$build_extension";
open (CAT, ">$url") or &cgierr ("unable to open category page: $url. Reason: $!");

$output = qq~
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html>

<head>
<title>$build_site_title</title>
<style><!--A:link {text-decoration:none;}A:visited {text-decoration:none;}A:hover {text-decoration:underline;}--></style>
</head>

<body bgcolor="#FFFFFF" text="#000000" LINK="#000099" VLINK="#000099" ALINK="#000099">

<CENTER><IMG SRC="http://www.taservido.com.br/taservido.gif" BORDER=0 HEIGHT=163 WIDTH=400></CENTER>
<BR><CENTER><A HREF="http://www.taservido.com.br/publicidade/index.html" target="blank"><IMG SRC="http://www.taservido.com.br/anuncie.gif" ALT="Anuncie aqui" BORDER=1 HEIGHT=40 WIDTH=400></A></CENTER>
<BR><BR>
<CENTER><table border=0 WIDTH="60%" CELLSPACING=1>
<tr BGCOLOR="#FFFFCC"><td align="center" BGCOLOR="#FFFFCC"><FONT FACE="Arial" SIZE=-1>Total de estabelecimentos cadastrados: <B>$grand_total</B>.</tr></td></FONT></CENTER></TABLE></CENTER>
~;
print CAT $output;

# Go through each category and build the appropriate page.
CATEGORY: foreach $cat (sort keys %category) {
next CATEGORY if ($cat =~ /^\s*$/); # How'd that get in here? =)

# We set up all the variables people can use in &site_html.pl.
($description, $related, $meta_name, $meta_keywords, $header, $footer) = @{$category{$cat}}[2..7];

$title_linked = &build_linked_title ($cat);
$title = &build_unlinked_title ($cat);
$total = ($#{$links{$cat}} + 1) / ($#db_cols + 1);
$category_name = $cat;
$category_name_escaped = &urlencode ($cat);
$category_clean = &build_clean ($cat);


$numlinks = ($#{$links{$cat}} + 1) / ($#db_cols + 1);
@categorylist = split (/\//, $cat);
$depth_new = $#categorylist;
$links = "";
if ($depth_new < $depth_old) {
for ($i = 0; $i <= ($depth_old - ($depth_new + 1)); $i++) {
$links .= "\n</ul>";
}
}

$links .= qq~\n<p align="center"><table align="center" border=0 WIDTH="60%" CELLSPACING=1><tr><td align="center"><P ALIGN="LEFT"><FONT FACE="Verdana" SIZE=-1 COLOR="#CC0000">$title</FONT></td></tr></table><BR>~;
if ($linkstree == 1) {
for ($i = 0; $i < $numlinks; $i++) {
%tmp = &array_to_hash ($i, @{$links{$cat}});
$links .= &site_html_link_tree (%tmp);
}
$links .= "\n";
}

if ($#{$subcategories{$cat}} >= 0) {
$links .= "\n";
}

print CAT $links;
$depth_old = $depth_new;
}

$output = qq~

$site_search
$site_footer

~;
print CAT $output;

close CAT;
}
#

--- TREE MODIFICATION - END ---

You can see the tree at: http://www.taservido.com.br/busca/links/tree.html

Please, anyone help me out with this.

Best Regards,

Traven
Subject Author Views Date
Thread Another span pages mod... Traven 1561 Feb 18, 2000, 12:26 AM
Post Re: Another span pages mod...
Stealth 1543 Feb 18, 2000, 6:09 PM
Post Re: Another span pages mod...
Traven 1538 Feb 23, 2000, 12:41 AM
Post Re: Another span pages mod...
Stealth 1539 Feb 23, 2000, 7:56 PM
Thread Re: Another span pages mod... (tree mod)
Juan G 1530 May 25, 2000, 11:51 AM
Thread Re: Another span pages mod... (tree mod)
Stealth 1524 May 25, 2000, 1:35 PM
Thread Re: Another span pages mod... (tree mod)
Juan G 1522 May 25, 2000, 2:14 PM
Post Re: Another span pages mod... (tree mod)
Stealth 1515 May 25, 2000, 3:31 PM