Gossamer Forum
Home : Products : Links 2.0 : Customization :

Multiple Categories Mod for Links v2

(Page 1 of 4)
> >
Quote Reply
Multiple Categories Mod for Links v2
I made a multiple category mod for Links v2, to see it go to
http://www.online-sweepstakes.com/links-mods/

Brent
Quote Reply
Re: Multiple Categories Mod for Links v2 In reply to
If anybody has had any problems with the mod, you might want to go back to http://www.online-sweepstakes.com/links-mods/ .

Seems I forgot a step and misnumbered the fields in links.def. It's been corrected.

Brent
Quote Reply
Re: Multiple Categories Mod for Links v2 In reply to
Brilliant loopy!

Would you mind if I add a link to these instructions from mine on the original Multi-Cat mod of 1.1 ?

I've had a load of email this week asking when I am going to get round to updating them Smile

------------------
Craig Antill
10 Tenths Motorsport (1.1) - www.Ten-Tenths.com/links/
THE Directory (2.0b3) - www.gardenbuildings.com/
Quote Reply
Re: Multiple Categories Mod for Links v2 In reply to
No problem Craig, link away.

Brent
Quote Reply
Re: Multiple Categories Mod for Links v2 In reply to
My bad.

[This message has been edited by loopy (edited February 13, 1999).]
Quote Reply
Re: Multiple Categories Mod for Links v2 In reply to
When I tried to use the mod I got this and it hangs :

Links Manager: Building Pages
Building Pages
Pages built on 14-Feb-1999 at 11:59:28
--------------------------------------------------------

Backing up database . . .
Backup exists for today.. Skipping
Done.

Building URL Index . . .
Done.

Updating New and Popular Records . . .
What's New Cutoff: 14 days
Popular Cutoff: 8 hits
Updating record: 3, marking as new.
Updating record: 4, marking as popular (8).
Updating record: 4, marking as new.
Done.

Updating ratings ..
Done.

Loading Category Information . . .
Done.

Gathering Category and Link information . . .


If I tranfer the original files everything works ok. . Would you be willing to look at my code to see if anything is different ?


Thanks,
lpluby Smile
Quote Reply
Re: Multiple Categories Mod for Links v2 In reply to
Sure lpluby, I'll take a look. However you want to do it...

Brent
Quote Reply
Re: Multiple Categories Mod for Links v2 In reply to
Hello everyone! Thanks to Michael and Jose, I fixed a couple of errors that were on the web page explaining the mod.

If you attempted the Multiple Category mod before now, here are the changes:


AltCategory => [5, 'alpha', 0, 500, 1, '', ''],

now reads...

AltCategory => [5, 'alpha', 0, 500, 0, '', ''],

This allows the field AltCategory to be NULL (empty)


And...
# Field names you want to allow visitors to search on:
@search_fields = (1,2,5);

now reads...

# Field names you want to allow visitors to search on:
@search_fields = (1,2,6);

You don't want your visitors to search the AltCategories field instead of the description field do you?


And finally in the procedure build_stats in the file nph-build.cgi the line:

LINE: while () {

should read...

LINE: while (<DB> ) {

The way I had it, "<DB>" was read by your browser as an html tag, so it didn't display.


There you have it. Knock on wood, everything should now work AOK. Any more problems, let me know and I'll get them fixed asap. www.online-sweepstakes.com/links-mods/ has been updated to reflect these changes.

Brent

[This message has been edited by loopy (edited February 17, 1999).]
Quote Reply
Re: Multiple Categories Mod for Links v2 In reply to
Can this modification be expanded to allowing several alternate categories (not just one). Would it be as simple as just adding a AltCategory1, AltCategory2 ?

Also is there any info on how to add the altcategory to the add a resource option for users submitting sites?
Quote Reply
Re: Multiple Categories Mod for Links v2 In reply to
You can add as many alternate categories as you want the way the mod is right now. If you get an error message that says the AltCategory field is too large (because you have several alternate categories) all you have to do is increase the maximum size of the AltCategory field as follows:

From this...

AltCategory => [5, 'alpha', 0, 300, 0, '', ''],

to this...

AltCategory => [5, 'alpha', 0, 500, 0, '', ''],


It doesn't have to be 300 to 500, it can be whatever you want. If you think you're going to have 5 or more categories for a link, then you might want to go ahead and change it to 500 or even more depending on how many alternate categories a link in your database might have.

Letting your visitors suggest multiple categories themselves maybe something you want to think about. It might be more trouble than it's worth. Personally, I give visitors a comment field they can use to suggest additional and/or alternate categories. There are also many other benefits to a comment field (more open feedback, more personal). *I'm probably setting myself up to write out another mod.* Let me know what you want and I'll get it out as soon as I can, maybe late tonight or tomorrow.

Brent
Quote Reply
Re: Multiple Categories Mod for Links v2 In reply to
Hello,

I agree that this is a very useful MOD. But it effectively renders the Check Dup routine useless, for the AltCat item and its counterpart in the regular Cat are shown as duplicates. Is there any way to avoid this? The Check Dup function is also very important, especially if you manage a site with a lot of links.

------------------
Jian Liu
Indiana University Libraries
Quote Reply
Re: Multiple Categories Mod for Links v2 In reply to
From the Links v2 check_duplicates subroutine in db.pl:

Quote:
# This routine searches through the database and pulls up sets
# of links that have the same domain.

The duplicate check has nothing to do with how many categories a link is listed under. The field AltCategories is not used by the check_duplicates subroutine at all and has nothing to do with any duplicate links you might have.

Brent
Quote Reply
Re: Multiple Categories Mod for Links v2 In reply to
loopy,

The comment in the code you quoted is not right. Links v2 matches on the whole URL, not just the domain.

------------------
Bob Connors
bobsie@orphanage.com
www.orphanage.com/goodstuff/
goodstufflists.home.ml.org/


Quote Reply
Re: Multiple Categories Mod for Links v2 In reply to
Hello there!


Mr. Loopy
You mention !

You can add as many alternate categories as you want.

This means one could have many MAIN categories and then within those main categories have also subcategories for each of those main categories. Is that what you mean?

Also in such a case for e.g. if there are

Altcat1
Altcat2
Altcat3

then there will be three pop up displayed instead of just one of categories. True?

That would be ofcourse great.

thanks


[This message has been edited by rajani (edited February 17, 1999).]

[This message has been edited by rajani (edited February 17, 1999).]
Quote Reply
Re: Multiple Categories Mod for Links v2 In reply to
Thanks loopy, the mod worked great for adding a link into several categories at once. However, now the problem is that 2 categories are required. If I leave AltCategory unselected or select the -- that shows at the top of the category list I receive this error.
AltCategory (Can not be left blank)
-------
p.s.
I don't know anything about programing, but just using common sense, I think I figured it out. I went to links.def and changed the 1 to a 0. I hope this is correct and hasn't messed anything else up?


[This message has been edited by lunaria (edited February 17, 1999).]
Quote Reply
Re: Multiple Categories Mod for Links v2 In reply to
Yes Bobsie, I'm aware that it checks for duplicates on the whole url and not just within the domain. That wasn't the point. The point was to show jiliu that the multiple categories mod had nothing to do with the check_duplicates subroutine and in support of that, I took the quote from the subroutine's comments.

Brent

[This message has been edited by loopy (edited February 17, 1999).]
Quote Reply
Re: Multiple Categories Mod for Links v2 In reply to
That's exactly right lunaria. From a previous post in this thread:

Quote:
AltCategory => [5, 'alpha', 0, 500, 1, '', ''],

now reads...

AltCategory => [5, 'alpha', 0, 500, 0, '', ''],

This allows the field AltCategory to be NULL (empty)

rajani, I'm sorry but I have no idea what you're trying to say. The multiple categories mod lets you list a link under one or more categories or subcategories. It doesn't have anything to do with how many categories and subcategories you can have in Links. You can theoretically have as many as you want with or without the mod. The mod only allows you to place a link into more than one category and/or subcategory. Cool?

Brent

[This message has been edited by loopy (edited February 17, 1999).]
Quote Reply
Re: Multiple Categories Mod for Links v2 In reply to
Guess I was totally wrong about the
check dup routine. Sorry and thanks.

------------------
Jian Liu
Indiana University Libraries
Quote Reply
Re: Multiple Categories Mod for Links v2 In reply to
Hello loopy!


In the submission form we have one url, category(Main) and then
description.

Now this is less for me.

In the submission form I would like is :

one url, category1(Main) category2(Main), category3(Main) and
then description.

Each of this main will have sub-categories using seperate datases
of their own.

This means I will have

category1.db category2.db, category3.db


Submission in

1 - Main Subject categories (I.e. in sub-categories of this Main)
2 - Main Geographic Categories (I.e. in sub-categories of this Main)
3 - Main Alphabetic Categories (I.e. in sub-categories of this Main)

So I need three databases of categories (Different Main categories with their respective sub-categories) and also those related fields in the links.db defined with respect to this.

In this system, there should be three pop-up will appear instead of one for the categories.

Multiple categories I means Multiple Main Categories. So with one click a surfer could submit in all three choosen categories.

"Multi-Categories<<<>>>Multi-submission"

Do you think this is possible?


------------------
rajani











Quote Reply
Re: Multiple Categories Mod for Links v2 In reply to
If I did want users to be able to select an Alternate Category, how would I do that? I tried adding the field in the add.html, using <%AltCategory%> using the same format as category.
However, I think I have to define the variable. I am using templates so I presume it would go in site_html_templates.pl in the site_html_add_form routine. This is what I tried. I'm not a programmer, so please don't laugh at my pitiful efforts if this is completely wrong! Smile
Quote:
sub site_html_add_form {
# --------------------------------------------------------
# This routine determines how the add form page will look like.
#
&html_print_headers;

my $category = shift;
$category ?
($category = qq~$category <input type=hidden name="Category" value="$category">~) :
($category = &build_select_field ("Category", "$in{'Category'}"));

my $altcategory = shift;
$altcategory ?
($altcategory = qq~$altcategory <input type=hidden name="AltCategory" value="$altcategory">~) :
($altcategory = &build_select_field ("AltCategory", "$in{'AltCategory'}"));

print &load_template ('add.html', {
Category => $category,
AltCategory => $AltCategory,
%globals
});
}
I'm getting this error message.
error building select field: no select fields specified in config for field 'AltCategory'! The AltCategory is working beautifully from the admin side, so that isn't the problem.

loopy, I would also like to know how you added the comment field to your add. I can add it to the submit form, but it doesn't come through to me in the mail i get, and of course doesn't show in the validate.

Any help would be much appreciated.
Quote Reply
Re: Multiple Categories Mod for Links v2 In reply to
rajani,

I have no idea why you would want 3 seperate category databases. You're asking for some major modifications. I'm sure there are much easier ways to go about whatever it is you're trying to do. In either case, you're asking for quite a lot. It's a custom job and you're either going to have to figure it out for yourself, or pay someone to do it.


lunaria,

I don't use the templates and have never even looked at them so you're on your own there. As far as the comments mod goes, I'll post it either tonight or tommorrow.

Brent

[This message has been edited by loopy (edited February 21, 1999).]
Quote Reply
Re: Multiple Categories Mod for Links v2 In reply to
Hello loopy!

I did not know that it would require major modifications!!!

I thought of suggesting in general, also for my use, and for its development of this lovely program.

thanks

------------------
rajani











Quote Reply
Re: Multiple Categories Mod for Links v2 In reply to
Does anyone have a working version of this mod that I can see? Thanks

L.T.
Quote Reply
Re: Multiple Categories Mod for Links v2 In reply to
Found a problem in adding this mod to an existing database of links. After adding it, in the admin pages, the field for RecieveMail (yes or no) no longer shows. When you go to email link owners it says no users found. Is there a fix for this?
Quote Reply
Re: Multiple Categories Mod for Links v2 In reply to
Hello Mr. Loopy!

I hav not installed this AltCat mode yet.

For e.g. A library is using this for the cateloging. There would be atleast 5000 categories. For instance someone from Indiana university said :..My category database is 7MB!!! Then is the qusetion, why not divide it?

Also Multiple submission means that a new ID is created and all the necessary information is newly written in the links.db.

Lets say this information is then the same for three categories. Why then have three lines occupied in the links.db?

Better is then to create two more new fields and let the add.cgi fill in the ID of the categories in there? That would save a lot of space in this FAT (of Flat) file system!!!

Thats what I mean also in my message :

http://www.gossamer-threads.com/...um3/HTML/000691.html

thanks













[This message has been edited by rajani (edited February 24, 1999).]

[This message has been edited by rajani (edited February 24, 1999).]
> >