Gossamer Forum
Home : Products : DBMan : Installation :

Problem with column so/sb mod

Quote Reply
Problem with column so/sb mod
I thought these worked and haven't changed anything but it seems a variable is blank in the path. Here is the path I get online with the following code:

.../db.cgi?db=default&uid=xxx&view_records=1&so=&ID=*&sb=32&so=ascend

Seems it's getting the first so from $new_url and the second from the html. Why is it blank? What is wrong with this code:

# Go through each hit and convert the array to hash and send to
# html_record for printing.
$new_url = $ENV{'QUERY_STRING'};
$new_url =~ s/\&sb=\d+//;
$new_url =~ s/\&so=\w+//;
for ($col=0; $col <=$#db_cols; ++$col) {
if ($in{'sb'} == $col) {
if ($in{'so'} eq 'descend') { $sb[$col] = 'ascend'; }
else { $so[$col] = 'descend'; }
}
else { $so[$col] = 'ascend'; }
}

# Note: In each of the header cells, replace # with the field number
# of the field that is associated with that header -- in both places within each line.
print qq|
<TABLE border=1 width=90% align=center>
<TR>
<TD align=center><a href="$db_script_url?$new_url&sb=0&so=$so[0]">ID</a></TD>
<TD><a href="$db_script_url?$new_url&sb=17&so=$so[17]">Domain</a></TD>
<TD><a href="$db_script_url?$new_url&sb=2&so=$so[2]">Name</a></TD>
<TD><a href="$db_script_url?$new_url&sb=3&so=$so[3]">Company</a></TD>
<TD><a href="$db_script_url?$new_url&sb=30&so=$so[30]">Status</a></TD>
<TD><a href="$db_script_url?$new_url&sb=29&so=$so[29]">Paid?</a></TD>
<TD><a href="$db_script_url?$new_url&sb=32&so=$so[32]">Price</a></TD>
<TD><a href="$db_script_url?$new_url&sb=26&so=$so[26]">IP Address</a></TD>
</TR>\n|;


Thanks!

Chris
Quote Reply
Re: [jnjhost] Problem with column so/sb mod In reply to
Try changing:

if ($in{'so'} eq 'descend') { $sb[$col] = 'ascend'; }

to:

if ($in{'so'} eq 'descend') { $so[$col] = 'ascend'; }

Whenever it is calling for "so" it is looking for either descend or ascend.

If this is the spreadsheet mod, look over all the coding in the mod and make sure you make the same changes where necessary.

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] Problem with column so/sb mod In reply to
It is the spreadsheet mod. I made that change and no dice. Still get the same path in the column title:

.../db.cgi?db=default&uid=xxx&view_records=1&so=&ID=*&sb=29&so=ascend

Here is what my code looks like now (with your change), and I changed it in three places; view_success, delete_form, modify_form:

if ($status ne "ok") { # Error searching database!
print qq|<P><FONT COLOR="RED" SIZE=4>Error: $status</FONT>|;
}
else {
print "<P>";
$new_url = $ENV{'QUERY_STRING'};
$new_url =~ s/\&sb=\d+//;
$new_url =~ s/\&so=\w+//;
for ($col=0; $col <=$#db_cols; ++$col) {
if ($in{'sb'} == $col) {
if ($in{'so'} eq 'descend') { $so[$col] = 'ascend'; }
else { $so[$col] = 'descend'; }
}
else { $so[$col] = 'ascend'; }
}

# Note: In each of the header cells, replace # with the field number
# of the field that is associated with that header -- in both places within each line.
print qq|
<TABLE><TR><TD><a href="$db_script_url?$new_url&sb=0&so=$so[0]">ID</a></TD>
<TD><a href="$db_script_url?$new_url&sb=17&so=$so[17]">Domain</a></TD>
<TD><a href="$db_script_url?$new_url&sb=2&so=$so[2]">Name</a></TD>
<TD><a href="$db_script_url?$new_url&sb=29&so=$so[29]">Paid?</a></TD>
<TD><a href="$db_script_url?$new_url&sb=32&so=$so[32]">Price</a></TD>
<TD><a href="$db_script_url?$new_url&sb=26&so=$so[26]">IP Address</a></TD>
<TD>Options</TD>
</TR>\n|;


Thanks for your help Lois!

Chris

Last edited by:

jnjhost: Dec 26, 2002, 11:32 PM
Quote Reply
Re: [jnjhost] Problem with column so/sb mod In reply to
I've not used this mod myself, and my response was going by what was said in a recent post in the customization forum.

You may want to check there for what was said and if your problem was the same.

Perhaps that person can help you to get things working. You may want to reference this thread so they can see what you already have.

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/