Gossamer Forum
Home : Products : DBMan : Customization :

Related Links...

Quote Reply
Related Links...
I have posted this one at DBMan SQL Forum but I couldn't get any help for weeks. Because these versions are similar to eachother, I wanted to try it one time in here. I still think that it has an easy solve which I cannot figure out somehow... (Well, these pages were built for this, huh?)

If anyone wants more details, please ask. But since I'm developing this offline, I will not be able to send you a link of it. (later on, maybe...) And please note that this is the SQL version. (though it has almost no difference on html.pl)

- - - - - - - - - - - - - - - - - - - - - - - - - -

Hi,

I use the short/long version of html.pl in my db. I don't have any problem with them. My nightmares began when I wanted to insert the links of other related records below the long version results. Just to make it clear, here is an example:

Let's say my database is about books of a library. I browse fiction books, click on the book '2001' and read the details. But I also want to list the other fiction books in my database below like 'other books you might be interested'.

This looks like a basic short format insert into a long format but I just can't get over.

Any ideas?




Quote Reply
Re: Related Links... In reply to
I don't believe I saw this at all when it was first posted.

How are your "related" records defined?

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: Related Links... In reply to
Well, at last a response...

The links I want to list below the page is something like 'the records of the same category' or so. Let's say I have categories like cars, motorcycles and boats. When the user looks at the category 'Cars', he sees the list of them. Then when he clicks on a spesific record (I mean when he request the long version of it) I want him to see the other cars which he saw before, below the record. (If we can exclude the current record from the list it would be better but it's OK anyway)

If we can generate the short mode listing in the long mode, it will be done.

I'll be glad if you can solve this. Because it seems noone else will be able to...


Quote Reply
Re: Related Links... In reply to
The first problem that comes to mind is if the number of records returned from the search is more than will fit on one page. Spanning pages would end up giving you a lot of trouble.

If you only want one page of results returned (or can guarantee that there will be only one page worth of results), it seems that you would have to do another search from within your "long" display in order to get the links for the "short" display. This will take some thought.

But first, we need to be sure that there won't be any pages to span.

Hmmmm. I just got an idea, although I'm not quite sure how to implement it right now.

You get a list of "short" displays returned from a list, each with a link to the long display:

short record 1
short record 2
short record 3
short record 4
short record 5


The user clicks on the third record and the screen is redrawn as

short record 1
short record 2
long record 3
short record 4
short record 5


Then the user clicks on the fourth record and the screen is redrawn as

short record 1
short record 2
short record 3
long record 4
short record 5


Would that be something you'd be interested in? There wouldn't be the problem with spanning pages.

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: Related Links... In reply to
Well here is a more clear example of my plan.

We have 3 categories called blue, yellow, green and we have some records in each of them. Here is what I want the user to see:

He decides to explore the yellow and clicks on it. Then he sees a listing like below. (Which is the short display version, for sure)

------------------------------------------------------------------------------
CLOTH DEPARTMENT STORE

Here is what you may get:
- Yellow T-shirt
- Yellow Pant
- Yellow Skirt
- Yellow Hat
- Yellow Lover
------------------------------------------------------------------------------


Than he clicks on 'Hat' and looks at the details of that lovely yellow hat but somewhere on the page (my choice is below the record but it's not something important) he sees the other listings also like this.


------------------------------------------------------------------------------
CLOTH DEPARTMENT STORE : YELLOW HAT

What a lovely yellow hat. Single wash only, won't fit on ever, after you purchase. No warranty at all.

If you still trust us and would like to purchase some more, check these out:
- Yellow T-shirt
- Yellow Pant
- Yellow Skirt
- Yellow Lover
------------------------------------------------------------------------------


Am I clear now? :) What I need is the list on this second page. (long mode) This thing became my battle with DBMan for weeks.

Quote Reply
Re: Related Links... In reply to
I understood what you had in mind. I was just suggesting something that would be a lot easier to code.

So, the question is, can you guarantee that there will not be any searches that will span multiple pages?

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: Related Links... In reply to
Hi JP,

If 'span' means the pages splitted due to the $db_max_hits, I may guarantee. We may define it to a high number to avoid it. Or, we may have a variable to bypass it.

In fact my plan was something like this but couldn't get over:

$db=db;
$category=yellow;
$sb=id;
$so=asc;
## keeps on going as necessary
&view_related_links;

As you may understand my problem was that routine. If you give me an idea, we can work it together.



Quote Reply
Re: Related Links... In reply to
Hi Deni

So, are we closing the case now?

Still no solutions?