Gossamer Forum
Home : Products : DBMan : Customization :

A somewhat Serious problem with Long-Short display

Quote Reply
A somewhat Serious problem with Long-Short display
Carol, Eliot, or anyone familiar with the inner workings of the Long-Short display mod.

Link-rot is the problem... even though we are using a modified long-short display mod on our site, I think what I found affects everyone using the long-short display mod.

The problem is how the short-display record links are being created. The way the links are created there is no reference to the actual record ID, the short list links are a dynamic link that changes every time a new record is added.

This creates a major link-rot problem if someone form another site links to a short-list link. Actually, it is a problem even if a site links to the long-record display because the long record link is calculated dynamically also.

If I have my thinking cap on straight, I believe all that needs to be changed is to add a reference to the actual record ID when the links are created. However, as with most problems it usually isn’t as easy as you first think.

I am ready to start working on the code, but thought I would first get some feedback and see if anyone had already corrected this.

Cheers!

------------------
Larry "NgtCrwlr" Mingus
www.makeitsimple.com

Quote Reply
Re: A somewhat Serious problem with Long-Short display In reply to
ID recalculating?? What?? It seems that you have a problem with the db_key_tracker and db_key variables in your default.cfg file. The ID of the link should not change whenever a new record is added.

Take another look at your db_key variable and make sure that you have it set correctly.

Also, what link are you using to the long view?? (I would gander that this link is also inaccurate.)

Regards,

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
----------------------


Quote Reply
Re: A somewhat Serious problem with Long-Short display In reply to
Eliot -- I must not have explained it properly.

First and foremost, our database's function fine. We don't have any problems with the databases, $db_key, or $db_key_track.

The problem comes in when someone links to any of our database records. The link is only valid until a new record is added to the database. This is because the record links are not referencing a record by ID or anything permanent. The links are dynamic and change every time you add a new record. Well actually the link doesn’t change but the record the link points to changes because the old record slips to a new spot after a new record is added.

Example:
Our home page has a section called Daily Blurbs which is a DBMan database that uses the long-short mod. To the right of the Daily Blurb table we have a short-list displaying the last ten blurbs.
If someone from another site links to one of the short list links that link will only point to the proper record as long as no new records are added to the database. When a record or records are added the link that the (other site) has will not link to the correct record because the link is based on &uid=default&sb=ID&so=descend&view_records=1&keyword=*&nh=2&mh=1 which has no reference to any individual record ID.

Get what I am talking about now? Wink

------------------
Larry "NgtCrwlr" Mingus
www.makeitsimple.com

Quote Reply
Re: A somewhat Serious problem with Long-Short display In reply to
Then that is your problem in terms of linking. If you do not have db_key defined and if you have turned off the db_key_tracker variable, then the records cannot be linked in a "static" manner like you have.

Also, why do you have sort by (sb) argument equal to ID? That should be linked to the number of the field in your %db_def hash.

One thing you could do is take out the keyword=* and replace that argument with a defined field in your %db_def hash.

Regards,
Quote Reply
Re: A somewhat Serious problem with Long-Short display In reply to
Eliot chill a little Smile

This is not a personal attack or anything like that and you seem to be defensive tonight. Then again it could be me, being to damned sensitive. LOL

About 5 months ago Carol and I worked on this together and she helped me setup my short/long display and I am assuming (dangerous) that ours is mostly the same mod as everyone else's.

Quote:
One thing you could do is take out the keyword=* and replace that argument with a defined field in your %db_def hash.

That may be the ticket right there, but mine was set to keyword=* from the start as far as I can remember. I could be way wrong because Carol and I did made changes along the way.

As far as the sb=ID that is another mod of mine and it works fine.

db_key_tracker is ON and db_key is defined and works fine. Our database works fine internally, it is only when someone links to us that there is a link problem.

My concern is the way my short/long mod works now, there is no way that an external link is ever going to be valid.

I think your suggestion of changing keyword=* to %db_def hash could be the fix.

Now the question is, is the original short/long mod set to use %db_def hash?

Maybe somewhere along the way I messed it up by changing it to keyword=*. If not, then others will have the same problem I am having. Until we get to the bottom of this we won't know.

I am going to go look at the original short/long display mod to see if Carol and/or I changed anything. I am also going to try your %db_def hash suggestion.

I do appreciate your help. Smile

------------------
Larry "NgtCrwlr" Mingus
www.makeitsimple.com

Quote Reply
Re: A somewhat Serious problem with Long-Short display In reply to
Well at this point I am pretty sure that this is not going to be nearly as easy to fix as it first looked.

Unfortunately, I am also fairly well convinced that this is a problem in the way the short/long display assigns links, and that the problem is not just my config and affects everyone that is using this mod.

The whole problem stems around the fact that the links are only good for a database that has not had records added or deleted. The variable nh= is constructed in the short/long mod to point to a record in memory not a record in the database. Once the database changes an external link coming from another site will no longer to point to the proper record.

Some how we need to come up with a way to call a record by its database ID in the build longURL part of the short/long display mod. At the same time keeping the function of next, previous, and multi-page display.

Eliot I hope I have explained this well enough, this one is above my head. I just experimented with a bunch of options and don't see any obvious quick fixes.

Here is a link to one of my test database's just in case you want to check it out.

www.makeitsimple.com/cgi-bin/dbman/opinions/opin.cgi

login: demo
pass: demo

I am going to go check out a few other sites to see if I can verify my suspicions.

------------------
Larry "NgtCrwlr" Mingus
www.makeitsimple.com

[This message has been edited by NgtCrwlr (edited October 27, 1999).]
Quote Reply
Re: A somewhat Serious problem with Long-Short display In reply to
Moving this one to the top...

Hi Eliot,

Are you at a loss on how to approach this problem too, still don't understand the problem, or are you just busy? This issue is an important one for me to get fixed.

I noticed in another post that you were going to try to reach Carol to see when or if she will be returning. Have you reached her yet?

Cheers!

------------------
Larry "NgtCrwlr" Mingus
www.makeitsimple.com

Quote Reply
Re: A somewhat Serious problem with Long-Short display In reply to
Okay...a point of clarification...

Code:
open (DB, "<$db_file_name") or &cgierr("unable to open db file: $db_file_name.\nReason: $!");
if ($db_use_flock) { flock(DB, 1); }
@lines = <DB>;
close DB;
$number_of_records = scalar(@lines);

(Add this at the top of your sub html_view_search routine before the first print qq|.)

Then add this line of code under your search form codes in the sub html_view_search routine:

Code:
<input type="hidden" name="mh" value="$number_of_records">

Another solution is to have people link to records in the following manner:


I REALLY hope this helps.

Wink

Regards,



------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
----------------------




[This message has been edited by Eliot (edited October 27, 1999).]

[This message has been edited by Eliot (edited October 27, 1999).]
Quote Reply
Re: A somewhat Serious problem with Long-Short display In reply to
Eliot please don’t' take this as sarcasm, but I am at a loss of how to explain this any better, you seem to be missing my point altogether.

From what I see, your suggestion of taking out the nh= is not a fix for the real problem, taking out nh= will break the long/short display. The idea here is to fix the long/short display and keep all of its function.

You go through a lot of work typing up examples, but until we are both on the same page, you are working hard and get nothing in return. Just trying to save you from unnecessary work.

I am curious if you use or have used the long/short mod. If not, tell me now and save us both a lot of typing. Smile

Let's go to short replies until we are both in agreement about what needs to be changed.

Ah.. What about Carol??

------------------
Larry "NgtCrwlr" Mingus
www.makeitsimple.com

Quote Reply
Re: A somewhat Serious problem with Long-Short display In reply to
I HAVE THE SHORT AND LONG MOD ON ALL MY DBMAN PROJECTS.

GOOD LUCK FIGURING OUT A SOLUTION.

CAROL IS NOT THE ONLY ONE WHO IS CAPABLE OF ANSWERING PEOPLE'S TECHNICAL ISSUES. SHE IS THE MODERATOR OF THE DBMAN FORUMS, BUT NOT OUR SAINT. GIVE OTHER PEOPLE CREDIT IN THESE FORUMS FOR THEIR SUPPORT AND ASSISTANCE!

Wink

REGARDS,

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
----------------------




[This message has been edited by Eliot (edited October 27, 1999).]
Quote Reply
Re: A somewhat Serious problem with Long-Short display In reply to
I am very sorry to have bothered you Eliot.

Obviously, I have said something to *** you off. Believe me, it never was my intent, and I apologize for whatever may have caused this feeling.

I don't know what else to say... Sorry!

------------------
Larry "NgtCrwlr" Mingus
www.makeitsimple.com

Quote Reply
Re: A somewhat Serious problem with Long-Short display In reply to
Whew... this was getting to be a bit rough... I too came into this situtaion as so does _everybody_ that uses the Long/Short MOD. What ends up happening is that when you click on the link for the long record, you get a generated link that only works for the search pattern returned for the short listing. In my case:

http://ths-alumni.musicshoppe.com/...ew&nh=1&mh=1

gives the first of three longer records based on a search for 1995 graduation year. Now if somebody bookmarks that link and visits it after another person adds a record with 1995 as a Year of Graduation, there are now actually 4 records being returned... But they are in a different order... So what used be one record returned above now may be a different record.

I've only discovered this because I wanted to place my own link to my personal record on another page. But many other people added records and my name no longer came up with that URL.

Unfortunatly, there's no way to get around it because of the nature of the MOD actually searching the database to come up with it's list of records.

Eliot - I'm glad that you're hear trying to help. With JPD seemingly absent, I know that it's quite difficult to get a wrap around some issues... And I may have missed this boat all together myself... But because the MOD doesn't issue the link based on the Record_ID - you can't make a static link to it...

-Dave
Quote Reply
Re: A somewhat Serious problem with Long-Short display In reply to
doh!!!

This is gunna mess me up! I have a "more info mod" in place that sends an email with a link back to the record.

I have never found what you have said to be true, but I also have not been trying to make this error occur.

Does anyone know how to make this *problem* work?



Quote Reply
Re: A somewhat Serious problem with Long-Short display In reply to
I am very surprised that it took this long to find anyone else that see's this as a real problem.

The problem now is finding someone that is willing to work out a solution. I know it can be done it's just finding someone kind enough to help. So far I've had no luck.

I'm a pretty good Perl hack not a programmer, and without help I'm stuck. I have managed to work up a partial fix that creates links by record ID, but need help iorning out a few bugs.

If anyone is interested let's start a new thread.

------------------
Larry "NgtCrwlr" Mingus
www.makeitsimple.com
Quote Reply
Re: A somewhat Serious problem with Long-Short display In reply to
Hi

I think this depends on which short-long display mod you use - a couple of months ago I did this site: http://www.sheffcol.natfhe.org , which has headlines from a DBMan database on the front page and they have the link-rot problem, this sites used the a recent version of the long-short mod. On the other hand this site: http://www.webarchitects.co.uk/scripts/newsman/ , which was hacked together about 6 months ago has URL's based on ID numbers and is fine.

If I work out what exactly is going on here I'll try to post something to the resources site.

Chris