Gossamer Forum
Home : Products : DBMan : Customization :

--> Sorting Alphabetical Listing <---

Quote Reply
--> Sorting Alphabetical Listing <---
JPDeni and everyone,

Hello...I have been working with a hacked version of a db.cgi script for a LINKS generated database for awhile and I am stumped. I am using two stand alone scripts that utilize the following:

1) alpha.cgi => lists links to links in alphabetical order. (Alphabetical Listing Mod found in this Forum.)

2) showrec.cgi => hacked version of db.cgi, with only bare bone sub-routines, including:

a) sub query
b) sub view_records (vr in my case)

The script requires the LINKS library files (like db_utils.pl and links.cfg, which includes all the date routines and build routines used in DBMAN).

Okay...the problem is that the LINKS are not sorted alphabetically by the "Title" field even when I use the &so and &sb arguments in the query string.

I have reviewed the subs between the library files and the orginal db.cgi file...there are subtle differences between them...and I have even tried un-requiring the LINKS library files and using the built-in subs of db.cgi...still no go.

I have also tried hacking the elsif statements in the sub query to sort in ascending order for queries made with the "Title" field. Still no go...

To see this in action...go to:

http://vlib.anthrotech.com/bin/alpha.cgi

Click on one of the letters.

You will see that the results are being sorted by the date field in ascending order rather than the Title field. The Title field number is 1.

To see the source code of these scripts (alpha.cgi and showcat.cgi) go to the following URLs:


If you, Carol, or anyone else have ideas about how to make this hacked script work, I would greatly appreciate it.

Thank you....

BTW: I did post this question originally in the LINKS Modification Forum...and since the script uses DBMAN subs, I thought I may have more success posting it in the DBMAN Discussion Forum.

Regards,



------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
Quote Reply
Re: --> Sorting Alphabetical Listing <--- In reply to
Since this is not directly related to DBMan perhaps the best place to post your questions would be in the forum for perl/cgi.

That is where the perl experts hang out and questions that are not specific to a certain script are asked.

Just a thought. It would help to keep this forum on the topic of DBMan issues.
Quote Reply
Re: --> Sorting Alphabetical Listing <--- In reply to
And who is the Moderator???

This does DIRECTLY relate to DBMAN since it USES the Alphabetical Listing Mod and also uses subs and LOGIC within the DBMAN script.

I did not know they have made a new moderator.

If I was using a COMPLETELY different script, I WOULD post this type of question in the Perl/CGI forum! YOU of all people should KNOW that I am respectful to these forums and their intended content!

Frown Frown Frown Frown Frown Frown Frown Frown Frown

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
Quote Reply
Re: --> Sorting Alphabetical Listing <--- In reply to
Now, now. Let's not fight. I really want this place to be civil.

I am a little confused, Eliot, because you are talking about LINKS and db.cgi. I'm not really sure where your question belongs. It does use some parts of DBMan, but it also uses Links. And it is a new "animal," so to speak, so it might go in Perl/CGI.

Tell you what, I'll see what I can do to answer your question. If I can't help, you might have better luck elsewhere. Deal?

I'm not familiar with the Alphabetical Listing Mod. The "search" link is giving me an internal server error right now, so I don't know what it is. Can you give me a link to the thread where it's talked about?

Or is this the little thing I wrote a long time ago?

I tried to use &sb= 0, 1, 2 and 3, and it came back with the same order. Which means that either the script is not recognizing $in{'sb'} from the URL or it is not utilizing it in sub query.

Or it is not recognizing the numbers of the fields for some reason.

I know that we each have different styles of working, but if I were to work with something like this, I would create the database using the complete files in DBMan and get it to work correctly. Then I would start deleting things I didn't need, one at a time, checking to make sure everything worked correctly with each deletion. But that's just me. Smile

Without knowing what code you're using, it's impossible to know where it's going wrong.




------------------
JPD





Quote Reply
Re: --> Sorting Alphabetical Listing <--- In reply to
JPDeni, the only part of these scripts that is LINKS is that the database is created via LINKS...But the structure of the database is exactly the same as a DBMAN database. And I am using a separate "default.cfg" for that is DBMAN, which is used for these scripts.

Everything else is DBMAN.

The Alphabetical Listing Mod was written by you last summer. It takes the first letter of a field and gives an alphabetical directory.

And the subs in the showrec.cgi are the following:

sub view_records
sub query

(Which are the same as the stock db.cgi script.)

I did begin with a full copy of DBMAN and then I scaled back to what I needed in db.cgi.

The problem I am having is getting the results in the showrec.cgi script, which is linked from the alpha.cgi script to list in alphabetical order via the Title field rather than the Date field in ascending order.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums


[This message has been edited by JPDeni (edited March 28, 2000).]
Quote Reply
Re: --> Sorting Alphabetical Listing <--- In reply to
I find your changing the names of the scripts and the subroutines very confusing. (Old dogs and new tricks, I guess. Smile )

In whatever the .cgi script is that does the searching, do you have

sub parse_form

and

sub query

completely intact as in the original db.cgi file?


------------------
JPD





Quote Reply
Re: --> Sorting Alphabetical Listing <--- In reply to
Yep. (I did just add the original sub parse_form...)...still the same result...sorting by date in ascending order no matter what values I insert in the sb argument.

Oh well...if you have any other ideas...please let me know.

UPDATE...Finally figured it out...

Thanks anyway.

Regards.

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums


[This message has been edited by AnthroRules (edited March 28, 2000).]