Gossamer Forum
Home : Products : Links 2.0 : Customization :

Subcat mod by Glennu - clarification needed

Quote Reply
Subcat mod by Glennu - clarification needed
I am trying to implement the Subcat mod by Glennu found at http://cgi-resource.co.uk/pages/subcat.shtml and discussed in various posts herein.

I must be misunderstanding what is required.

I have added the code as I understood but when I attempt to do a build the file nph-build.cgi attempts to download.

When I open the file the following error message is written:

Error including libraries: Unrecognized character \x93 at /usr/www/users/username/itjc/cgi-bin/admin/site_html_templates.pl line 388.
Compilation failed in require at /usr/www/users/username/links/cgi-bin/admin/nph-build.cgi line 40.

Make sure they exist, permissions are set properly, and paths are set correctly.

The line in question contains the following:

$sub = “”;

which is the first line of the code that is supposed to be added.

My code looks like this:

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

$sub = “”;
open (DB, "<$db_category_name") or &cgierr("unable to open database: $db_category_name. Reason: $!");
LINE: while (<DB>) {
/^#/ and next LINE; # Skip comment Lines.
/^\s*$/ and next LINE; # Skip blank lines.
chomp;
@values = &split_decode ($_);
$name{$values[0]} = $values[1];
}
close DB;

foreach $values (sort {$name{$a} <=> $name{$b}} keys %name) {
if ($name{$values} =~ m,^$subcat/([^/]+)$,) {
if ($name{$values} =~ m,.*/([^/]+)$,) { $nam{$values} = &build_clean($1); } else { $nam{$values} = &build_clean($subcat); }
$sub .= "<a href =$name{$values}>($nam{$values}) </a>\n";
}
}

So have I added the code incorrectly? I assume that "add" meant to simply add the code after the lines or did it mean to replace it or ...?

Any help appreciated.

Frown

Richard
"Be practical, expect miracles." - James T. McCay
Quote Reply
Re: [Tricky Ricky] Subcat mod by Glennu - clarification needed In reply to
Those quote marks look odd: $sub = “”;

Try changing them to the normal kind, like in the rest of the code for that mod, so they look like this: $sub = "";

Maybe it's that simple...


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Subcat mod by Glennu - clarification needed In reply to
Thanks Leonard.

I made the change and it ran like dream, unfortunately the sub categories did not show up on the first page. So I will have to take a careful look at what is going on.

Richard

Richard
"Be practical, expect miracles." - James T. McCay
Quote Reply
Re: [Tricky Ricky] Subcat mod by Glennu - clarification needed In reply to
Glennu wrote in a previous post that his Mod assumed that the description was present. So I added some words in the first category and ran a new build .... voila, the sub categories were present for that category.

The subcategories are printed with a surrounding bracket, i.e. (subcat).

Any guidance on how to remove the bracket and replace with a comma between the sub categories would be appreciated.

Richard
"Be practical, expect miracles." - James T. McCay
Quote Reply
Re: [Tricky Ricky] Subcat mod by Glennu - clarification needed In reply to
Fun, huh? The "Yahoo-style" mod does pretty much the same thing as this one, and I know how to remove the description from it. Haven't used this one, so I'm not familiar with it.

To remove the bracket from your subcats, remove the red part from your code:

$sub .= "<a href =$name{$values}>($nam{$values}) </a>\n";


added: the other mod I mean is here: http://www.gossamer-threads.com/...late-version;#127003 (I have a hard copy, and used search terms that were sure to find the page I wanted...) Anyway, in that link, look at the code in red, it puts in commas where required, and puts a ... at the end. (I changed mine to say "more...".) Maybe you can adapt it to your needs.


Leonard
aka PerlFlunkie

Last edited by:

PerlFlunkie: Dec 18, 2002, 2:51 PM
Quote Reply
Re: [PerlFlunkie] Subcat mod by Glennu - clarification needed In reply to
I'm curious how this thread was viewed 350 times in two days?!? Is there a glitch in the hit counter? Or this subject that popular? Hmmm...


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Subcat mod by Glennu - clarification needed In reply to
Probably popularity, i.e. interest in the topic.

People are nervous about posting a question for fear of being told to search the forum for the answer. Often the answer is old, and the threads can sometimes go on to the point where the inexperienced find it confusing.

Searching the forums for info is a good idea. However, asking questions can not only bring in a new idea or approach BUT it also helps to stimulate the newbie such as myself to start to think about questions that can be asked and features that can be used.

But then, I guess, that is why there a new resource being put together, to help bring order to chaos.

I really do not understand why there is not some support in this forum from Alex or another staff person. I have spent a fair amount of time getting to know this product, and it features, and as well a couple of others.

Now that I am at the point of buying a licence, because it appears that Links 2.0 can do what I need at a price that I can afford, I really wonder about the lack of company support for the product.

Enlightened help from peer users is really wonderful, and I have found a lot of that here, but what ever happened to support from the manufacturer?

It seems to me that a logical growth path is from Links 2.0 to Links SQL, but I wonder how many potential buyers a re just walking away in frustration.

Richard
"Be practical, expect miracles." - James T. McCay
Quote Reply
Re: [PerlFlunkie] Subcat mod by Glennu - clarification needed In reply to
You haven't met the forum goblins?
Quote Reply
Re: [Paul] Subcat mod by Glennu - clarification needed In reply to
I'm not sure Smile

But to get back on track here. Thanks for the advice re the brackets.

The link underline now runs under all of the subcategories, as if they are one. I opened the page that has been generated in my editor and inserted a non breaking space between each of the subcategories to what would happen and that solved the problem.

What do I have to do in the script to achieve the same end result?

Richard
"Be practical, expect miracles." - James T. McCay
Quote Reply
Re: [Tricky Ricky] Subcat mod by Glennu - clarification needed In reply to
That has happened to me, and I guess I just fiddled enough that it got fixed... Make sure you entered the right code for the "ouput .= qq| etc..." for the style output you want.


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Subcat mod by Glennu - clarification needed In reply to
I just did a cut and paste of the code, but that still didn't stop the problem with the " " happening ... quess I'l be learning a little bit of Perl.

Unsure

Richard
"Be practical, expect miracles." - James T. McCay
Quote Reply
Re: [Tricky Ricky] Subcat mod by Glennu - clarification needed In reply to
To answer your question about the lack of GT staff involvement with and support for Links 2.0 is that the product is outdated and no longer being developed. GT has emphasized its efforts on more robust applications/products, including Links SQL, Gossamer Forum, the hopefully soon to be realized GT Community, DBMAN SQL, etc.
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [Stealth] Subcat mod by Glennu - clarification needed In reply to
maybe what RT was saying was that Links 2 could serve as an introductory product to the other G-T product lines...but with no active support from G-T for Links 2, maybe they are missing out on some future sales via upgrades to Links SQL or to their other products.....

Since I don't read all of the posts, when WAS the last time a G-T staff member posted something in the Links 2 forums.

And how long would it take an experienced perl programmer to add some of the basic mods to the original Links 2 code. Heck, I suspect G-T could contact some to the folks that created some of the more basic mods and include the mod in return for a credit line in the program.

If G-T is not going to actively support it, then just turn it into freeware.

IMHO Crazy


Gene
"The older I get, the more I admire competence, just simple competence in any field from adultery to zoology."
Quote Reply
Re: [esm] Subcat mod by Glennu - clarification needed In reply to
I have to agree here in a way. The only reason I found Gossamer-threads was through a visitors website that had links 2.0 on it. I thought the script was cool and made further enquiries. I bet the same can be said for the majority if users here. Links 2.0 is the stepping stone, it gets the people here, once here they can then view other products. I used links 2.0 for about 2 to 4 years and I am just waiting until I out resource the script before I upgrade. My links 2.0 is heavily modified and runs quite well in my eyes, these mods could have only been done with the help and support you receive in these forums. Take away the support and you lose new mods and updates, hence an old out fashioned script. Have an old fashioned script and no one wants to use it. I can see the GT wants all there users to use Links SQL, but its a lot of money to be honest. If you had a demo script or a restricted version you could use to see how it works etc that would be fine. But they don't, therefore links 2.0 is a good stepping stone.

I think losing the support of GT for links 2.0 is a big mistake, links ver XXX made it GT, How many people have the other scripts installed compared to Links. How many other people installed the other scripts because of links. Links 2.0 got us here and links 2.0 made other users buy other scripts.

Sorry this is just my 2 pence worth - throught it in the bin where it belongs.

Pirate
Quote Reply
Re: [esm] Subcat mod by Glennu - clarification needed In reply to
Quote:
If G-T is not going to actively support it, then just turn it into freeware.


That sounds like an excellent solution! Wink

A lot of us users are non-profit (!!!) anyway, so we are using the script for free. I can understand that Links2 has been left behind while "they" work on bigger, better projects. However, I really enjoy this program, and I know that many others do, too. It is a great learning tool, and can perform a variety of tasks on a website, depending on setup/modification. I also like the simplicity of a flat-file, static system. I'm sure SQL has much to offer, and maybe someday I'll have to add it to my "learn-by-doing-and-redoing" education. But for now, and for many of us, Links2 fills the bill!

BTW, I AM working on the Resource, and helpful(?) information will soon be available there. I put the site up before I really had written anything useful, but everyday I assemble a bit more data into a useable format. Feel free to HELP!Shocked


Leonard
aka PerlFlunkie