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).]
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).]