Gossamer Forum
Home : Products : Links 2.0 : Customization :

Creating a site map in Links 2.0

(Page 1 of 2)
> >
Quote Reply
Creating a site map in Links 2.0
Hi,

I would like to create or use a mod to create a site map for my web site. I've read that this will help alot with serarch engines.Is there a mod out there which would do this for me?



Thanks in advance.
Quote Reply
Re: [dij] Creating a site map in Links 2.0 In reply to
I think there's one in the resource section, and here's another:

http://www.theonetruechurch.com/templatetree.html


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Creating a site map in Links 2.0 In reply to
Could not find that mode in the resources center.

Thank you :)
Quote Reply
Re: [dij] Creating a site map in Links 2.0 In reply to
I don't know anything about the other except it's called 'Links Tree' and is here:

http://www.gossamer-threads.com/...rsion_2_x/more3.html

The one I linked first is from my site, and you can see how it looks here. (Using the category-only option, no links included.)


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Creating a site map in Links 2.0 In reply to
I was looking for keyword tee mod



anyway, thanks again :)
Quote Reply
Re: [dij] Creating a site map in Links 2.0 In reply to
I'm not sure just what you mean? Could you explain--perhaps a little code change to one of the mods will produce what you're after.


Leonard
aka PerlFlunkie
Quote Reply
Re: [dij] Creating a site map in Links 2.0 In reply to
DIJ

FOR SEO and Link Building, the one that the guy referenced above would work perfect.

Nakul Goyal
SEO and Link Building Expert
www.nakulgoyal.com
>> Nakul Goyal (SEO, Link Building Expert)
Web Site Promotion
Tips 'n' Tricks
SEO News


Quote Reply
Re: [PerlFlunkie] Creating a site map in Links 2.0 In reply to
hey Leonard,

i installed the mod but i think there is a missing </ul> somewhere as all my categories and subcategories just build over to the right more and more... i tried to find where it was but i couldnt... any ideas?

Great Mod BTW :D




Vote Stinky
Quote Reply
Re: [security_man] Creating a site map in Links 2.0 In reply to
Well, after looking the code over, maybe this it!
One of the last lines in the code for sub site_html_print_map:


$output .= '</ul></font></td></tr></table>';

Should be like:

$output .= '</ul></ul></font></td></tr></table>';


I think that will fix it. Not sure why it worked OK for me before, but I just ran that page through TopStyle, and it said it was missing a </ul> tag. After adding the one shown above, it seems OK...

Blush

Note: this is now fixed on the mod page...


Leonard
aka PerlFlunkie

Last edited by:

PerlFlunkie: Jul 11, 2004, 3:00 PM
Quote Reply
Re: [PerlFlunkie] Creating a site map in Links 2.0 In reply to
Hello Leonard,

I just set up your site map mod:
http://www.gpaed.de/...raturtipps/index.php

But I'using the german version of links, with an non english field for the categories.
Normally it's working and the categories are shown as "Förderung" instead of "Foerderung".

Currently the site map prints the categories as "Foerderung".
How can I print out the other spelling?

Upps just a second question.
My index page suddenly looks different. Does the sitemap mod touch the index page as well?
I want my old index page back ;-))

Matthias
www.gpaed.de

Matthias
gpaed.de

Last edited by:

Matthias70: Jul 12, 2004, 8:26 AM
Quote Reply
Re: [Matthias70] Creating a site map in Links 2.0 In reply to
The mod should not affect your main page. To use the nonenglish mod, add this in the sub you added in site_html_templates.pl, just above where it says '#Print Header':

($nonenglish) = @{$category{$subcat}}[8];
$subcatsub = $nonenglish if ($nonenglish);


Then make sure you have the two nonenglish subs kategorie_title_mb and build_clean_mb at the bottom of the file (but above the 1;).


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Creating a site map in Links 2.0 In reply to
Thank you for your answer

In Reply To:
The mod should not affect your main page. To use the nonenglish mod, add this in the sub you added in site_html_templates.pl, just above where it says '#Print Header':
But it is still affected :-( Perhaps it's while I have two "sub site_html_print_cat" in site_html_templates.pl since I put in your mod?!?

Edit: I just removed the sub site_html_print_cat that's included in your mod an know the index file on the main page is not affected anymore. The nonenglish problem still exists...



In Reply To:

($nonenglish) = @{$category{$subcat}}[8];
$subcatsub = $nonenglish if ($nonenglish);


Then make sure you have the two nonenglish subs kategorie_title_mb and build_clean_mb at the bottom of the file (but above the 1;).



I put in the extension for nonenglish mod, but there are still no nonenglish characters?

$depth_old = 0;
$numcat = keys %category;
$cat_per_col = $numcat / $site_map_columns;
$next_split = $cat_per_col;
$current_cat = 0;
($nonenglish) = @{$category{$subcat}}[8];
$subcatsub = $nonenglish if ($nonenglish);
# Print Header.
$output = qq|\n|;

By the way. I could'nt find build_clean_mb but kategorie_title_mb is now at the bottom of the file (but above the 1;).

Matthias
www.gpaed.de


Matthias
gpaed.de

Last edited by:

Matthias70: Jul 12, 2004, 11:19 AM
Quote Reply
Re: [Matthias70] Creating a site map in Links 2.0 In reply to
Well, I don't think you should have two sub_site_html_print_cat routines, so remove the one you added from the mod. That should fix that problem...

I forgot to mention that you need to add this to the routine:

my ($relative_url, $numcat, $cat_per_col, $next_split, $current_cat, $nonenglish, $subcatsub);

Here is the other nonenglish sub to add:


sub build_clean_mb {
# --------------------------------------------------------
my ($input) = $_[0];
$input =~ s,\\, : ,g;
return $input;
}



Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Creating a site map in Links 2.0 In reply to
Everthing should be O.K. now, but there are still no nonenglish charakters?!?

here's the part from the site_html_templates.pl
Do you have an idea?


sub site_html_print_map {
# --------------------------------------------------------
# This routine builds a tree from all links/categories
my ($cat, $numlinks);
my ($linkstree, $output, @categorylist, $depth_old, $depth_new);
my ($relative_url, $numcat, $cat_per_col, $next_split, $current_cat, $nonenglish, $subcatsub);
local ($links);
$build_root_url =~ m~http://[^/]*~;
$relative_url = $';
# set linkstree to 0 if you want only a tree of all categories
# set linkstree to 1 if you want a tree off all categories and links
$linkstree = 1;
$depth_old = 0;
$numcat = keys %category;
$cat_per_col = $numcat / $site_map_columns;
$next_split = $cat_per_col;
$current_cat = 0;
($nonenglish) = @{$category{$subcat}}[8];
$subcatsub = $nonenglish if ($nonenglish);
# Print Header.
$output = qq|\n|;
# 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? =)
$category_clean = &build_clean ($cat);
$numlinks = $stats{$cat}[0];
$current_cat++;
@categorylist = split (/ : /, $category_clean);
$depth_new = $#categorylist;
$links = "";
$zcat = @categorylist[$#categorylist];
if ($depth_new < $depth_old) {
for ($i = 0; $i <= ($depth_old - ($depth_new + 1)); $i++) {
$links .= "\n";
}
if ($depth_new == 0 && $current_cat > $next_split) {
$next_split += $cat_per_col;
$links .= qq|\n|;
}
}
$links .= qq~\n<p class="datei"><a href="$relative_url/$cat/">$zcat</a>&nbsp;($numlinks)</p>~;
if ($linkstree == 1) {
$numlinks = ($#{$links{$cat}} + 1) / ($#db_cols + 1);
for ($i = 0; $i < $numlinks; $i++) {
%tmp = &array_to_hash ($i, @{$links{$cat}});
$links .= &site_html_link (%tmp);
}
$links .= "\n";
}
if ($#{$subcategories{$cat}} >= 0) {
$links .= "\n<br>";
}
$output .= $links;
$depth_old = $depth_new;
}
$output .= '<br>';
return $output;
}
sub kategorie_title_mb {
# --------------------------------------------------------
open (DB, "<$db_category_name") or &cgierr("Fehler. Kann die Datei bzw. Verzeichnis nicht öffnen: $db_file_name. Grund: $!");
@kategorien = <DB>;
close DB;
my ($input, $output, $title, $kategorie, @fields);
$input = $_[0];
$title = "";
KATEGORIE: foreach $kategorie (@kategorien) {
if ($kategorie =~ /^#/) { next KATEGORIE; }
chomp ($kategorie);
@fields = &split_decode ($kategorie);
if (@fields[1] eq $input) {
$title = @fields[8];
$title =~ s,\\, : ,g;
last KATEGORIE;
}
}
if ($title eq "") {
$output = &build_clean ($input);
}
else {
$output = $title;
}
return $output;
}
sub build_clean_mb {
# --------------------------------------------------------
my ($input) = $_[0];
$input =~ s,\\, : ,g;
return $input;
}

1;

Matthias
gpaed.de
Quote Reply
Re: [Matthias70] Creating a site map in Links 2.0 In reply to
The nonenglish mod instructions put it in field eight [8] in the category.def file. Is this where you have it? The mod is looking there for info:

($nonenglish) = @{$category{$subcat}}[8];


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Creating a site map in Links 2.0 In reply to
Hello Leonard,
Yes, the instructions are in field eight [8]

Matthias

Matthias
gpaed.de
Quote Reply
Re: [Matthias70] Creating a site map in Links 2.0 In reply to
This is getting interesting...! Crazy

It was several years ago that I worked on the map, so I don't remember all that I did, but I see that my file in nph-build.cgi is different than the one in the mod instructions. Not sure if it's just because of the nonenglish mod or what, but try this IN PLACE of what you now have:

sub build_site_map_page {
# --------------------------------------------------------
# Creates a "Site Map" page.
my (@rootcat);
local ($title_linked, $site_map);

if ($build_site_map_path =~ m,^$build_root_path/(.*)$,) {
&build_dir ($1);
}
$site_map = &site_html_print_map();

$title_linked = &build_linked_title ("map");
open (MAP, ">$build_site_map_path/$build_index") or cgierr ("unable to open site map page: $build_map_path/$build_index. Reason: $!");
print MAP &site_html_site_map;
close MAP;
}


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Creating a site map in Links 2.0 In reply to
The problem still exists Unsure

Matthias
gpaed.de
Quote Reply
Re: [Matthias70] Creating a site map in Links 2.0 In reply to
What does your site_html_print_cat look like? (Please post) I am comparing codes, trying to see where the problem may be...


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Creating a site map in Links 2.0 In reply to
Here it is, but perhabs it's better when I cancel the idea with the sitemap.
It's a lot of work going through all the code, isnt it?


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

# ! Bearbeitet für Templates !
$output = qq|<table border="0" cellspacing="1" cellpadding="10"><tr><td valign="top">\n|;

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

$url = "$build_root_url/" . &urlencode($subcat) . "/";
if ($nonenglish eq "") {
if ($subcat =~ m,.*/([^/]+)$,) { $category_name = &build_clean($1); } else { $category_name = &build_clean($subcat); }
}
else {
$category_name = &build_last_title_mb($nonenglish);
}
$numlinks = $stats{"$subcat"}[0];
$mod = $stats{"$subcat"}[1];

# ! Edited for Templates !
if ($i == $half) {
$output .= qq|</td><td valign="top">\n|;
}
$i++;

$output .= qq|<table border=0 cellpadding=1 cellspacing=1><tr><td valign=top><img src=$build_root_url/tpl_images/catbullet.gif border=0></td><td valign=top><font size=2><nobr><a href="$db_cgi_url/count.cgi?action=jump&URL=$url"><b>$category_name</b></a> ($numlinks) |;
$output .= qq|<img src=$build_root_url/tpl_images/new.gif>| if (&days_old($mod) < $db_new_cutoff);
$output .= qq|</nobr></font></td></tr><tr><td></td><td valign=top>|;
$output .= qq|<font size=1 class=categorydescription>$description </font>| if (!($description =~ /^[\s\n]*$/));
$output .= qq|</td></tr></table>|;
}

$output .= "</td></tr></table>\n";
return $output;
}

Matthias
gpaed.de
Quote Reply
Re: [Matthias70] Creating a site map in Links 2.0 In reply to
These kind of things make me wanna keep looking till I find the answer... I looked over your code, it seems fine. Just as an experiment, try this: in the map routine, replace

$category_clean = &build_clean ($cat);

with

$category_clean = &build_last_title_mb($nonenglish);

Maybe someone else will see this and figure it out... Frown


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Creating a site map in Links 2.0 In reply to
In Reply To:
These kind of things make me wanna keep looking till I find the answer...


That's my problem, too Crazy


In Reply To:
Just as an experiment, try this: in the map routine, replace

$category_clean = &build_clean ($cat);

with

$category_clean = &build_last_title_mb($nonenglish);
This shows no category name at all Unsure Perhaps it's better to try it tomorrow, good night... Matthias

Matthias
gpaed.de
Quote Reply
Re: [PerlFlunkie] Creating a site map in Links 2.0 In reply to
In Reply To:
Well, after looking the code over, maybe this it!
One of the last lines in the code for sub site_html_print_map:


$output .= '</ul></font></td></tr></table>';

Should be like:

$output .= '</ul></ul></font></td></tr></table>';


I think that will fix it. Not sure why it worked OK for me before, but I just ran that page through TopStyle, and it said it was missing a </ul> tag. After adding the one shown above, it seems OK...

Blush

Note: this is now fixed on the mod page...


nope, that wasnt it... actually it seems that for some reason my version isnt getting to the point that the </ul> is called. this is what the output looks like on mine...
  • category
    • subcat
    • subcat
    • subcat
      • category
        • subcat
        • subcat
        • subcat
          • category
            • subcat
            • subcat

im wondering if the category select list mod or something else might be causeing it... what exactly does this do?
Code:
@categorylist = split (/ : /, $category_clean);
$depth_new = $#categorylist;
$links = "";
$zcat = @categorylist[$#categorylist];
if ($depth_new < $depth_old) {
for ($i = 0; $i <= ($depth_old - ($depth_new + 1)); $i++) {
$links .= "\n</ul>";
}
if ($depth_new == 0 && $current_cat > $next_split) {
$next_split += $cat_per_col;
$links .= qq|</ul></td><td valign="top"><ul>\n|;


because it is just never happening. im wondering if somehow one of my other mods is causing the if statement to never be true, im just not savvy enough to understand exactly what the if statement(s) are asking

thanks again for all your help leonard Smile




Vote Stinky
Quote Reply
Re: [security_man] Creating a site map in Links 2.0 In reply to
I use the category select list mod, so that's not a problem. I suppose that code is just figuring the cats, and how many, so it knows where to break the column. You did do step one of the mod, which includes:

$site_map_columns = 2;


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Creating a site map in Links 2.0 In reply to
yup, and it never calls that either Crazy




Vote Stinky
> >