Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Affecting order of search results

Quote Reply
Affecting order of search results
I hope everyone had a Merry Christmas!..

Now, back to work...

I use the PPC Plugin and BigWhat plugin (Actually my own that gets results from other search engines..)and I need to split up the results.. I would like to place paid-for links abaove BigWhat results and regular links below bigwhat results... Any ideas for the direction I should be aiming??

-Scott
Quote Reply
Re: [scottward] Affecting order of search results In reply to
Hi,

I would use loops to accomplish this:

Code:
<%-- Display paid results --%>
<%loop link_results_loop%>
<%if Bid%>
display link
<%endif%>
<%endloop%>

<%-- Display 3rd party results --%>
<%loop bigwhat_results_loop%>
display link
<%endloop%>

<%-- Display rest of links --%>
<%loop link_results_loop%>
<%ifnot Bid%>
display link
<%endif%>
<%endloop%>

Hope that helps,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Affecting order of search results In reply to
Thank you for the response to both posts...

I added the loop code and it seems that it never makes it into the loop?!?

Did I misunderstand how to display the results inside the loop??

my code:

Code:
<table width="70%" border=0>
<% if link_results%>
<tr>
<td width="100%" valign=top colspan="2">
<%link_results%>
<%bigwhat_results%>
<%-- Display paid results --%>
<p>Payed:
<%loop link_results_loop%>
<%if Bid%>
<%link_results%>
<%endif%>
<%endloop%>
</td>
</tr>
<%endif%>
<tr>
<td width="100%" valign=top colspan="2">
<p>3rd Party:
<%loop bigwhat_results_loop%>
<%bigwhat_results%>
<%endloop%>
</td>
</tr>
<tr>
<td width="100%" valign=top colspan="2">
<%-- Display paid results --%>
<p>Free:
<%loop link_results_loop%>
<%if not Bid%>
<%link_results%>
<%endif%>
<%endloop%>
</td>
</tr>
</table>

Quote Reply
Re: [scottward] Affecting order of search results In reply to
Hi,

Can you add a <%GT::Template::dump%> and see if the loop variables are defined?

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Affecting order of search results In reply to
I added <%GT::Template::dump%>

and it dumped many variables, but nothing pertaining to a loop....

??

-Scott
Quote Reply
Re: [scottward] Affecting order of search results In reply to
Hi,

Ah, it seems the PPC plugin does not provide you with the loops. I'll get it updated shortly so the loop variables are available.

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Affecting order of search results In reply to
Can you show me how to make those vars available. I may have made some mods to the code that may otherwise be eliminated...

I hope they are not extensive changes....

-Scott
Quote Reply
Re: [scottward] Affecting order of search results In reply to
Hi,

No, basically it just means in ppc_query in PPC.pm returning:

link_results_loop => \@links_loop,
category_results_loop => \@category_loop

where @links_loop and @category_loop are created by:

push @links_loop, $link;

right after the call to SiteHTML::display.

Hope this helps,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Affecting order of search results In reply to
I feel like a dope... Now that the loop works... (Thank you for that...) I cannot get each link seperate... I am using <%link_results%> inside the loop... I have a feeling that is incorrect...

-Frustrated...

-Scott
UPDATE:

I found the info on displaying just the link...

<%include link.html%> instead of <%link_results%>

-Less Frustrated...

Last edited by:

scottward: Dec 27, 2001, 3:00 PM
Quote Reply
Re: [scottward] Affecting order of search results In reply to
Also It doesn't seem like <%ifnot Bid%> works either???

What am I missing.....

-Scott


UPDATE:

Problem was in the PPC.pm code... on my part...

<%ifnot %> works fine

Last edited by:

scottward: Dec 27, 2001, 3:07 PM
Quote Reply
Re: [scottward] Affecting order of search results In reply to
I've updated the PPC plugin, could you send me your email address so that I can send you the updated version?

Thanks,

Mel

mel@gossamer-threads.com
Mel Goulet
Developer - Gossamer Threads, Inc.