PassMark Logo
Home » Forum

Announcement

Collapse
No announcement yet.

Want to pull in zoom search result in PHP indexed file

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

  • Want to pull in zoom search result in PHP indexed file

    Hello,

    I am just trying zoom search v4.2.

    I have a web site with the following structure :

    domain.com/index.php
    /inc/files.html

    I wanted to put search_template.html in /inc so that the search results will be pulled in to the index.php frame like other files which are under /inc

    My understanding is that all the search files must be in one directory. Thus I tried putting all zoom files (search.php, setting.php, search_template.html, zzxx.dat) under /inc. Then I tried searching the pages from the main index.php file where I put the search field. But so far with out success to see the search results.

    The index.php has no include() stuff. It has sweitch script in it, where all files under /inc are indexed.

    It is nice search tool but it pops up in a separate widndows, which has less visual attractive.


    Can anyone help me ?

  • #2
    I have having a bit of trouble understanding your situation. I don't see how your frames and your index.php script work together to create your site. I am also not sure how your "sweitch script" works. I assume this should have been a "switch script", but this still does not fully explain what it does.

    But yes, all the search files need to be in the same directory.

    There are also details here in the FAQ about making the search results open in a different window. And details about how to use Zoom with frames here.

    Comment


    • #3
      The index.php has the following script:

      Code:
      <?php //<!--
      
      	$dir = "inc/"; 
      
      		 		switch ($_GET["p"])
      		 		{
      
      		 		case "1":
      		 			$page_incluse=$rep."file1.html";
      		 			$title="Title f1";
      		 		break;
      
      		 		case "2":
      		 			$page_incluse=$rep."file2.html";
      		 			$title="Title f2";
      		 		break;
      
                                     .......
      
         		 		} 
      // -->
      ?>
      files, file1.html and file2.html are under a sub directory 'inc'. The path of the index.php is : www.domain.com/index.php

      The path to access 'file1' is: www.domain.com/?p=1

      Now I wanted to add search_template.html in the directory 'inc' along with 'file1.html' and 'fiel2.html'. I wanted to give a file id of 3 in the index.php script so that, if it works as the other fiels, the 'search.php' file could be linked to invoke 'search_template' with 'href=?p=3"

      The idea is just to keep the format of the index.php file in the search result page (template). I could get it looking similar to the main frame by just coppying the header and footer of the index.php into search_template.html. I kept the search_template along with index.php like search.php. The problem is that if a change is made on index.php, I have to modify the serch_template file as well.

      That's the reason that I was interested in to call search_template from the 'inc' directory so that the results would be pulled in to the body of 'index.php'.

      Comment


      • #4
        The problem with your plan is that the search results and the search form are NOT in the search_template.html file. So displaying it via your index.php script will not actually produce any search results, nor a search form.

        The search results and form are produced by our search script when it executes, search.php.

        So the real problem is how to do combine your index.php file and our search.php script.

        Option 1 is not to combine them. But instead copy your header and footer HTML code into the search_template.html file. Then link to search.php when you you need to do a search.

        Option 2 is to combine the scripts. There is a description of how to combine scripts with various different scenarios here.

        You description didn't mention anything about the use of frames, so I assume you have that side of things under control.

        Comment


        • #5
          Thank you admin,
          yes, what I have done right now is just copying and pasting the header and footer of the html part of index.php. For the time being, the search page looks like the index.php itself and the results are pulled into the modified search-template page. The only reason that I raised this issue was just to control all web page formats from a single index.php page. Well, I shouldn't forget to upgate my coppying and pasting to search_template whenever I do mofifications on index.php. I will look at the guide for merging scripts. My pages have frames and I didn't encounter problems with it.

          BTW, I have now two search fields in the search_template (once coming from the pasted header and the other from the template itself). I was looking for at the setting.php to get some hints to remove the second search field but I do not see anything. I will make a search if their is a guide in your site or I would appreciate if you can throw me a hint.

          Again, thanks

          Comment


          • #6
            The search form is not in the template. It is generated by the script on the fly. You can turn the form off from the "search page" tab of the Zoom configuration window.

            Comment


            • #7
              Thanks a lot. I will check it out.

              Comment

              Working...
              X