Gossamer Forum
Home : Products : DBMan : Installation :

another note

Quote Reply
another note
I have been able to get the default dbman to work on this server with no problems..I also can get it to work when i do not make the sections for admin-only..so i think the problem is somewhere in the following lines.
=============================================
|;
}
print qq| |;
if ($per_admin) {
print qq|
<TR><TD ALIGN="Right" VALIGN="TOP" WIDTH="20%"><$font_color>E-Mail Address:</FONT></TD>
<TD WIDTH="80%"> <$font><a href="mailto:$url{'E-Mail Address'}">$rec{'E-Mail Address'}</a>
|;
}
print qq&#0124; &#0124;;
if ($rec{'Address'}) {
print qq&#0124; &#0124;;
if ($per_admin) {
print qq|
<TR><TD ALIGN="Right" VALIGN="TOP" WIDTH="20%"><$font_color>Address:</FONT></TD>
<TD WIDTH="80%"> <$font>$rec{'Address'}</Font></TD></TR>
|;
}
print qq&#0124; &#0124;;
if ($rec{'City'}) {
print qq&#0124; &#0124;;
if ($per_admin) {
print qq|
<TR><TD ALIGN="Right" VALIGN="TOP" WIDTH="20%"><$font_color>City:</FONT></TD>
<TD WIDTH="80%"> <$font>$rec{'City'}</Font></TD></TR>
|;
}
print qq&#0124; &#0124;;
if ($rec{'State or Prov'}) {
print qq&#0124; &#0124;;
if ($per_admin) {
print qq|
<TR><TD ALIGN="Right" VALIGN="TOP" WIDTH="20%"><$font_color>State or Prov:</FONT></TD>
<TD WIDTH="80%"> <$font>$rec{'State or Prov'}</Font></TD></TR>
|;
}
print qq&#0124; &#0124;;
if ($rec{'Zip or Postal Code'}) {
print qq&#0124; &#0124;;
if ($per_admin) {
print qq|
<TR><TD ALIGN="Right" VALIGN="TOP" WIDTH="20%"><$font_color>Zip or Postal Code:</FONT></TD>
<TD WIDTH="80%"> <$font>$rec{'Zip or Postal Code'}</Font></TD></TR>
|;
}
print qq&#0124; &#0124;;
if ($rec{'Area Code'}) {
print qq&#0124; &#0124;;
if ($per_admin) {
print qq|
<TR><TD ALIGN="Right" VALIGN="TOP" WIDTH="20%"><$font_color>Area Code:</FONT></TD>
<TD WIDTH="80%"> <$font>$rec{'Area Code'}</Font></TD></TR>
|;
}
print qq&#0124; &#0124;;
if ($rec{'Phone Number'}) {
print qq&#0124; &#0124;;
if ($per_admin) {
print qq|
<TR><TD ALIGN="Right" VALIGN="TOP" WIDTH="20%"><$font_color>Phone Number:</FONT></TD>
<TD WIDTH="80%"> <$font>$rec{'Phone Number'}</Font></TD></TR>
|;
}
print qq&#0124; &#0124;;
if ($rec{'User Id'}) {
print qq&#0124; &#0124;;
if ($per_admin) {
print qq|
<TR><TD ALIGN="Right" VALIGN="TOP" WIDTH="20%"><$font_color>User Id:</FONT></TD>
<TD WIDTH="80%"> <$font>$rec{'User Id'}</Font></TD></TR>
|;
}
print qq|
</TABLE>
|;
}
not sure though..any help would be great..
carl
Quote Reply
Re: another note In reply to
Do you want only the admin to view the fields you are giving in your example?

If so, the better approach (which reduces brackets and looping) is to use the following codes:

Code:
if ($rec{'FieldName'} && $per_admin) {
print qq|HTML CODES|;
}
else {
print qq|HTML CODES|;
}

Replace the FieldName with the name of the field you are wanting to print. Insert the appopriate HTML codes where it says HTML CODES.

Hope this helps.

Regards,

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


Quote Reply
Re: another note In reply to
Can you please show me a sample of what the line should look like?
when you say HTML CODES im not sure how much of my current code i should use..
If you would just show me one line i could check to see if it works..
carl
and thanks for your help