View Single Post
Old 08-16-2008, 08:16 PM   #96 (permalink)
Funky Bunch
Member
 
Funky Bunch's Avatar
 
Join Date: Jun 2007
Posts: 31
iTrader: 7 / 100%
Funky Bunch has a reputation beyond reputeFunky Bunch has a reputation beyond reputeFunky Bunch has a reputation beyond reputeFunky Bunch has a reputation beyond reputeFunky Bunch has a reputation beyond reputeFunky Bunch has a reputation beyond reputeFunky Bunch has a reputation beyond reputeFunky Bunch has a reputation beyond reputeFunky Bunch has a reputation beyond reputeFunky Bunch has a reputation beyond reputeFunky Bunch has a reputation beyond repute
Quote:
Originally Posted by puroz View Post
Hey i have question if anyone can help. At the PHPBay: Start to Finish Tutorial : eurekadiary.com tutorial at the end it has a section to turn the search into an automatic ebay search. I tried copy pasting that code every which way and it just will not find anything. All it does is make a blank page with "your results" at the top. Im using the standart limauorange search.php file and the tutorial is very unlcear on where to paste it.
I believe the part you need to replace is everything between "<?php if (have_posts()) : ?>" and "<?php endif; ?>" So you'd delete those 2 lines and everything between them, and put the search code in its place.

If you prefer you can just delete everything in your search.php file, and copy and paste everything below into it.


Code:
<?php get_header(); ?>
<?php get_sidebar(); ?>
    <div class="middle">

    <p align="center">Your search for '<strong><font color="#FF0000"><? echo $_GET["s"] ?></font></strong>' returned the following results:</p>
<p>
<?
function phpBaySearch($term) {
    $kw = trim(urldecode($term));
    # set the number of results to return here.
    $num = 20;
    $cat = "";
    $excl = "";
    if ($kw) {
      # turn error reporting off in case of a server timeout when connecting to ebay
      # if you are having troubles, set error_reporting to (1)
      error_reporting(0);
      include(ABSPATH . "wp-content/plugins/phpBay/ebay.php");
      $ebay = new ebay();

    # set the number of auction listings to display
    if (intval($num) > 0) {
      $ebay->eb_frpp = intval($num);
    } else {
    # if number of auction listings to display is not set, then default to 10
      $ebay->eb_frpp = 10;
    }

    # if there are words to exclude in the search, assign them here.  ie "word1 word2 word3"
    if ($excl > "") {$ebay->eb_exclude = $excl;}

    # Set all global options that are stored in the phpBay Pro Admin Panel
    $ebay->eb_saaff = unhtmlentities(get_option("PB_aff_type"));
    $ebay->eb_pid = unhtmlentities(get_option("PB_ebay_pid"));
    if ($cid > "") {$ebay->eb_custom_cid = "_" . urlencode($cid);}
    $ebay->eb_cid = urlencode(get_option("PB_ebay_cid"));
    $ebay->site_url = get_bloginfo("wpurl") . "/";
    $ebay->encode = unhtmlentities(get_option("PB_encode"));
    $ebay->url_prefix = unhtmlentities(get_option("PB_url_prefix"));
    $ebay->eb_salic = unhtmlentities(get_option("PB_eb_salic"));
    $ebay->eb_saatc = unhtmlentities(get_option("PB_eb_saatc"));
    $ebay->mod_rewrite = unhtmlentities(get_option("PB_mod_rewrite"));
    $ebay->eb_aff_text = unhtmlentities(get_option("PB_aff_text"));

    # Set Country Code Information
    $ebay->eb_siteId = get_option("PB_eb_siteId");
    if ($PB_eb_siteId == "") {$PB_eb_siteId = "0";}
    if ($ebay->eb_siteId == "0") {$ebay->eb_language = "en-US";}
    if ($ebay->eb_siteId == "15") {$ebay->eb_language = "en-AU";}
    if ($ebay->eb_siteId == "16") {$ebay->eb_language = "de-AT";}
    if ($ebay->eb_siteId == "123") {$ebay->eb_language = "nl-BE";}
    if ($ebay->eb_siteId == "2") {$ebay->eb_language = "en-CA";}
    if ($ebay->eb_siteId == "71") {$ebay->eb_language = "fr-FR";}
    if ($ebay->eb_siteId == "77") {$ebay->eb_language = "de-DE";}
    if ($ebay->eb_siteId == "201") {$ebay->eb_language = "";}
    if ($ebay->eb_siteId == "203") {$ebay->eb_language = "en-IN";}
    if ($ebay->eb_siteId == "205") {$ebay->eb_language = "";}
    if ($ebay->eb_siteId == "101") {$ebay->eb_language = "it-IT";}
    if ($ebay->eb_siteId == "146") {$ebay->eb_language = "nl-NL";}
    if ($ebay->eb_siteId == "212") {$ebay->eb_language = "";}
    if ($ebay->eb_siteId == "216") {$ebay->eb_language = "";}
    if ($ebay->eb_siteId == "186") {$ebay->eb_language = "es-ES";}
    if ($ebay->eb_siteId == "193") {$ebay->eb_language = "de-CH";}
    if ($ebay->eb_siteId == "3") {$ebay->eb_language = "en-GB";}

    $PB_sort_order = get_option("PB_sort_order");
    if ($PB_sort_order == "1") {$ebay->eb_fsop = "1";$ebay->eb_fsoo = "1";}
    if ($PB_sort_order == "2") {$ebay->eb_fsop = "2";$ebay->eb_fsoo = "2";}
    if ($PB_sort_order == "3") {$ebay->eb_fsop = "3";$ebay->eb_fsoo = "1";}
    if ($PB_sort_order == "4") {$ebay->eb_fsop = "3";$ebay->eb_fsoo = "2";}

    $PB_eb_fcl = unhtmlentities(get_option("PB_eb_fcl"));
    $PB_eb_fts = unhtmlentities(get_option("PB_eb_fts"));
    $PB_eb_saprclo = unhtmlentities(get_option("PB_eb_saprclo"));
    $PB_eb_saprchi = unhtmlentities(get_option("PB_eb_saprchi"));
    $PB_eb_sabdlo = unhtmlentities(get_option("PB_eb_sabdlo"));
    $PB_eb_sabdhi = unhtmlentities(get_option("PB_eb_sabdhi"));
    $PB_eb_fspt = unhtmlentities(get_option("PB_eb_fspt"));
    $PB_eb_fpos = unhtmlentities(get_option("PB_eb_fpos"));
    $PB_eb_sadis = unhtmlentities(get_option("PB_eb_sadis"));
    $PB_eb_sasl_cb = unhtmlentities(get_option("PB_eb_sasl_cb"));
    $PB_eb_sasl = unhtmlentities(get_option("PB_eb_sasl"));
    $PB_eb_fbfmt = unhtmlentities(get_option("PB_eb_fbfmt"));

    # search items with free shipping
    $ebay->eb_ffsh = unhtmlentities(get_option("PB_eb_ffsh"));

    # ebay logo
    $ebay->logo = unhtmlentities(get_option("PB_logo"));

    # sort drop down
    $ebay->sort_by = unhtmlentities(get_option("PB_sort"));

    # alternating rows
    $ebay->row_alter = unhtmlentities(get_option("PB_row"));
    $ebay->row_odd = unhtmlentities(get_option("PB_row_odd"));
    $ebay->row_even = unhtmlentities(get_option("PB_row_even"));
    $ebay->row_hover_cb = unhtmlentities(get_option("PB_row_hover_cb"));
    $ebay->row_hover = unhtmlentities(get_option("PB_row_hover"));

    # columns
    $PB_columns_cb = unhtmlentities(get_option("PB_columns_cb"));
    if ($PB_columns_cb > "0") {$ebay->columns = unhtmlentities(get_option("PB_columns"));}

    # buy it now items
    if ($PB_eb_fbfmt == "1") {$ebay->eb_fbfmt = "1"; $ebay->eb_sabfmts = "2";}

    # items with photo only (if set to 4)
    if ($PB_eb_fcl == "4") {$ebay->eb_fcl = "4";} else {$ebay->eb_fcl = "3";}

    # search titles and descriptions (if set to 2)
    if ($PB_eb_fts == "2") {$ebay->eb_fts = "2";} else {$ebay->eb_fts = "";}

    # items by min/max bid price
    if ($PB_eb_saprclo > "") {$ebay->eb_saprclo = urlencode($PB_eb_saprclo);} else {$ebay->eb_saprclo = "";}
    if ($PB_eb_saprchi > "") {$ebay->eb_saprchi = urlencode($PB_eb_saprchi);} else {$ebay->eb_saprchi = "";}

    # items by min/max number of bids
    if ($PB_eb_sabdlo > "") {$ebay->eb_sabdlo = urlencode($PB_eb_sabdlo);$ebay->eb_fbd = "1";} else {$ebay->eb_sabdlo = "";}
    if ($PB_eb_sabdhi > "") {$ebay->eb_sabdhi = urlencode($PB_eb_sabdhi);} else {$ebay->eb_sabdhi = "";}

    # list items by zip code
    if ($PB_eb_fspt == "1") {
      $ebay->eb_fspt = urlencode($PB_eb_fspt);
      $ebay->eb_fpos = urlencode($PB_eb_fpos);
      $ebay->eb_sadis = urlencode($PB_eb_sadis);
    }

    # list tiems by specific seller id
    if (($PB_eb_sasl_cb == "1") && ($PB_eb_sasl > "")) {$ebay->eb_sasl = urlencode($PB_eb_sasl);$ebay->eb_fss = "1";} else {$ebay->eb_sasl = "";}

    # search items with free shipping
    if ($PB_eb_ffsh == "1") {$ebay->eb_ffsh = "1";}

    # pagination form
    $ebay->paginate = unhtmlentities(get_option("PB_paginate_cb"));
    $ebay->paginate_per_page = unhtmlentities(get_option("PB_paginate"));
    $ebay->page = 1;
    # each instance of the paging javascript must be unique
    $js = $ebay->jsText($kw);
    $js = str_replace("-", "", $js);
    $js = "pagenum_" . $js;
    if ($_POST["$js"] > "") {$ebay->page = intval($_POST["$js"]);}

    # sort order form
    $ebay->sort_by_value = 1;
    if ($ebay->sort_by == 1) {
      $js = $ebay->jsText($kw);
      $js = str_replace("-", "", $js);
      $js = "sortnum_" . $js;
      if ($_POST["$js"] > "") {$ebay->sort_by_value = intval($_POST["$js"]);}
      if ($ebay->sort_by_value == 1) {$ebay->eb_fsop = "1";$ebay->eb_fsoo = "1";}
      if ($ebay->sort_by_value == 2) {$ebay->eb_fsop = "2";$ebay->eb_fsoo = "2";}
      if ($ebay->sort_by_value == 3) {$ebay->eb_fsop = "3";$ebay->eb_fsoo = "1";}
      if ($ebay->sort_by_value == 4) {$ebay->eb_fsop = "3";$ebay->eb_fsoo = "2";}
    }

      # call the main ebay function, receive the listings in html and replace the phpbay tags with the content
      $ebay->listings($kw, $cat);
      $text = $ebay->html;
    }
  echo $text;
}
phpBaySearch($_GET["s"]);
?>
</p>
    </div>

<?php get_sidebar(); ?>

<?php get_footer(); ?>
Funky Bunch is offline   Reply With Quote