Akopia Akopia Services

[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date ][Minivend by thread ]

[mv] Efficient [perl] Results page



******    message to minivend-users from Handytman@aol.com     ******

I have seen statements on this list, indicating that the least CPU-intensive 
way to display search results is to write the page in perl.

This is of interest to me, as my results page must check a database and 
display items one way if condition X is true, and differently otherwise. 
Also, seemingly the server would rather interpolate the [item-fields] once 
per item, and then perl could write the page to display that data two or 
three times per item, if need be.

What I've got so far is a results page which has all the [search-list] 
display stuff in perl tags. (Actually, I use [calc] tags.) This results in 
one perl call per item. Since the page is called to display eight items per 
page, that means eight perl calls per page.
It occurs to me that one perl call per page would be better. I'm asking:


How can one perl call display all the items on the results page, eliminating 
the need for [search-list][/search-list] tags?


Right now, here's what I've got, shown below:

Thanks,
Rob Maurer

   <table>
    <tr>
     <td colspan="2">
       [value category_name]</td>   [comment] ** Display the catagory  name, 
set in the [page scan] tag ** [/comment]
    </tr>
    <tr>
     <td colspan="2">
    [search-region send=1]
    [more-list]
     Items [matches] of
    [/more-list]
    [if value mv_search_match_count > 1]
        [value mv_search_match_count] items found
    [/if]   

    [more-list]
     [more]
    [/more-list]
    </td>
    </tr>
    <tr>
    [search-list]
    [calc interpolate=1]

         $item_inc    =  q([item-increment]);
         $name        =  q([item-field item]);
         $code        =  q([item-code]);
         $description =  q([item-description]);
         $thumb       =  q([item-field thumbnail]);
         $price       =  q([item-price 1]);
         $offsite     =  q([item-field offsite]);
         $order_url   =  q([order [item-code]]);
         $fly_url     = qq([page [item-code]]);

         $output = <<HTML;
    
         [comment] Here lies my HTML for the individual item's display 
[/comment]

HTML

         return $output;
    [/calc]
    [/search-list]
    </tr>
    [no-match]
<!-- ************** There are no matches ******* beginning here ********* -->
    <tr>
     <td>
    Sorry, no matches for [value mv_searchspec]</td>
    </tr>
<!-- ************** There are no matches ******* ending here ************ -->
    [/no-match]

    [more-list]
<!-- ********************************** Links to more matches ****** 
beginning here ********* -->
    <tr>
     <td colspan="2">
     Links to more matches:[more]
     </td>
    </tr>
<!-- ********************************** Links to more matches ****** ending 
here ************ -->
    [/more-list]

    [/search-region]
   </table>
-
To unsubscribe from the list, DO NOT REPLY to this message.  Instead, send
email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
Archive of past messages: http://www.minivend.com/minivend/minivend-list


Search for: Match: Format: Sort by: