Gossamer Forum
Home : Products : Links 2.0 : Customization :

Multiple Categories Mod for Links v2

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).]
Quote Reply
Re: Multiple Categories Mod for Links v2 In reply to
Logan T,

I have the mod running at http://www.online-sweepstakes.com/


Masque,

You need to either manually add the field to an existing database or write a script to do it for you. You can find a similar script at www.ten-tenths.com/links/mods/multicat/convert.txt , but you'll have to modify it a bit. I plan on writing a generic one when I get time.


rajani,

I would think anyone with 5,000 categories or a 7mb category.db file would be stretching the limits of Links and would be much better suited using something other than Links, probably custom stuff done in c. It goes beyond what Links is capable of and what it was written for.

I don't think you understand how the multiple categories mod works. I get the impression that you think Links makes a seperate entry in the database for each category a single link is listed under. No matter how many categories one link is placed under, there is only one record in the database for each link. The alternate categories are listed side by side in the AltCategories field for each link. Each alternate category is not placed in it's own field.

Brent

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

Yes I see the misunderstanding clearly. Also this is a result of checking the Megalinks + Alt_Cat function one user of links v2.0 made.

I checked the links.db and saw that it writes two lines for two submissions!! I now beleive that some thing there was fishy! Well,.....

Here is an example that could explain me and also to many others how the Multi_Cat will look like in the Links.db

If the user submits a link in three categories at the same time or afterwards.

America/AZ/Companies(CategoryID=777)

After the first submission his entry is already there in the URL.db. So he submits, no new ID is created, the entry gets in to the AltCategories field. Then he submits again. Question, where does the Categoriy|Alt

Games/America/AZ(CategoryID=888)
Computers/America/AZ(CategoryID=999)

Then how will this entry look like?


100|Title|http:/www.URL.com|31-Feb-2999|777|...888...999...|Description|ContactName|ContactEmail@ContactEmail.com|1000|Yes|Yes|2000|3000


Therefore I beleive one should create one more field to hold the two new entries of the submission categories. Also,ofcourse the respective changes must be made to the programing as you suggested beautifully on your mods page.

What I do not understand is ......if a new field is created...

You defined AltCategories, Alt_Cat, unique_categories...
----------------------
$db_alt = XXX
-----------------------
my (@values, $category, $cat, @alt_categories, @categorylist, $depth, $i, $cat, %unique_categories);
my $staggered_mode = shift | | undef;
----------------------
# We have to caluclate the affect of the link on each alt category as well as the main.
%unique_categories = "";
-------------------
# and also marks any above categories new, if this link is new.
for $i (0 .. $depth) {
if (! defined ($unique_categories{$cat})) {
$unique_categories{$cat} += 1;
$stats{$cat}[0]++;
}
----------------------
# Go through a little hoops to only load category list when absolutely neccessary.
if ($in{'db'} eq 'links') {
exists $db_select_fields{$db_cols[$db_category]}
or ($db_select_fields{$db_cols[$db_category]} = join (",", &category_list));
($db_select_fields{$db_cols[$db_alt]} = $db_select_fields{'Mult-AltCategories'} = join (",", &category_list));
}
else {
$db_select_fields{'Related'} or
($db_select_fields{'Related'} = $db_select_fields{'Mult-Related'} = join ",", &category_list);
}
foreach $field (@db_cols) {
--------------------------


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













[This message has been edited by rajani (edited February 25, 1999).]
Quote Reply
Re: Multiple Categories Mod for Links v2 In reply to
Loopy,
I made your changes as stated and I am receiving this error:
: fatal error: syntax error at /www/gcnet/forms/search2/admin/links.def line 37, near ")"

I checked and triple-checked to make sure everything was lined up correctly and such; any ideas?

BTW, THANK YOU for posting this mod for everyone, it was very selfless of you and you're not receiving enough gratitude for the hard work you're doing helping us work out our individual errors.
You're a saint! 8)

Raven
Quote Reply
Re: Multiple Categories Mod for Links v2 In reply to
hye,

i've implemented the mod to my links, all would work togehter - BUT:

the links wouldn't be shwon in the alternate categories.... :-(

what could be wrong?
*i'm using Links 2b4 and couldn't change to another version*

please help, thnx

------------------
www.ford-network.at



Quote Reply
Re: Multiple Categories Mod for Links v2 In reply to
ELMS:
you could take a look to the code of LLinks at www.ford-network.at/LLinks

there i've added this feature, may be if you take a look you'll find out how to do.

cu

------------------
www.ford-network.at



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

Do you know how to let users add alt category in the add form. I do not know what to add in db_utils.pl and site_html.pl. If I know what code it is for site_html.pl, then I think I can transfer it for template users...

Thanks in advance,
elms

------------------
www.webmerch.com
links@webmerch.com

[This message has been edited by elms (edited March 14, 1999).]
Quote Reply
Re: Multiple Categories Mod for Links v2 In reply to
To allow users of your site to add links in multiple categories the alternate category field needs to be added to add.cgi.

Had you looked at that, loopy?

Quote Reply
Re: Multiple Categories Mod for Links v2 In reply to
For those who have added Loopys great Multiple Categories mod to an existing database this may help. The old links.db in the admin/data file needs to have values inserted for the new field: AltCategories.
You need to manually add the AltCategorie name to an existing database by inserting it after the Categorie name in links.db
For categories with no multiple category simply paste |0| between category and description field.

------------------
Quote Reply
Re: Multiple Categories Mod for Links v2 In reply to
I'm having the same problem as Bogus, can
My links wont show up in the assigned alternate categories.

anyone please help?
Quote Reply
Re: Multiple Categories Mod for Links v2 In reply to
Comment about HJ's Post:

Or you could use the upgrade.pl file to add new fields into your links.db. You can create a null default value of "" in the upgrade.pl file. This automatically puts an extra delimiter after the main categories field in the links.db file. Then you can add the new "sub-categories" or alternative categories via the Modify Links option in the Admin Console.

The upgrade.pl file is located somewhere in the forum. I don't know where off hand...But you can search for "upgrade.pl" and you should find it.

Regards,

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us

Note from Bobsie: It is located at http://www.gossamer-threads.com/...um3/HTML/001090.html

[This message has been edited by Bobsie (edited August 26, 1999).]
Quote Reply
Re: Multiple Categories Mod for Links v2 In reply to
+++++++++++++++++++++++
RE:hye,
i've implemented the mod to my links, all would work togehter - BUT:

the links wouldn't be shwon in the alternate categories.... :-(

what could be wrong?
*i'm using Links 2b4 and couldn't change to another version*

please help,

I'm having the same problem as Bogus, can
My links wont show up in the assigned alternate categories.
anyone please help?
++++++++++++++++++++++++++++

Has anyone fixed this?



------------------
1010100101010010001
http://www.gqfitness.com
http://www.digitalskyline.com
Quote Reply
Re: Multiple Categories Mod for Links v2 In reply to
I can't find how to do this, but how do you have the user select multiple categories? What code do you insert in the add form? Does anyone know this for non-templates? Thanks.
-Greg
Quote Reply
Re: Multiple Categories Mod for Links v2 In reply to
I to am having problems getting to display properlly in the user add form.

This is the code in in my site_template_html.pl

my $altcategories = &build_select_field
("AltCategories","$in{'AltCategories'}","AltCategories","MULTIPLE Size=3
");

And the error message I am getting is

:error building select field: no select fields specified in config for field 'AltCategories'!



------------------
-------------------------
luke@thetravelhelper.com
Visit www.thetravelhelper.com
-------------------------
Quote Reply
Re: Multiple Categories Mod for Links v2 In reply to
Hi,

as much as I know and experienced, you can't select AltCategories from add.html.

The only way is to do it from admin panel...

A very good mod anyway!

Hope it helps Wink

Kodak
Quote Reply
Re: Multiple Categories Mod for Links v2 In reply to
Ok everybody, the multi-category mod works just fine by itself, if you want to add the additional categories throught the admin.

However if you want users to add to it you need to follow this link :

http://www.gossamer-threads.com/scripts/forum/resources/Forum3/HTML/000960.html

There you will find the code to add it to you add.cgi and everything else. If you installed the multi-category mod exactly then install this one exactly everything will work fine.

If you use the exclude mod from bobsie, then you will have to use my join mod to make both mods work.

that is at http://www.concepts2000.com/Mods/join.html

NOTE: my site will be down for about 72 hours, waiting for internic to finish making a change to my domain name.

I have used the multi-category mod for about 4 months now with no problems, and I have used the exclude mod with the join mod for about 3 months with no problems.

Remember, there is no way to use the multi-cateory and exclude mods together without the join mod.

Joker
DN Jacobsen
Concepts 2000
http://www.concepts2000.com
Quote Reply
Re: Multiple Categories Mod for Links v2 In reply to
Hello, how did you get the multiple categories listed on your site Loopy? I think thats what Ranjini was looking for..ie.
You have:entry frequency and then the links for that subject, then you have:prize(s)and the links for that subject..and so on, is that what your mod can do? It is exactly what I was looking for. To have 2 sections on the main page, Category and City...like prizes, and entry frequency.

Cam
Quote Reply
Re: Multiple Categories Mod for Links v2 In reply to
I only see one bad thing about this mod. Let's say I'm shifty shadey love to spam sites submitter and I wanna promote my new gizmo get rich scheme. I'd cross post this link to every possible alt category. Soon you have a spamful rich database with a bunch of get rich buy this links in every single category...even the unrelated ones. :-)

------------------
www.webgotcha.com
[b]admin@webgotcha.com[/b]
Quote Reply
Re: Multiple Categories Mod for Links v2 In reply to
No, the multiple categories mod doesn't have anything to do with the display of the categories. All I did was make a unique subroutine for each category that I wanted to be displayed differently.

For example, the category subroutine in nph-build.cgi gathers all the data for each category and sends it to a subroutine in site-html.pl to add the html. Instead of sending every categories' info to the same sub, I created a couple of different ones for each format that I wanted. And voila, you can format each category page anyway you want.

BTW, my site has been running off of Links SQL for a couple of weeks now and with the exception of a few minor bugs, it works perfectly. I highly recommend it to anyone considering making the jump.


Denver,
Yes, that's a very real possibility - if you allowed visitors to select multiple categories via the add url form, but the mod doesn't do that for that very reason. Only the admin can select the multiple categories.


Brent
Quote Reply
Re: Multiple Categories Mod for Links v2 In reply to
Very confusing!!! I have been reading the threads regarding Loopy's Mod but I can not get the idea somehow!!! probably due to the many topics and sub-issues that are discussed about this MOD. I would really appreciate your help if someone can tell me where to start and what do I really need to do the followings:

1)- Allow my visitor to submit his/her site using ADD URL or MODIFY URL form to one or two categories at ones. So I should have two CATEGORY fields to choose from on the ADD URL and MODIFY URL forms.

2)- To be easy to validate and insert the suggusted site into the suggusted categories in my site (using ADMIN.CGI - Means to have the same ID maybe...not sure.

3)- If someone searches for this link, only one link will appear in the search results (or maybe both form the two diffrent categories that the link is listed under).

I realy do not know what do I need. I thank you in advance in directing me ...

Regards..
Mark..
Quote Reply
Re: Multiple Categories Mod for Links v2 In reply to
 The following thread helps to place the tags on add.html, modify.html, etc.

www.gossamer-threads.com/scripts/forum/resources/Forum3/HTML/000960.html

[This message has been edited by DogTags (edited February 12, 2000).]
Quote Reply
Re: Multiple Categories Mod for Links v2 In reply to
Thank you for the link. I've added Loopy's Multi-Category Mod and Comments Mod (also from Loopy). Also, I followed http://www.gossamer-threads.com/scripts/forum/resources/Forum3/HTML/000960.html step by step. every thing seems to work fine except that category or subcategory pages get massed up. Means, the look of the tables inside these templates look massy. What could be the problem to fix the category and sub category pages knowing that I have not touch the template files when I installed these modules.
One more thing, should I implement this MOD http://www.gossamer-threads.com/scripts/forum/resources/Forum3/HTML/002377.html to make the alt-category works proberly as it suggusts. If so, could you please tell me what is the database file name that is used by links? is it db.pl? or is it something else.

I thank you in advance for your help and regards..
Mark Eiad
Quote Reply
Re: Multiple Categories Mod for Links v2 In reply to
Hi there,

Be careful about putting the mod in from the above thread as this replaces the ~~ with a <br> tag and stops the admin script adding to all selected catagories.

If anyone knows a way round this please let me know



------------------
Regards
MDJ
http://www.isee-multimedia.co.uk
Quote Reply
Re: Multiple Categories Mod for Links v2 In reply to
To all who will be using the multiple category mod.....be careful. I just added the mod to my site (using templates) and luckily I only had 3 links so far in my database.
When you add the AltCategories to your site, the data for already submitted links gets shifted in the links manager. IE: the contact email will be listed in the "Contact name" etc. Everything gets shifted up one, but then again it depends on where you add the AltCategories entry within your files. Regardless, it will mess up previous entries. Your best to add this mod before having people submit their sites (either that or you fix the entries themselves)
Other than that it is a great mod that is easy to apply. (im still waiting for someone to choose multiple categories to see if it definately works Smile
Quote Reply
Re: Multiple Categories Mod for Links v2 In reply to
Uh...skotty, you have to use the upgrade.pl file written by Bobsie to add the field in your links.db file! (AS stated in this Thread!)

Regards,

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
* Be sure to visit the Resource Center for FAQ's, Modifications and Extra Goodies!!
* Search Forums!
* Say NO to Duplicate Threads. :)
----------------------








Quote Reply
Re: Multiple Categories Mod for Links v2 In reply to
Sorry about that Eliot, this thread is so long that it is quite easy to forget some details along the way. Smile
At least I do take the time and SEARCH for help on the message board before asking a question unlike some people. Smile

I do have two issues after installing the mod though. Hopefully you or someone else can help me.
A couple of posts above, mdj1 says "Be careful about putting the mod in from the above thread as this replaces the ~~ with a <br> tag and stops the admin script adding to all selected catagories."
At first I didn't understand what he meant, but now I do. After modifying a category and selecting multiple "related" categories, the modification to the entry in the categories.db file gets written wrong. ~~ gets replaced by <br>

IE: 73|Discussion/Chat&#0124; &#0124;Discussion<br>Discussion/Message_Boards<br>Discussion/Newsgroups&#0124; &#0124;&#0124; &#0124;

What could be causing this and how do you fix it?

Also, since installing the mod I have noticed that if I go to an appropriate category, then choose add link, the add form's category field is no longer chosen for the user, instead it is now a drop down box, so the user can reselect the main category again. Before it was chosen and would not allow u to change it.
Is this normal after installing the mod?

Thanks for any answers people. Smile

skotty

Quote Reply
Re: Multiple Categories Mod for Links v2 In reply to
1) There have been codes posted in other forums to fix the <br> problem.

2) Make sure that you still have the following variable in the links.cfg file set to 1:

Code:
$db_single_category

like the following:

Code:
$db_single_category = 1;

Also, DogTags posted a fix to one of the bugs found in the db_utils.pl file. Keep on searching.

Regards,

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
* Be sure to visit the Resource Center for FAQ's, Modifications and Extra Goodies!!
* Search Forums!
* Say NO to Duplicate Threads. :)
----------------------








Quote Reply
Re: Multiple Categories Mod for Links v2 In reply to
Thanks for the reply Eliot.

I seem to have fixed the issue with ~~ being replaced with <br>

As for my other issue, the variable IS listed as $db_single_category = 1; so I'm not sure where the problem lies.
It's not a huge issue, but the altcategory mod must have done something to change this.

skotty
Quote Reply
Re: Multiple Categories Mod for Links v2 In reply to
Again...look at the Thread that DogTags posted about this issue.

Regards,

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
* Be sure to visit the Resource Center for FAQ's, Modifications and Extra Goodies!!
* Search Forums!
* Say NO to Duplicate Threads. :)
----------------------









Quote Reply
Re: Multiple Categories Mod for Links v2 In reply to
Scotti

How did you manage to overcome the <br> problem??

Wouldnt it be nice if the people who write the mods updated the instructions when bugs are found..

Not that im ungreatful!! it just would save alot of wasted time and effot here by those dedicated helpers IE Eliot



------------------
Regards
MDJ
http://www.isee-multimedia.co.uk
Quote Reply
Re: Multiple Categories Mod for Links v2 In reply to
That is a good suggestion.

BTW: All the mods I've written are constantly updated based on bugs found and also requested add-ons...but as I have mentioned before...I am through writing new extensive Mods...

Sorry.

Regards,

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
* Be sure to visit the Resource Center for FAQ's, Modifications and Extra Goodies!!
* Search Forums!
* Say NO to Duplicate Threads. :)
----------------------









Quote Reply
Re: Multiple Categories Mod for Links v2 In reply to
In db_utils.pl:

exists $in{$name} ? ($in{$name} .= "<br>$value") : ($in{$name} = $value);

change the <br> to ~~

I am assuming the person who changed this was trying to get a better format for the add_success page, but the change he implemeted also had adverse effects towards other areas of the script. Smile
Quote Reply
Re: Multiple Categories Mod for Links v2 In reply to
I have one issue unresolved with this mod.
After installing it, i changed the email-add.txt and email.mod.txt
files to incorporate the altcategory tag:

Title : <%Title%>
URL : <%URL%>
Category : <%Category%>
AltCategories: <%AltCategories%>
Description : <%Description%>
Contact Name : <%Contact Name%>
Contact Email: <%Contact Email%>

I figured this would work but it doesnt.
The confirmation email people are getting just says: Unkown Tag: AltCategories,
so something needs fixing to add this to the text files.

Can anyone help me with this one?

Thanks,
skotty
Quote Reply
Re: Multiple Categories Mod for Links v2 In reply to
skotty

This is NOT the only Thread that provides solutions to problems
related to the AltCategories Mod....

This Threads have solutions for your current problem!

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

USE the search engine...Found these Threads in less than a minute using Exact Search Match for AltCategories in email.

Regards,

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
* Be sure to visit the Resource Center for FAQ's, Modifications and Extra Goodies!!
* Search Forums!
* Say NO to Duplicate Threads. :)
----------------------









Quote Reply
Re: Multiple Categories Mod for Links v2 In reply to
Hi all,
I just added the Multiple Categories Mod, this Mod works fine except that it add 2 links in $numlinks EX:

Softwares (2) new
instead of
Softwares (1) new

I followed the instructions and check several times I'm 100% sure I didn't forget a thing.

you can find this mod here:

http://www.online-sweepstakes.com/links-mods/


If someone have an idea to fix that please let me know. Thanks in advance guys :-)
Quote Reply
Re: Multiple Categories Mod for Links v2 In reply to
loopy - not certain what I'm doing wrong here, but the altcat field doesn't become a drop-down field in the add record view.

It's just a plain field to enter text into.

Thanks in advance.

Best regards,
rjan Sandland
Quote Reply
Re: Multiple Categories Mod for Links v2 In reply to
I have implemented the AltCategories Mod. Now, when I view info about a specific link in the Admin search results page, all the fields below Category are pushed up. The Description information is in the AltCategories field, contact name information in the Description field, contact email information in the Contact Name field, etc. etc. The Receive Mail field is empty. I looked over the changes and they seem to match the most recent changes that you specified.

Please advise. Thanks.


Quote Reply
Re: Multiple Categories Mod for Links v2 In reply to
As discussed many times in this Thread and in this forum...you need to UPDATE your links.db due to the new field you added in the links.def file.

There is a script that will update your links.db with a delimiter for each record for the new field in the Adding Links to Links.db FAQ, which is located in the Resource Center.

Regards,

Eliot Lee
Quote Reply
Re: Multiple Categories Mod for Links v2 In reply to
Thanks. I assume you mean the "Directions on adding additonal fields in your links.db". If so, I tried that script and here is the result:

Opening output file . . .
Processing records
Undefined subroutine &main::split_decode called at links_convert.pl line 15, <DB
> chunk 1.

Line 15 is: @rec_in = &split_decode($_);

Not being versed in Perl, I'm not sure what is happening.

Quote Reply
Re: Multiple Categories Mod for Links v2 In reply to
In Reply To:
Thanks. I assume you mean the "Directions on adding additonal fields in your links.db".
Yep...that is the one.

Make sure that you are using the COMPLETE absolute path to db_utils.pl in the require line in the upgrade.pl file.

Regards,

Eliot Lee
Quote Reply
Re: [rajani] Multiple Categories Mod for Links v2 In reply to
Hi - do you still confirm the
efficiency of http://www.online-sweepstakes.com/links-mods/ ???
say yours please
Quote Reply
Re: [antoined] Multiple Categories Mod for Links v2 In reply to
When I use this mod my db is totally mixed up?! Frown

I.e. instead of the links description I get the Contact Name. Big problems with the field numbers. Does nobody else has any problems with this?
Quote Reply
Re: [C.] Multiple Categories Mod for Links v2 In reply to
Did you read this post by Stealth, just above your post?

Quote:


As discussed many times in this Thread and in this forum...you need to UPDATE your links.db due to the new field you added in the links.def file.


Did you add a new field, in the proper place, in the db?


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Multiple Categories Mod for Links v2 In reply to
In Reply To:
Did you read this post by Stealth, just above your post?

Quote:


As discussed many times in this Thread and in this forum...you need to UPDATE your links.db due to the new field you added in the links.def file.


Did you add a new field, in the proper place, in the db?


Yes, I did that. Links that HAVE a description don't give any problem (every field is on the right place), but links that DON'T HAVE a description are mixed up. Instead of the (empty) description I see the Contact Name...

C.
Quote Reply
Re: [C.] Multiple Categories Mod for Links v2 In reply to
Oops... I've got to learn counting... I missed one field on those links with a description... Sorryyyyy Blush

Btw, a tip for those that use the top 10 list mod (http://www.gossamer-threads.com/...ces/jump.cgi?ID=2057). You've also have to change the numbers of the fields used by this mod.

C.
Quote Reply
Re: [C.] Multiple Categories Mod for Links v2 In reply to
Welp, glad you figured it out...one piece of advice, you should not manually edit the links.db file, you should do one of the following:

1) Use the upgrade.pl script (codes are available in old posts in this forum)

-OR-

2) Download the links.db file to your computer and use Excel to add new columns, export the worksheet as a tab delimited (or whatever you chose for your delimiter) text file, re-name and links.db and upload the new links.db file to your web server.
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [Stealth] Multiple Categories Mod for Links v2 In reply to
In Reply To:
Welp, glad you figured it out...one piece of advice, you should not manually edit the links.db file, you should do one of the following:

1) Use the upgrade.pl script (codes are available in old posts in this forum)

-OR-

2) Download the links.db file to your computer and use Excel to add new columns, export the worksheet as a tab delimited (or whatever you chose for your delimiter) text file, re-name and links.db and upload the new links.db file to your web server.


Thanks for the tip! Wink
Quote Reply
Re: [Bogus] Multiple Categories Mod for Links v2 In reply to
I am having the same problem as Bogus with the altcategories mod, everything seems to work fine, but the alternative category links do not show in alternative categories. Has anyone found out what the problem is with the alt categories mod?

Please help!

ThanksJake
Quote Reply
Re: [awwa] Multiple Categories Mod for Links v2 In reply to
In Reply To:
I am having the same problem as Bogus with the altcategories mod, everything seems to work fine, but the alternative category links do not show in alternative categories. Has anyone found out what the problem is with the alt categories mod?


Actually I found out that the alt categories mod of the multiple categories mod does show links in multiple categories if you use the build all sub. If you use the staggered mode the sub is not building the links in the alternative categories.
Anyone have a fix for the bug. I believe the bug is in nphbuild.cgis sub, build_staggered.

Thanks a million

Jake
Quote Reply
Re: [awwa] Multiple Categories Mod for Links v2 In reply to
In Reply To:
In Reply To:
I am having the same problem as Bogus with the altcategories mod, everything seems to work fine, but the alternative category links do not show in alternative categories. Has anyone found out what the problem is with the alt categories mod?


Actually I found out that the alt categories mod, or the multiple categories mod does show links in multiple categories if you use the build all sub. If you use the staggered mode the sub is not building the links in the alternative categories.
Anyone have a fix for the bug. I believe the bug is in nphbuild.cgis sub, build_staggered.

Thanks a million

Jake
Quote Reply
Re: [awwa] Multiple Categories Mod for Links v2 In reply to
I don't think this is a 'bug' in the mod, but maybe an error in your installation, or a perhaps a conflict with some other mod/code change you made prior to installing this mod. The Multiple Category mod as posted on the online-sweepstakes site works fine, I have used in more than one Links install.

Recheck your code, add be sure to add #comments to the code when you change something, to make troubleshooting easier. For instance, if you change code withing code that has already been changed for another mod, it's possible either one or both will not work. By placing #comments in the code, you will know what is not original...


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Multiple Categories Mod for Links v2 In reply to
Seems this is a bug... Blush

I can only get the links to print in the altcats by using Build All. Using Staggered, the counts change correctly, but the links do not appear in any of the alt cats, only in the main cat. I have searched and not found an answer to this. I will study the build routines more closely, see if I can tell what's amiss.


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Multiple Categories Mod for Links v2 In reply to
Has anyone ever figured out why the multiple cats mod does not build the links in the alt cats using the staggard build, only build all?
Quote Reply
Re: [awwa] Multiple Categories Mod for Links v2 In reply to
In Reply To:
Has anyone ever figured out why the multiple cats mod does not build the links in the alt cats using the staggard build, only build all?

Ok, Here is the fix.

First of all in nph_build you need to replace this

print "This phase of step 2 took $elapsed seconds.\n\n";
($offset > $#categories) ?

with this

print "This phase of step 2 took $elapsed seconds.\n\n";
($offset > $#category_list) ?

this was wrong in the origional code and stopped staggered from working. Auto worked although.

Now the problem is build_stats is not run before categories are build so you need to replace

($step == 2) and do {
my @category_list = &category_list;
my $i;
print $header;
if ($auto) {

with this
($step == 2) and do {
my @category_list = &category_list;
my $i;
print $header;

print "Build Stats .. \n";
$t1 = time();
print "** Loading Summary information . . .\n";
&build_stats (1);
if ($auto) {

Now rebuild and it shows all links with alt cats in those cats.