Gossamer Forum
Home : Products : DBMan : Customization :

First Post Here For DBMan!!

Quote Reply
First Post Here For DBMan!!
Hi All.

Just two quick questions!

(and I'm sure they've been asked a gazillian times!) Wink


1. How in the hee-hee do you change the [admin] password?


2. How do you sort by "Newest First"?
(rather then newest at the bottom.)


Thanks All.
Other then these two things... got it working perfect the first time!!



------------------
John B. Abela
Owner, 4CM
www.4cm.com/
support@4cm.com

Presently working on:
www.humbee.com/buzz/

Quote Reply
Re: First Post Here For DBMan!! In reply to
Password... login as admin, choose admin link, inquire user admin, type in new password, update user. Or-- install JPDeni's fabulous secure password change lookup mod... it's pretty involved, but worth it.

Sorting... add this to your search query with sb=the field number as defined in your .cfg file you want to sort by (starting with 0 for the ID)...
&sb=X&so=descend

------------------
The Immuatable Order of Modding
-=-=-=-=-=-=-=-
1. Read the FAQ, 2. Search the board, 2a. Search the board again, 3. ask the question, 4. back-up, 5. experiment, 6. rephrase question (or better yet, post solution to original question)

[This message has been edited by oldmoney (edited January 21, 2000).]
Quote Reply
Re: First Post Here For DBMan!! In reply to
Hey oldmoney.

Thanks for the help.
It's great to see some of you guys helping out in all the different script boards!

Well, I must admit...

I got the Password changed right away!
( Thanks! Smile )

However, the "sorting" recommendation still has me stuck.

Could you clarify/expand your thoughts a little bit for me?

If I was to take a *guess* I would think I am suppose to insert the code you supplied in the following part of db.cgi. But I could even be wrong there!

Code:
# Did we find a match? We only add the hit to the @hits array if we need it. We can
# skip it if we are not sorting and it's not in our first < > last range.
if ($key_match &#0124; &#0124; (!($in{'keyword'}) && !($in{'ma'}))) {
if (exists $in{'sb'}) {
$sortby{(($#hits+1) / ($#db_cols+1))} = $values[$in{'sb'}];
push (@hits, @values);
}
else {
(($numhits >= $first) and ($numhits <= $last)) and push (@hits, @values);
}
$numhits++; # But we always count it!
}
}
close DB;

# Now we've stored all our hits in @hits, and we've got a sorting values stored
# in %sortby indexed by their position in @hits.
$numhits ? ($db_total_hits = $numhits) : ($db_total_hits = 0);
($db_total_hits == 0) and return ("no matching records.");

# Sort the array @hits in order if we are meant to sort.
if (exists $in{'sb'}) { # Sort hits on $in{'sb'} field.
my ($sort_order, $sort_func);
$in{'so'} ? ($sort_order = $in{'so'}) : ($sort_order = "ascend");
$sort_func = "$db_sort{$db_cols[$in{'sb'}]}_$sort_order";

foreach $hit (sort $sort_func (keys %sortby)) {
$first = ($hit * $#db_cols) + $hit; $last = ($hit * $#db_cols) + $#db_cols + $hit;
push (@sortedhits, @hits[$first .. $last]);
}
@hits = @sortedhits;
}

Somewhere in there?

Thanks.
JbA

------------------
John B. Abela
Owner, 4CM
www.4cm.com/
support@4cm.com

Presently working on:
www.humbee.com/buzz/

Quote Reply
Re: First Post Here For DBMan!! In reply to
You might want to clarify what you're trying do with your sort... if you want to have a "hard coded" link to a search that will bring up certain records in a certain order, you don't have to edit anything...

<A HREF="$db_script_link_url&ID=*&sb=X&so=descend&mh=10&view_records=1">The whole enchilada</A>

translating this, it says, show me records with ANY ID, sort these records by field X in descending order, only show 10 at a time...

...substitute your Date field # for X

(BTW I really don't know that much about DBMan in comparison to Links...)

------------------
The Immuatable Order of Modding
-=-=-=-=-=-=-=-
1. Read the FAQ, 2. Search the board, 2a. Search the board again, 3. ask the question, 4. back-up, 5. experiment, 6. rephrase question (or better yet, post solution to original question)

[This message has been edited by oldmoney (edited January 21, 2000).]
Quote Reply
Re: First Post Here For DBMan!! In reply to
That is exactly correct, oldmoney.

Nice to see more LINKS users using DBMAN as well.

Wink

Regards,

------------------
Eliot Lee
Anthro TECH,L.L.C
http://www.anthrotech.com
Be sure to visit the Resource Center for FAQ's, Modifications and Extra Goodies!!
----------------------