Please Read First
Troubleshooting Tips
Frequently Asked Questions
Before Posting Please Disable Wp Super Cache Plugin
When Posting Please Include Your URL.
Search Forum Using Google Search Box Above
Forum Video

Page 1 of 2 12 LastLast
Results 1 to 10 of 18
  1. #1
    Join Date
    Jun 2010
    Posts
    72
    Rep Power
    5

    Default Where is Search.php?

    Most themes have a SEARCH.PHP file. I need to modify the code to return E-Bay Listings instead of posts.

    Where is search code when someone enters text in the search box?

  2. #2
    Join Date
    Jun 2010
    Location
    Maine
    Posts
    7,503
    Rep Power
    12

    Default

    Glenn, here's a thread that answers you question. It's in header.php

    http://www.socratestheme.com/forum/showthread.php?t=20

  3. #3
    Join Date
    Jun 2010
    Posts
    72
    Rep Power
    5

    Default

    Thanks Dan,

    This is the FORM code. I need to know where the actual form processing is when the user type in a search query and presses the button.

    Can you tell me where that is?

  4. #4
    Join Date
    Jun 2010
    Location
    Maine
    Posts
    7,503
    Rep Power
    12

    Default

    Glenn,

    Correct that is the form code. And if you wish to add an ebay search function you would replace the form path with your ebay search action url.

    If you want to get into Wordpress core files I would not recommend it.

    If you are looking to create a custom search results page and then integrate ebay into that here's a tutorial on how to do that...

    http://codex.wordpress.org/Creating_...ur_Search_Page

    It might be easier if you just include the code that Ebay is giving you so we can better understand what you're trying to achieve.

  5. #5
    Join Date
    Jun 2010
    Posts
    72
    Rep Power
    5

    Default

    Here is the code I am using for the search results:

    <p align="center">Your search for '<strong><font color="#FF0000"><? echo $_GET["s"] ?></font></strong>' returned the following results:</p>
    <p>
    <?php
    function phpBaySearch($term) {
    $keyword = $term;
    $category = "";
    $text .= '[phpbay]' . $keyword . ',20,' . $category . ', ""[/phpbay]';
    echo phpBayPro($text);
    }
    phpBaySearch($_GET["s"]);
    ?>

    <?php
    function phpZonsearch($term) {
    $keywords = $term;
    $text .= '[phpzon keywords="'.$keywords.'" num="10" country="US" searchindex="All" templatename="default" paging="true"]';
    echo do_shortcode($text);
    }
    phpZonsearch($_GET["s"]);
    ?>
    </p>

    Can you tell what to change in the FORM code as far as the URL?

  6. #6
    Join Date
    Jun 2010
    Location
    Maine
    Posts
    7,503
    Rep Power
    12

    Default

    Can you provide a resource where you're getting this code from? I'm sure they must have tutorials and more information.

    Can you set this up on Wordpress's default theme?

    I have to sign off for a couple of hours.. I only work 12 hours on Sundays, but will be back later this afternoon.

  7. #7
    Join Date
    Jun 2010
    Posts
    72
    Rep Power
    5

    Default Example Code Where it Works

    Here is the searchform.php and search.php where this code works. The theme is Atahualpa 3.2 at this URL http://wordpress.bytesforall.com.

    Please look at it and tell me how to modify the Socrates them to do the same thing.

    Code:
    SEARCHFORM.PHP
    
    <form method="get" class="searchform" action="<?php bloginfo('url'); ?>/">
    <table class="searchform" cellpadding="0" cellspacing="0" border="0">
    <tr>
    <td class="searchfield">
    <input type="text" class="text inputblur" value="<?php the_search_query(); ?>" name="s" />
    </td>
    <td class="searchbutton">
    <input name="submit" value="Search" type="image" src="<?php echo get_bloginfo('template_directory'); ?>/images/magnifier2-gray.gif" style="display: block; border:none; padding: 0 0 0 5px; margin: 0;" />
    </td>
    </tr></table>
    </form>
    Code:
    SEARCH.PHP
    
    <?php 
    global $options; 
    foreach ($options as $value) { 
    	if (get_option( $value['id'] ) === FALSE) { 
    		$$value['id'] = $value['std']; 
    	} else { 
    		$$value['id'] = get_option( $value['id'] ); 
    	} 
    }
    if ( is_page() ) { global $wp_query; $current_page_id = $wp_query->get_queried_object_id(); }
    ?>
    <?php get_header(); ?>
    
    <!--p align="center">Your search for '<strong><font color="#FF0000"><? echo $_GET["s"] ?></font></strong>' returned the following results:</p-->
    
    <p align="center">Your search for '<strong><font color="#FF0000"><? echo $_GET["s"] ?></font></strong>' returned the following results:</p>
    <p>
    <?php
    function phpBaySearch($term) {
      $keyword = $term;
      $category = "";
      $text .= '[phpbay]' . $keyword . ',20,' . $category . ', ""[/phpbay]';
      echo phpBayPro($text); 
    }
    phpBaySearch($_GET["s"]);
    ?>
    
    <?php
    function phpZonsearch($term) {
    $keywords = $term;
    $text .= '[phpzon keywords="'.$keywords.'" num="10" country="US" searchindex="All" templatename="default" paging="true"]';
    echo do_shortcode($text);
    }
    phpZonsearch($_GET["s"]);
    ?>
    </p>
    			
    <?php get_footer(); ?>

  8. #8
    Join Date
    Jun 2010
    Location
    Maine
    Posts
    7,503
    Rep Power
    12

    Default

    Glenn,

    This is a little beyond the scope of support for the theme, but here's what I tried to do.

    I replaced the form we first discussed in this thread with the searchform.php file.

    And I saved the search.php file to my desktop and then FTP'd it into the Socrates folder with the other theme files.

    Then I tested it and got this error.

    Fatal error: Call to undefined function phpbaypro() in /home/socrates/public_html/beta/wp-content/themes/socrates/search.php on line 23

    When Googling this error there's actually 378 results... so it's pretty common problem.

    And then of course I discovered PHPBayPro is a plugin which you never mentioned.. and which would have made things a lot easier. (and saved 30 minutes of my day)

    Do you have the plugin installed?

    That and the above are probably what you need to make it work.

  9. #9
    Join Date
    Jun 2010
    Posts
    72
    Rep Power
    5

    Default

    Yes. I hae the plug-in installed. It's requires a license so that probably why you got that error.

    Can you tell what I need to do?

    So you copied my code into searchform.php and search.php respectively and uploaded them to the socrates folder?

    What about the form code in your header.php, what do you do with that?

  10. #10
    Join Date
    Jun 2010
    Posts
    72
    Rep Power
    5

    Default

    Quote Originally Posted by admin View Post
    Glenn,

    This is a little beyond the scope of support for the theme, but here's what I tried to do.

    I replaced the form we first discussed in this thread with the searchform.php file.

    And I saved the search.php file to my desktop and then FTP'd it into the Socrates folder with the other theme files.

    Then I tested it and got this error.

    Fatal error: Call to undefined function phpbaypro() in /home/socrates/public_html/beta/wp-content/themes/socrates/search.php on line 23

    When Googling this error there's actually 378 results... so it's pretty common problem.

    And then of course I discovered PHPBayPro is a plugin which you never mentioned.. and which would have made things a lot easier. (and saved 30 minutes of my day)

    Do you have the plugin installed?

    That and the above are probably what you need to make it work.
    OK. I think I get it. I replaced the FORM code in your header.php with the searchform.php code and uploaded the code in SEARCH.PHP to the socrates folder. I get this warning: Warning: Invalid argument supplied for foreach() in /home/tsfl/public_html/talkingsoccer.net/wp-content/themes/socrates/search.php on line 3
    And the EBay, Amazon listings display but they take over the whole page instead of being in the center column. Here is the URL: talkingsoccer.net

    What can I do to fix this?

Posting Permissions

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