PassMark Logo
Home » Forum

Announcement

Collapse
No announcement yet.

Search Template: Using PHP Includes

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

  • zoomology
    replied
    Originally posted by Ray View Post
    Glad to hear you got there in the end. Perhaps you were looking at cached pages in your browser. Or it might have been one of the other little details.

    Feel free to start a new thread for any other issues, or e-mail us if you have questions.
    Thanks Ray -- now on to the next issue -- mod_rewrite rules.

    ...I'll create a new thread.

    .

    Leave a comment:


  • Ray
    replied
    Glad to hear you got there in the end. Perhaps you were looking at cached pages in your browser. Or it might have been one of the other little details.

    Feel free to start a new thread for any other issues, or e-mail us if you have questions.

    Leave a comment:


  • zoomology
    replied
    I went over my work dozens of times - now suddenly the footers and other include files are displaying okay. The only thing different this time was I uploaded a blank search_template.html file (as you suggested). Very strange.

    Thanks for the suggestion -- it helped.

    Unfortunately, I still have a couple more issues to resolve before I can activate Zoom for the public.

    Leave a comment:


  • Ray
    replied
    Originally posted by zoomology View Post
    Actually "the code" in question is very simple and straightforward. I basically used a dupe of one the site's pages, added <!--ZOOMSEARCH--> where the results appear, and saved it as search_template.html.
    If the page that you duplicated from contains PHP code (eg. a call to include header and footer), then this will not work. As the FAQ states, the "search_template.html" file will not execute PHP code

    Originally posted by zoomology View Post
    I embedded "search.php" in my own PHP page "search_template.php" then made the other changes via the control panel (on my PC), reindexed, uploaded everything again ...and nope it doesn't display the footer file.
    Are you opening your custom "search_template.php" page in the browser? Or are you still opening "search.php"? You should be doing the former to see the result of your changes. The behaviour of "search.php" would not have changed.

    This is why we suggested a filename of "mysearch.php" in our example, for the custom page, as opposed to "search_template.php" (which you are using - and thus is confusing). The custom PHP search page you created is not supposed to work like a replacement for "search_template.html", if this is what you are thinking.
    Last edited by Ray; Jul-20-2007, 05:48 AM.

    Leave a comment:


  • kendoran
    replied
    You need some code similar to this (this is exactly what I do, btw):

    In the page which you want the search box:
    Code:
    <form method="get" action="/search-results.php">
    <input type="text" name="zoom_query" size="20" value="Search"/>
    <input type="hidden" name="zoom_per_page" value="20" />
    <input type="hidden" name="zoom_and" value="0" /> 
    </form>
    In search-results.php:
    Code:
    ... header stuff ...
    
    <?php 
    include("search.php"); 
    ?>
    
    ... footer stuff ...
    In my case, search_template.html is a blank file in the root directory of my site (same folder as search.php).. it doesn't even contain the <!-- ZOOMWHATEVER --> comment.
    Last edited by kendoran; Jul-20-2007, 05:03 AM.

    Leave a comment:


  • zoomology
    replied
    Originally posted by kendoran View Post
    Obviously, you don't understand even the basics, otherwise you would have had it working first time like I did.

    btw, regarding search_template.html, you don't need to reference it in your own code at all - search.php accesses it internally.
    So, what exactly are you trying to say? I understand 100% that search.php knows to use the HTML template file. I mentioned it only as a reference point.

    Leave a comment:


  • kendoran
    replied
    Originally posted by zoomology View Post
    I was confused by the instructions also.
    I understand
    Obviously, you don't understand even the basics, otherwise you would have had it working first time like I did.

    btw, regarding search_template.html, you don't need to reference it in your own code at all - search.php accesses it internally.

    Leave a comment:


  • zoomology
    replied
    Originally posted by Ray View Post
    Um, the FAQ I linked to above, which you said you have read and followed, states that you need to embed "search.php" in your own PHP page (the example uses "mysearch.php"). It also states that you cannot use a server-side include in the template (i.e. "search_template.html"). This is what Kendoran is referring to.
    Ray,

    I embedded "search.php" in my own PHP page "search_template.php" then made the other changes via the control panel (on my PC), reindexed, uploaded everything again ...and nope it doesn't display the footer file.

    What do you suggest?

    Leave a comment:


  • zoomology
    replied
    Originally posted by Ray View Post
    Um, the FAQ I linked to above, which you said you have read and followed, states that you need to embed "search.php" in your own PHP page (the example uses "mysearch.php"). It also states that you cannot use a server-side include in the template (i.e. "search_template.html"). This is what Kendoran is referring to.
    Okay, give me ten minutes or so -- I'll try again.

    Leave a comment:


  • zoomology
    replied
    Hi Raymond,

    Actually "the code" in question is very simple and straightforward. I basically used a dupe of one the site's pages, added <!--ZOOMSEARCH--> where the results appear, and saved it as search_template.html.

    Indexing, search function and results display work -- however, my footer and another include file do not display on the results page.

    Beyond this problem, Zoom doesn't recognize ordinary mod_rewrite rules. But first things first. What do you need to troubleshoot and who should I PM the details to?

    Thanks

    Leave a comment:


  • Ray
    replied
    Originally posted by zoomology View Post
    Originally posted by kendoran View Post
    Search.php takes parameters - so if you embed search.php in any of your php pages, and pass your page the parameters, search.php will pick it up and display whatever needs to be displayed - using search_template.html to format the results.
    I'm not embedding search.php anywhere on any page. I'm attempting to use an include file in the template for global footers.
    Um, the FAQ I linked to above, which you said you have read and followed, states that you need to embed "search.php" in your own PHP page (the example uses "mysearch.php"). It also states that you cannot use a server-side include in the template (i.e. "search_template.html"). This is what Kendoran is referring to.

    Leave a comment:


  • zoomology
    replied
    I was confused by the instructions also.
    I understand

    What you want to do is entirely possible - I'm doing it already.
    great

    You're just doing it the wrong way.
    okay

    Are you using the php option?
    yes

    Search.php takes parameters - so if you embed search.php in any of your php pages, and pass your page the parameters, search.php will pick it up and display whatever needs to be displayed - using search_template.html to format the results.
    I'm not embedding search.php anywhere on any page. I'm attempting to use an include file in the template for global footers.

    Remember, you don't need to youch search_template.html - it just needs to be in the same directory as search.php
    In the previous paragraph you said that the search_template.html was necessary, but now it's not. That doesn't make sense to me.

    Leave a comment:


  • Ray
    replied
    Originally posted by zoomology View Post
    I followed the instructions you offered to the letter. Unfortunately to no avail -- it didn't work. In fact, the website's formatting and any search results disappeared entirely -- showing nothing but a blank page.
    This should not happen and suggest that you may have done something wrong. Is your website online, and if so, can you give us the URL to your page? However, this might not be enough for us to spot the problem, if the problem is in your PHP code. If this is the case, you may need to troubleshoot more and provide us with more specific lines of code showing what you have done, and what is happening.

    Originally posted by zoomology View Post
    Now after two days working to resolve the problem, I would have asked a programmer buddy to troubleshoot -- but I realised this isn't possible since the data is generated from my machine -- and I'd have to buy an extra copy of Zoom just for him to work a few minutes.
    As Kendoran mentioned above, this is not true. Your programmer buddy only needs access to your web server, where you have uploaded the search files generated by Zoom, and your PHP pages. He/she should not need to access the Zoom Indexer program to fix this issue.

    Or as kendoran suggested above, he/she could play with the Free Edition and create the custom PHP page you need that embeds your headers and footers.

    Originally posted by zoomology View Post
    Question: If I'm unable to get Zoom working to my satisfaction, may I have a refund?
    We will happily provide refunds if the product does not function as documented, but the above does not appear to be a functional issue from the information you have given us. We (and your programmer friend) should be able to help you get it to work, when applied correctly.

    Leave a comment:


  • kendoran
    replied
    Originally posted by zoomology View Post
    I realised this isn't possible since the data is generated from my machine -- and I'd have to buy an extra copy of Zoom just for him to work a few minutes.
    This is not true. Get him to use the free version on a small sample, then pass you a template.

    Leave a comment:


  • kendoran
    replied
    I was confused by the instructions also.

    What you want to do is entirely possible - I'm doing it already.

    You're just doing it the wrong way.

    Are you using the php option?

    Search.php takes parameters - so if you embed search.php in any of your php pages, and pass your page the parameters, search.php will pick it up and display whatever needs to be displayed - using search_template.html to format the results.

    Remember, you don't need to youch search_template.html - it just needs to be in the same directory as search.php

    Leave a comment:

Working...
X