1 (edited by 2015-03-19 12:30:28)

Topic: Installing site search on cutenews 2.0.1

Hi

I have been trying to get site search working on my website. The message I am getting: "Cutenews has detected that you are using show_news.php using the URL to this file . . .".

But I am not including show_news.php I am including search.php.  https://cutephp.com/forum/style_emoticons/default/mad.gif

   
       

<div id="sitesearch">
         <form action= "sitesearch.php" method="get"> <!-- sitesearch.php is my news search results page -->
        <input type="text" name="story" size="28">
        <input type="hidden" name="dosearch" value="yes">
        <input type="submit" value="Search" style="height: 26px"> 
      </form> 
                 </div> <!-- site search -->
                         <!--webbot bot="HTMLMarkup" startspan --><?php 
      if((isset($_POST['do']) && $_POST['do'] == 'search') 
      or (isset($_GET['dosearch']) && $_GET['dosearch'] == 'yes')){  
      $subaction = 'search';  
      $dosearch = 'yes';  
            } ?><!--webbot bot="HTMLMarkup" endspan -->

The relevant section of sitesearch.php is included below

<?php
include('cutenews/search.php');
?>

The message I am getting is:"Cutenews has detected that you are using show_news.php using the URL to this file". But I am not including show_news.php I am including search.php.

Re: Installing site search on cutenews 2.0.1

Hi

I have been trying to get site search working on my website. The message I am getting: "Cutenews has detected that you are using show_news.php using the URL to this file . . .".

But I am NOT including show_news.php I am including search.php.  https://cutephp.com/forum/style_emoticons/default/mad.gif

   
       

<div id="sitesearch">
         <form action= "sitesearch.php" method="get"> <!-- sitesearch.php is my news search results page -->
        <input type="text" name="story" size="28">
        <input type="hidden" name="dosearch" value="yes">
        <input type="submit" value="Search" style="height: 26px"> 
      </form> 
                 </div> <!-- site search -->
                         <!--webbot bot="HTMLMarkup" startspan --><?php 
      if((isset($_POST['do']) && $_POST['do'] == 'search') 
      or (isset($_GET['dosearch']) && $_GET['dosearch'] == 'yes')){  
      $subaction = 'search';  
      $dosearch = 'yes';  
            } ?><!--webbot bot="HTMLMarkup" endspan -->

The relevant section of sitesearch.php is included below

<?php
include('cutenews/search.php');
?>

The message I am getting is:"Cutenews has detected that you are using show_news.php using the URL to this file". But I am NOT including show_news.php I am including search.php.

My client is disturbed that the Search button is not working yet.  Is Support on holiday? https://cutephp.com/forum/style_emoticons/default/mad.gif

Re: Installing site search on cutenews 2.0.1

You incorrectly named the search field. It should have name="search" while now it has name="story". Please study closely the source code in the following topic https://cutephp.com/forum/index.php?showtopic=44564

Best regards,
CN Support team

4 (edited by 2015-04-09 12:37:10)

Re: Installing site search on cutenews 2.0.1

You incorrectly named the search field. It should have name="search" while now it has name="story". Please study closely the source code in the following topic https://cutephp.com/forum/index.php?showtopic=44564

Thank you I have done so. Referring to that post. the first code block : "You can look up a way to show the search box in example.php"

I do not need that advice as I have a search box located in the banner of my Home page that is nicely positioned. But there might be code in that example that should be incorporated in what I have already, as what I have is different:

                <div id="sitesearch"> <!-- this the location of the search box it is on the Index page -->
                 <form action="sitesearch.php" method="get">
        <input type="text" name="search" size="28"> <!-- replaced name="story" as advised to name="search" -->
        <input type="hidden" name="dosearch" value="yes">
        <input type="submit" value="Search" style="height: 26px"> 
      </form> 
                 </div> <!-- site search -->
                 
                  <!--webbot bot="HTMLMarkup" startspan --><?php 
      if((isset($_POST['do']) && $_POST['do'] == 'search') 
      or (isset($_GET['dosearch']) && $_GET['dosearch'] == 'yes')){  
      $subaction = 'search';  
      $dosearch = 'yes';  
            } ?><!--webbot bot="HTMLMarkup" endspan -->

Referring to the 2nd code block: "Then you will need to make the following changes on the news displaying page  . ."

I added that code to my sitesearch.php page. Nothing is displayed. The relevant php code is below:

<?php
                if (isset($_GET['search'])&&$_GET['search'])
                {
                    include ("search.php");
                }
                else
                {
                    include ("show_news.php");
                }
?>

I am puzzled by the paths to both search.php and show_news.php as they do not include the parent directory "cutenews". But if I alter them to include the parent directory a warning message is displayed as mentioned in the OP.

I did alter "story" to "search" with no effect.

My use of PHP and understanding of PHP is very limited and like other would be users of Cutenews I expect to just copy and past code that just works. Surely this is possible?

I would like examples that are simple and easy to understand. The Example file that is included with 2.0.2 is very impressive but is of little use to someone learning to use the newest version of CuteNews.

Please note I am using v2.0.2 Build ID 202 NOT 2.0.1 - I can't edit the title of this post. Perhaps a moderator can.

Re: Installing site search on cutenews 2.0.1

a. Perhaps, you mean that the search should be shown separately from the search box, in which case you need to do the following.

Instead of

<Input type = "text" name = "search" size = "28">

You can use

<Input type = "text" name = "search" size = "28" value = "<? Php echo htmlspecialchars ($ _ REQUEST ['search']);?>">

and the search query will be displayed in the search box.

b. You can configure the display of the search box in the administrative panel (templates) Dashboard> Templates, SEARCH.

For example, by removing the string
<Div> {search_basic} Author: {author} {in_archives} In archives </ div>

c. We need more details concerning what kind of URL appears in the search bar at the time when the message "CuteNews has detected that you are including show_news.php using the URL to this file" appears and what steps have been taken.

We need detailed information to give you a correct answer. Each installation of Cutenews is set up individually and in this case it is required to find out the cause of the error and the desired result.

Best regards,
CN Support team