Gossamer Forum
Home : Products : DBMan : Customization :

some problem

Quote Reply
some problem
Eg.
What is ur hobbies?
[]cycling
[]bowling
[]swimming
[]blah blah blah
[]blah blah blah
[]blah blah blah

The user only select 2 or 3, but when showing out the data, have blank line if the 2nd or 3rd one is not selected.

how do I make it that when some of the data r not selected, they will not be any blanks?
Quote Reply
Re: some problem In reply to
           <table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" height="16" colspan="2">

<$font_color><b>Which traits are MOST important to you in a relationship?</b></font></td>
</tr>
<tr>
<td width="32%" height="21">
<$font>$rec{'Trust'}<br>
<$font>$rec{'Honestly'}<br>
<$font>$rec{'Love'}<br>
<$font>$rec{'Sex2'}</tr>
<td width="68%" height="21">
<$font>$rec{'Companionship'}<br>
<$font>$rec{'Faithfulness'}<br>
<$font>$rec{'Passion'}<br>
<$font>$rec{'Communication'}</td>
</tr>
</table>

This is what I wanted..i try the way u tell me..but having problem
Quote Reply
Re: some problem In reply to
and, I want to make it that registered user doesnt have the full search access, only some of the fields can be search by regiesterd user, this apply to non-regiested user. Only admin have the full search.

How to I go about doing that?
Quote Reply
Re: some problem In reply to
You can create a sub-routine for a simple search form that includes ONLY the fields that you want people to search. For instance, at our College, we have a "Simple" and "Advanced" search option. You can specify within the html.pl file in the footer section by adding a link to a page that ONLY registered users who have modification permissions (if mod) can access.

You would have to make some edits in default.cgi in order for this new sub-routine to work. But I think it will accomplish what you want.

Hope this helps.

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us

[This message has been edited by Eliot (edited June 28, 1999).]
Quote Reply
Re: some problem In reply to
I would really need help for that.

A simple and advance search is what I want. how do i goes abt.
Quote Reply
Re: some problem In reply to
Regarding your checkboxes:

Code:
print qq|
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" height="16" colspan="2">
<$font_color><b>Which traits are MOST important to you in a
relationship?</b></font></td></tr>
<tr valign="top"><td width="32%" height="21">|;
if ($rec{'Trust'}) {
print qq|

<$font>$rec{'Trust'}<br>|;
}
if ($rec{'Honestly'}) {
print qq|

<$font>$rec{'Honestly'}<br>|;
}
if ($rec{'Love'}) {
print qq|

<$font>$rec{'Love'}<br>|;
}
if ($rec{'Sex2'}) {
print qq|

<$font>$rec{'Sex2'}|;
}
print qq|</td>
</tr>
<td width="68%" height="21">|;
if ($rec{'Companionship'}) {
print qq|

<$font>$rec{'Companionship'}<br>|;
}
if ($rec{'Faithfulness'}) {
print qq|

<$font>$rec{'Faithfulness'}<br>|;
}
if ($rec{'Passion'}) {
print qq|

<$font>$rec{'Passion'}<br>|;
}
if ($rec{'Communication'}) {
print qq|

<$font>$rec{'Communication'}|;
}
print qq|
</td></tr>
</table>

I'm not sure how many levels of searching you want to allow. You can have as many as you want. Do you want a default user to search on, for example 5 fields, a registered user to search on 10 and the admin to search on all?

I'm going to assume that is what you want.

The easiest way to do this is to copy sub html_record_form and paste it just below the current one. You'll now have two identical subroutines. Change the name of the second subroutine to
sub html_registered_search_form {

Now go through the subroutine and delete all the fields you do not want registered users to search on. (By doing it this way, you don't have to retype all of the field names and you are less likely to make a mistake.)

Once you get that done, copy sub html_registered_search_form and paste it below the current one. Rename this new subroutine html_default_search_form. Again, go through and delete fields, this time just deleting the ones you don't want default users to search on.

In html_view_search, change

&html_record_form();

to

Code:
if ($per_admin) {
&html_record_form();
}
elsif ($db_userid eq "default") {
&html_default_search_form();
}
else {
&html_registered_search_form();
}

Make the same change in html_view_failure, except you'll need to keep the %in part--

Code:
if ($per_admin) {
&html_record_form(%in);
}
elsif ($db_userid eq "default") {
&html_default_search_form(%in);
}
else {
&html_registered_search_form(%in);
}

You will probably only want registered users to be able to modify or delete their own records, right? So you have a field for the userid in each record. Because of this, you won't need to change the subroutine that's used for the modify or delete search. Instead, make an adjustment to sub html_footer:

Code:
if ($per_admin) {
print qq!| <A HREF="$db_script_link_url&delete_search=1">Delete</A>
| <A HREF="$db_script_link_url&modify_search=1">Modify</A> !;
}
else {
print qq!| <A HREF="$db_script_link_url&$db_cols[$auth_user_field]=$db_userid&delete_form=1">
Delete</A> ! if ($per_del);
print qq!| <A HREF="$db_script_link_url&$db_cols[$auth_user_field]=$db_userid&modify_form=1">
Modify</A> ! if ($per_mod);
}

Let me know if anything wasn't clear.

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







[This message has been edited by JPDeni (edited June 28, 1999).]
Quote Reply
Re: some problem In reply to
Let's say your html_record file looks like this:

Code:
print qq|
<table>
<tr><td>Hobbies:</td></tr>
<tr><td>$rec{'cycling'}</td></tr>
<tr><td>$rec{'bowling'}</td></tr>
<tr><td>$rec{'swimming'}</td></tr>
</table>
|;

If you only want to print out a row if there's something in the field, change it to:

Code:
print qq|
<table>
<tr><td>Hobbies:</td></tr>|;
if ($rec{'cycling'}) {
print qq|

<tr><td>$rec{'cycling'}</td></tr>|;
}
if ($rec{'bowling'}) {
print qq|

<tr><td>$rec{'bowling'}</td></tr>|;
}
if ($rec{'swimming'}) {
print qq|

<tr><td>$rec{'swimming'}</td></tr>|;
}
print qq|

</table>
|;

Does that help?

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





Quote Reply
Re: some problem In reply to
Help!! I've done those mod and now user cannot add into database Frown

here's the link
http://www.it-g.com/cgi-bin/friendsdb/db.cgi
just in case u need the html.pl..

http://www.it-g.com/htmlpl.txt
Quote Reply
Re: some problem In reply to
It is adding OK now I added a record with the word test in every field so you may want to delete it.
Quote Reply
Re: some problem In reply to
I think i know whats wrong already. nevermind abt the abv question.