Gossamer Forum
Home : Products : DBMan SQL : Discussion :

SQL problems

Quote Reply
SQL problems
I have four questions regarding the SBMan SQL:

1. I have a lot of pictures. I want to set up a system such that 'agents' can use a drop down menu with titles of pictures on the server. Once selected the picture will be placed in the dynamically presented pages. Is there a way I can do this?

What I have done so far is this:

I have create a new image field (with Column Type = Char(255)) by choosing Form Type = FILE in Form Information and File Save Location. Also set auth_modify_own to Yes in setup. I have added the code <img src="db.cgi?cn=PicOne&do=view_file&db=<%db%>&id=<%primary_key_field%>"> in my templates.
"PicOne" is the name of the column name.

What is the code I need to add to the add-form page? Have I done this right so far? Please provide steps I need to follow.


2. If the agent wants to upload their own pictures what do I put in the add-form html page?


3. I am going to have a lot of check boxes in both search page and add-form page. I have created the columns but need the code for the templates.

I have a column called "Interest" and it has the check boxes Alpine, Beachfront, CapitalCity, Island, Lakeside etc.

In the search page html template what do i put as the code? Is this correct:

<input type="checkbox" name="Alpine" value="Alpine"></font>


In the add-form html template do I use the same code?

4. I have created a column for email and web address. When the agent adds this info and then search the agents email and web address is presented. I know how to make the email and web address display but I don't know how to also make them hyperlinked such that if one clicks on the web address it takes you there. Can you please supply the code?

Thanks for your help!
Quote Reply
Re: [needsupport] SQL problems In reply to
Hi,

In Reply To:
1. I have a lot of pictures. .....
That's possible, but you have to customise your script.

In Reply To:
2. If the agent wants to upload their own pictures what do I put in the add-form html page?
You do not do anything, it will be automatically created if table has file fields.

In Reply To:
3. I am going to have a lot of check boxes in both search page and add-form page. I have created the columns but need the code for the templates.
Just create a field by choosing form type = checkbox in form and you have to set the values in 'Form Names' and 'Form Values' also. The script will generate the add_form, search_form as what you want.

In Reply To:
4.......
You can add a link like: <%if Email%>Email:<a href="<%Email%>"><%Email%></a><%endif%> in your search results page. Email is the name of a field.

TheStone.


B.

Last edited by:

TheStone: Feb 4, 2002, 11:29 AM
Quote Reply
Re: [TheStone] SQL problems In reply to
Thanks for the info.

I need a little more info to get on the way.

1. With the pictures I have created the file field in the column. I have also added

Image: <input type=file name="PicOne">

in the add_form. What code do I add to the search results page such that the picture is displayed?

2. I need more explanation on the check boxes. I have created these in the columns. I am confused what to add to the templates.

I have a column called "Interest" and it has the check boxes Alpine, Beachfront, CapitalCity, Island, Lakeside etc.

For add_form I add:

<input type="checkbox" name="Alpine" value="Alpine"></font>

or is it:

<input type="checkbox" name="Interest" value="Alpine"></font>


3. Final Question:
In the search results I want the user to go to 4 different pages for each listing. That is each agent will have 4 pages and when one selects one of these agents you can go from page 1 to 4. What link do I need to put in the templates to take the user to each page. Also the design of each page is completely different.
Quote Reply
Re: [needsupport] SQL problems In reply to
Hi,

In Reply To:
1. With the pictures I have created the file field in the column. I have also added
You can customise your search results page like:
<%loop results%>
Field name 1: <%field_name1%><BR>
Field name 2: <%field_name2%>....
Image: <img src="db.cgi?cn=picture_field_name&do=view_file&db=<%db%>&id=<%primary_key_field%>">
<%endloop%>
field_name1,field_name2 ...they are the name of fields.

In Reply To:
2. I need more explanation on the check boxes. I have created these in the columns. I am confused what to add to the templates.

Just add input objects into add_form:
<input name="Interest" type=checkbox value="Alpine">Alpine <input name="Interest" type=checkbox value="Beachfront">Beach front
...
3. Final Question:
In the search results I want the user to go to 4 different pages for each listing
[/reply]

Do you mean that they are detail pages? If so, just modify search_results.html like:

<%loop results%>
<%ifnot de%>
<%include detail1.html%>
<%else%>
<%if de eq '2'%>
<%include detail2.html%>
<%else%>
<%if de eq '3'%>
<%include detail3.html%>
<%else%>
<%include detail4.html%>
<%endif%>
<%endif%>
<%endif%>
<%endloop%>
- Detail files contain the scripts below:
Field 1: <%field_name1%>
Field 2: <%field_name2%>
....
<a href="db.cgi?do=search_results&db=<%db%>&primary_key_field=<%primary_key_field%>&de=2">Detail 2</a>

TheStone.

B.

Last edited by:

TheStone: Feb 4, 2002, 3:55 PM
Quote Reply
Re: [TheStone] SQL problems In reply to
Thanks for the info.

2. For the pictures:
I can see how it works and I am close to finishing this bit but when I add the code <input type=file name="PicOne">. It does not save the file in my folder when I load up the page. Maybe the colunm was wrong. I added the the file details and also the path to where the pictures whould be saved (not url).

Have I missed something?

2. The info on the detail pages are good. But what I want is each of the detail pages to have their own design. So adding the code you supplied gives me detail pages with the same design. How can I work this out?

Thanks for your help and quick replies.
Quote Reply
Re: [needsupport] SQL problems In reply to
Hi,

In Reply To:
2. For the pictures:
I can see how it works and I am close

Make sure that field name is correct.

In Reply To:
2. The info on the detail pages are good. But what I want is each of the detail pages to have their own design. So adding the code


- Add a field called 'detail_page' in Users table ( Admin - Users - Customize Sample_Users table ) which is stored the detail file name of each user.

- Modify the search_results subroutine in Home.pm like:
.....
my $page = $self->{user}->{detail_page} || 'search_results.html';
return ($page,
{
header => $self->_language('HEA_SRC_RESULT'),
results => \@output,
speedbar=> $speedbar,
msg => $self->_language('SRC_RESULT',$hits)});
.....

I suggest that you should use Plugin feature to create your own script, that's much better for upgrading the next version.

TheStone.

B.

Last edited by:

TheStone: Feb 4, 2002, 4:37 PM
Quote Reply
Re: [TheStone] SQL problems In reply to
Hi

I have no idea how to set this up. How much will it cost for you to do it for me.

Thanks
Quote Reply
Re: [TheStone] SQL problems In reply to
What I want is this:

I want to have an initial search results (page 1) that lists the results of the search. Then when you click on the link it goes to page 2(This is a unique design that is different from page 1 search results). Then from page 2 you can go to page 3 and 4. Page 3 and 4 are also unique designs.

Can you do this? Also can this be done anyway via the html templates?
Post deleted by TheStone In reply to
Quote Reply
Re: [TheStone] SQL problems In reply to
Each user will see the same pages. It is not unique to them individually.

I try to put in another way.

You do a search and the search results show say 20 listings. You click on one of the listing and it goes to page 2 with more detail. This more detail page is differnt in design than the listing page.

Now on this more detail page there is 2 links. Each gives more info on the listing and once again the design is different for each.

So each agent will have 3 pages and the deisgn will be slightly different for each page. The 4th page is the first search results listing page which is also different in design.

Does this help?