Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

1.1b2: setup.cgi bug

Quote Reply
1.1b2: setup.cgi bug
well.. i was wondering why i always got access denied and discovered that your forms all use user and pass not USER and PASS..

so i changed

Code:
$USER = $in->param('USER');
$PASS = $in->param('PASS');

to

Code:
$USER = $in->param('user');
$PASS = $in->param('pass');
(hehe.. i didn't change anything in the original post.. had 2 equal codes Smile)

of course i think changing the form names to USER and PASS is more appropriate.. but this way is easier Wink

and everything worked..

jerry

[This message has been edited by widgetz (edited November 09, 1999).]
Quote Reply
Re: 1.1b2: setup.cgi bug In reply to
and Alex..

Newest_Link in Category..

is that just to speed up the process of finding the newest link in a category? it's a weird field.. but couldn't you do that with a query like..

SELECT Links.*
FROM Links, Category
WHERE Category.ID = ? AND
Links.CategoryID = Category.ID
ORDER BY ID DESC
LIMIT 1

?

jerry
Quote Reply
Re: 1.1b2: setup.cgi bug In reply to
Wow, how on earth was that working on my system. Wink Thanks, fixed it.

As for Newest Link, this is for the three level new mod. It's so you can figure out how many days old a category is in a link.

Two problems with what you suggested:

1. Largest ID does not neccessairly mean newest link.
2. It does not include subcategories. This is the newest link in the current category and all subcategory.

Cheers,

Alex
Quote Reply
Re: 1.1b2: setup.cgi bug In reply to
Alex,

What about adding a "DaysOld" field to the database? Before processing the database, do an UPDATE such that DaysOld = From_Days(Add_Date)

This field can be used when building, to prevent the overhad necessary on each iteration. I've tried UPDATES before, and they go pretty fast.

You can also limit it to only records where Add_Date <= SUBDATE (Cur_date, INTERVAL 14 DAY)

Then <%Days_Old%> is just a numerical field value, not something that has to be calculated each time.

This could be done when looking for new records, and set to "NUL" when unmarking new records. All this at a price of a few bytes, rather than MIPS.

In reality, the "isNEW" field could be made a numeric, so that '0' is NO and any positive value is how many days old.

Is there a reason for not doing this?

Quote Reply
Re: 1.1b2: setup.cgi bug In reply to
Alex

well ok.. i looked at the 2 queries you used for Newest Link.. but can't you just use that to process instead of adding a field?

[i just think that field is a little strange Smile..]

also.. can you please take a note of everything you change in the next version.. ie: # of the line from 1.1b2..

cause i don't think i want to start with 1.1 final.. i haven't had much problems with this version.. [you arn't expecting BIG changes right?]

pugdog

i don't know.. i don't really think another field is required.. this is a really simple routine and should take no time at all.. every build you make it will calculate daysold (if uncommented).. so if you wanted to do it with the DB.. you'd have to do the same.. but add another field into $update_category in build_stats as well as a few lines to calculate..

since you don't use a category more than once in a database (where you actually use daysOLD).. it will be useless there..

but if you did it with the Links.. it'd be ok.. cause you use links multiple times (sometimes).. you'd add it to like build_updatenewpop or something

jerry
Quote Reply
Re: 1.1b2: setup.cgi bug In reply to
hi again.. i noticed that you had

Code:
$get_subcat_list->execute("$name/%");
$sub_list = "$id,";
while (($sub_id, $sub_name) = $get_subcat_list->fetchrow_array) {
$sub_list .= "$sub_id,";
$sub_name =~ s/\Q$name\E//;
$depth = $sub_name =~ tr,/,/,;
$update_subcat->execute ($id, $sub_id, $depth);
}
chop $sub_list;

i have this in my DB_UTILS.pm.. but it doesn't update the hierarchy..

anyways.. i think you have a bit of "sleepy" code there.. Smile it's not a problem.. it's just something i find weird that YOU, Alex, did.. Smile

change
Code:
$sub_list = "$id,";
to
$sub_list = "$id";

change
Code:
$sub_list .= "$sub_id,";
to
$sub_list .= ",$sub_id";

then delete
Code:
chop $sub_list;

hehe.. i'm pretty much slowly staring at your code for edits from 1.1b1 and saw that..

jerry

well.. it saves 16 bytes off of nph-build.cgi Wink
Quote Reply
Re: 1.1b2: setup.cgi bug In reply to
I'm having trouble for the first time trying to upgrade -- and you are moving commas around!

16 lashes with a wet noodle!


Quote Reply
Re: 1.1b2: setup.cgi bug In reply to
heheh..

if you need help installing.. i'll help

jerry