Okay. So you want one display for the default user and a different display for admin/registered users in both the short and the long displays. Whew!
You are using the short/long mod I wrote, which is available on my site at http://www.jpdeni.com/dbman/short.txt
right? (Just making sure.
If you don't recognize the code below, go pick up the mod.)
In html_record, you will see:
Code:
# <-- Start of short display formatting -- >
print qq|
<a href="$long_url">$rec{'Title'}</a>
|;
# if you want to display your fields in columns, use the following format:
# print qq|
# $rec{'Field'}</td>
# <td>$rec{'Field'}</td>
# <td>$rec{'Field'}</td>
# <td>$rec{'Field'}|;
# Add or remove columns as needed. Be sure you add the $long_url link to one of your fields
# <-- End of short display formatting -- >
Since you want your information to be in columns on a table, you would use
Code:
print qq|<a href="$long_url">$rec{'LoginID'}</a></td>|;
unless ($db_userid eq "default") {
print qq|<td><a href="mailto:$rec{'Email'}">$rec{'Email'}</a>|;
}
print qq|
<td>$rec{'Sex'}</td>
<td>$rec{'Age'}</td>
<td>$rec{'BriefDescription'}|;
Remember that the first <td> tag and the last </td> tag are alread in the script, with dire warnings not to remove them. Don't remove them.
You'll need to set up your html_record_long display yourself.
Starting after the line
# <-- Start of record display -->
and ending before the line
# <-- End of record display -->
define your display just as you have it on your page, substituting
$rec{'FieldName'}{/b] for the data in red.
The only difference will be that default users can't see the picture, right?
In the place where you will put the picture file, use
Code:
|;
unless ($db_userid eq "default") {
print qq|<img src="$rec{'Photo'}">|;
}
print qq|
Okay. Now you're also going to want to put labels on the table columns for your "short display, right?
In html_view_success you will see:
Code:
else {
print qq|<p><$font>Your search returned <b>$db_total_hits</b> matches.</font>|;
if ($db_next_hits) { print "<br><$font>Pages: $db_next_hits</font>"; }
$i = 1;
print "<table>";
for (0 .. $numhits - 1) {
print "<tr>";
&html_record (&array_to_hash($_, @hits));
print "</tr>";
++$i;
}
print "</table>";
Change this to
Code:
else {
print qq|<p><$font>Your search returned <b>$db_total_hits</b> matches.</font>|;
if ($db_next_hits) { print "<br><$font>Pages: $db_next_hits</font>"; }
$i = 1;
print "<table width=100%>
<tr><td>LoginID</td>";
unless ($db_userid eq "default") {
print "<td>Email</td>";
}
print "<td>Sex</td>
<td>Age</td>
<td>Brief Description</td></tr>|";
for (0 .. $numhits - 1) {
print "<tr>";
&html_record (&array_to_hash($_, @hits));
print "</tr>";
++$i;
}
print "</table>";
That should give you what you want.
------------------
JPD