Results 1 to 9 of 9

Thread: show more contents on Search Result page

  1. #1
    Join Date
    Apr 2009
    Posts
    13

    Default show more contents on Search Result page

    Hi there,

    How can I display more contents on the Search result page when there is no search result returned ? Here is the normal page shown: Search Result

    Can I add google ads or sponser links on the page ? If so, which page should I modify for it ? Many thanks for your time

  2. #2
    Join Date
    Jun 2002
    Location
    Winnipeg Canada
    Posts
    4,913

    Default

    How about search.html?

    Yes you can place ads there, you can place sponsored links there, you could add anything you want.

  3. #3
    Join Date
    Apr 2009
    Posts
    13

    Default

    Yes, I have no problem with search.html. Indeed, I can edit all needed contents there when there is search result returned. Here, I am interesting if I can add contents when there is "No search result found". As I checked from search.html, looks like it only displays when there was search result returned, am I right ? Many thanks for your time.

  4. #4
    Join Date
    Jun 2002
    Location
    Winnipeg Canada
    Posts
    4,913

    Default

    I misunderstood you. That's a little more difficult, because that text is located in phrases.php. Phrases.php is simply a file that contains a bunch of commonly used phrases (mostly errors) and is used for translation purposes.

    You COULD edit that file, and add code to it. I tried to add an IF statement but the PHP file is grabbing the results before it is passed onto the HTML file, so an IF statement won't work.

    But the following MIGHT work.

    You COULD try adding an IF statement to the php file, that would include an external file, or simply attach the include to the if statement in search.php where it shows the error 10025

    if ($num_categories == 0 && $num_links == 0) {
    $error_msg = $msg["10025"];
    include_once = /path/to/your/file

  5. #5
    Join Date
    Apr 2009
    Posts
    13

    Default

    Thanks a lot for the input, Bruce.

    Sorry, I am not quite familar about what to do with the external file.
    For example, if I want to add a google ads to it ..

    <script type="text/javascript"><!--
    google_ad_client = ......
    </script>

    How should I edit the external file which been included on IF statemet ?

  6. #6
    Join Date
    Jun 2002
    Location
    Winnipeg Canada
    Posts
    4,913

    Default

    this url should give you all the info you need on php includes and how to use them.

  7. #7
    Join Date
    Apr 2009
    Posts
    13

    Default

    I included the test file as instructed. A text line and Google ads did shown up on the search result page. However, the contents showed on the top of the page, instead of the center. Any thing I did wrong ?

    Error page: Search Result

    Content of the php file included:

    <p>TEST Output</p>
    <script type="text/javascript"><!--
    google_ad_client = "pub-xxxxxxxxxxxxxxxxxxx";
    ............
    </script>

  8. #8
    Join Date
    Jun 2002
    Location
    Winnipeg Canada
    Posts
    4,913

    Default

    Looks like that isn't going to work, at least I tried

    The only other solution that I can see is to add the code to phrases.php

    $lang['no_link_found'] = _('Nothing found for the keyword "<%$keyword%>"<br /><br />add your code here');

  9. #9
    Join Date
    Apr 2009
    Posts
    13

    Default

    I added Google Ads successfully as suggested.
    Thank you very much for the help, Bruce

Similar Threads

  1. Want to show contents for Sponsored ONLY
    By pimpmaster in forum v5.x
    Replies: 5
    Last Post: 08-11-2008, 04:04 PM
  2. search log also for no result searches ?
    By Frank71 in forum v3.2
    Replies: 12
    Last Post: 04-01-2004, 11:46 AM
  3. Replies: 1
    Last Post: 02-07-2004, 03:23 PM
  4. Show username in user cp page
    By rbl in forum v5.x
    Replies: 3
    Last Post: 07-26-2003, 08:54 AM
  5. Search result page
    By tariqali in forum v5.x
    Replies: 3
    Last Post: 07-30-2002, 05:43 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •