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
Quote Reply
Re: Another span pages mod... In reply to
I have been tinkering with this Modification for quite some time with limited success...I have created a stand alone script that prints out the Categories and number of records in them and then use SSI call to execute the script in a .shtml page...I am working on spanning the results...

When I come up with a solution...I will look at the Link Tree Mod and see if the fix can work for this Mod as well.

In the meantime...may be someone else has some ideas about how to do this...I know that Widgetz was working on a spanning Mod fo the New and Cool pages with limited success as well.

Regards,

------------------
Eliot Lee....
* Check Resource Center
* Search Forums

Quote Reply
Re: Another span pages mod... In reply to
Ok, Are you at least near of a definitive solution?

Please, let me know what you have until now.

Regards,

Traven

------------------
Quote Reply
Re: Another span pages mod... In reply to
Nope....And the problems I've experienced "span" between non-sorted links to no links showing up on procedding pages, to nothing at all.

Wink

Regards.

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
Quote Reply
Re: Another span pages mod... (tree mod) In reply to
While there is not a span pages option for the tree mod, we can use a tree of just categories (without links) by simply replacing:

# 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;


with:

# 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 = 0;


Of course, in the case of sites with many categories, this tree may also be too much large.

Probably, a very interesting solution would be the JavaScript Tree (free for non-profit use), or a similar implementation but as no-frames HTML pages:

JavaScript Tree
http://www.mattkruse.com/scripts/tree


Quote Reply
Re: Another span pages mod... (tree mod) In reply to
I am using DBMAN to span results of alphabetically sorted links and categories in my site....very effective.

Regards,

Eliot Lee
Quote Reply
Re: Another span pages mod... (tree mod) In reply to
Eliot, we can learn really a lot from your excellent site:

WWW Virtual Library: Anthropology
http://vlib.anthrotech.com

Quote Reply
Re: Another span pages mod... (tree mod) In reply to
Thanks...

Regards,

Eliot Lee