Announcement

Collapse
No announcement yet.

Souped up Search Page

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Souped up Search Page

    If you need more flexibility in searches than Actinic provides, you are using Extended Info heavily, and you can get products into a database like MySQL, then this works:

    Load the search data into a MySQL table - for example in the case of CDs, the title and artist. And enough data for you to know the link to the extended info page for each product...

    Incorporate the search form you need into the Search Page Bulk Area (I decided to keep the Actinic search as well because this *does* search thoroughly). Your new search might allow either/or searches in different fields, wild cards etc...

    In the action tag of the form, specify the path to the results page eg action="searchresults.php". This page takes the parameters from the search form, builds the SQL query and then returns the results. In this you will need to include a link to the extended info page for the product.

    The downside is obviously the client has to have admin access to the product table - uploading the Actinic site from Catalog will not also change the MySQL product table.

    Hope this helps...

    #2
    The downside is obviously the client has to have admin access to the product table
    You could probably have Actinic automate the creation of a data file that is automatically uploaded. E.g.

    Code:
    <actinic:block php="true">
     // PHP code to open product data file here.
    </actinic:block>
    
    <actinic:block type="EntireSectionList">
      <actinic:block type="ProductList">
        <actinic:block php="true">
         // PHP code to write product data here.
        </actinic:block>
      </actinic:block>
    </actinic:block>
    
    <actinic:block php="true">
     // PHP code to close product data file here.
    </actinic:block>
    And add the filename to Design / Additional files.
    Norman - www.drillpine.biz
    Edinburgh, U K / Bitez, Turkey

    Comment


      #3
      It is also possible to query the Actinic Database within your layouts. Here's a little test I did. Use with caution! I saw some crashes when closing Actinic after using this!!

      This queries the uploaded file list and displays some information about the JPG files.
      Code:
      <actinic:block php="true">
      $connect = odbc_connect("ActinicCatalog8","","");
      # query the FileList table for files uploaded info
      $query = "SELECT sFileName, sExtension, Date, sMD5Hash, Path FROM FileList";
      # perform the query
      $result = odbc_exec($connect, $query);
      # fetch the data from the database
      $flist = array();
      while(odbc_fetch_row($result)){
        $name = odbc_result($result, 1);
        $ext = strtolower(odbc_result($result, 2));
        $date = odbc_result($result, 3);
        $md5 = odbc_result($result, 4);
        $path = urldecode(odbc_result($result, 5));
        $path = strtolower(preg_replace("/^\{SITE\}/", '', $path));
        // we're only intersted in JPG's
        if ( $ext == 'jpg' )
      	{
      	$flist[$path] = array($name, $ext, $date, $md5);
         	}
      }
      # close the connection
      odbc_close($connect);
      </actinic:block>
      
      <table>
      <actinic:block php="true">
      foreach($flist as $file)
        {
        echo "<tr><td>$file[0]</td><td>$file[1]</td><td>$file[2]</td><td>$file[3]</td></tr>";
        }
        </actinic:block>
      </table>
      Norman - www.drillpine.biz
      Edinburgh, U K / Bitez, Turkey

      Comment


        #4
        Elliptical thinking

        Norman

        Two intriguing ideas!

        Simon

        Comment

        Working...
        X