Plugin Directory

Changeset 208429


Ignore:
Timestamp:
02/20/2010 08:13:20 PM (16 years ago)
Author:
markowe
Message:
 
Location:
wordbay
Files:
8 added
3 edited

Legend:

Unmodified
Added
Removed
  • wordbay/trunk/WordBay license.txt

    r204162 r208429  
    1 WordBay - eBay plugin for WordPress, v1.16, 11/2/2010
     1WordBay - eBay plugin for WordPress, v1.20, 20/2/2010
    22
    3 Copyright (C) 2008, 2009 Mark Daniels
     3Copyright (C) 2008, 2009, 2010 Mark Daniels
    44
    55--------
  • wordbay/trunk/WordBay readme.txt

    r204162 r208429  
    44Tags: ebay, affiliate, listing, product
    55Requires at least: 2.5
    6 Tested up to: 2.62
    7 Stable tag: 1.16
     6Tested up to: 2.9.2
     7Stable tag: 1.20
    88name: WordBay
    99
     
    7676[wordbay]lamp –(book,CD)[/wordbay] – this will search on “lamp” BUT will exclude “book” and/or “CD”. This type of search is especially useful as it allows you to eliminate most of the junk/irrelevant items like “My Old Lamp CD” and narrow the search down to just actual lamps! Though some of these searches CAn get quite long, and there is supposedly a limit to the number of terms. Just experiment, what can I say.
    7777
    78 There is more help on the relevant eBay page (http://pages.ebay.com/help/find/search_commands.html?fromFeature=Advanced%20Search).
     78There is more help regarding seach criteria on the relevant eBay page (http://pages.ebay.com/help/find/search_commands.html?fromFeature=Advanced%20Search).
     79
     80
     81
     82BETA! "Widget" functionality
     83
     84Purely so you can test it out, the possibility of inserting listings into your template via a PHP function call. Put this code:
     85
     86<?php echo wbwidget(array ('searchterms' => 'ipod') )?>
     87
     88...somewhere in your code (careful not to add the PHP start and end tags if you are placing this within existing PHP code!). Replace 'ipod' with your search terms, using the same search criteria as you would if you were inserting between the '[wordbay]' tags. It is hard to get good results with this because eBay preformats the feed and there is not much we can do to change that. Maybe you can get better results than me with some judicious css Let me know how you get on.
     89
     90
     91
    7992
    8093
     
    92105All comments and suggestions will be appreciated, to help iron out any bugs.
    93106
     107
     108Changelog 1.20
     109
     110- corrected the bug where the "Click for details" icon was taking visitors to a signin page
     111- found some legacy Wordpress functions I was using that needed changing. You won't notice the difference!
     112- added rudimentary "widget" functionality - this is definitely BETA!
     113- corrected small potential security problem - not sanitising $_GET data. Big no-no usually, but it's unlikely this could have been exploited here. Still, better safe...
    94114
    95115Changelog 1.16
  • wordbay/trunk/WordBay.php

    r205886 r208429  
    55Description: Insert eBay product listings in your WordPress posts and pages quickly and easily. Just choose your eBay site, categories and other options in the back-end, add tags [wordbay]your search keywords here[/wordbay] and your WordPress page or post will be populated with relevant eBay listings from the RSS feed. If you are a member of the eBay Partner Network then add your campaign code and you can start earning commission too!<br />
    66Includes geotargetting option and a great number of other options to customise your listings. <br />WordBay is totally free to use, but there is an option to share a percentage of impressions with the author, for which he is always very grateful!
    7 Version: 1.16
     7Version: 1.20
    88Author: Mark Daniels
    99Author URI: http://www.itsgottabered.com/wordbay/about
     
    3535    curl_close ($ch);
    3636    return $content;
    37 
     37}
     38
     39function Wbwidget($params)
     40{
     41
     42$wb=new WordBay();
     43return $wb->WBlisting('', $params['searchterms'], TRUE, FALSE, TRUE);
     44
     45}
    3846
    3947
     
    5159                }
    5260
    53                 function WBlisting ( $oldcontent, $searchterms, $was_search, $is_searchpage ) // The main listing function - takes the existing content and the search terms as parameters and returns new content with listings inserted
     61                function WBlisting ( $oldcontent, $searchterms, $was_search, $is_searchpage, $is_widget) // The main listing function - takes the existing content and the search terms as parameters and returns new content with listings inserted
    5462
    5563               
     
    160168
    161169                                $newcontent = "<div id='leftpanel'>";
    162                                 if ( $was_search == TRUE ) {
     170                                if ( $was_search == TRUE && $is_widget == FALSE) {
    163171                                        $newcontent .= 'Search results:<br/>';
    164172                                } else {
     
    283291                                                $description = str_replace ( "<a ", "<a rel='nofollow' ", $description ); // Add "nofollow" to all hyperlinks
    284292
    285                                                 $siteurl = get_option ('siteurl');
     293                                                $siteurl = get_bloginfo ('wpurl');
    286294                                                $newcontent .= "<b><a rel='nofollow' href='" . $href . "'>" .
    287295                                                        $title .
     
    291299                                               
    292300                                               {
    293                                                $description .= "<a href='".$newurl."' rel='nofollow' title='".$title."'><img src='".$siteurl."/wp-content/plugins/wordbay/click-for-details.png' alt='Click for more details' id='clickicon'></a>";}
     301                                               $description .= "<a href='" . $href . "' rel='nofollow' title='".$title."'><img src='".$siteurl."/wp-content/plugins/wordbay/click-for-details.png' alt='Click for more details' id='clickicon'></a>";}
    294302                                               
    295303                                               $newcontent .= $description."</li></div>";
     
    889897                                $was_search    = FALSE;
    890898                                $is_searchpage = TRUE;
    891                                 $content       = WordBay :: WBlisting ( $content, $searchterms, $was_search, $is_searchpage );
     899                                $content       = WordBay :: WBlisting ( $content, $searchterms, $was_search, $is_searchpage, FALSE );
    892900                               
    893901                        } elseif ( preg_match ( '#\\[wordbay\\](.*?)\\[\\/wordbay\\]#is', $content, $searchterm ) ) // Find the WordBay tags
     
    897905                                $was_search    = FALSE;
    898906                                $is_searchpage = FALSE;
    899                                 $content       = WordBay :: WBlisting ( $content, $searchterms, $was_search, $is_searchpage );
     907                                $content       = WordBay :: WBlisting ( $content, $searchterms, $was_search, $is_searchpage, FALSE );
    900908                               
    901909                        } elseif ( $_GET["WBsearch"] ) {
    902                                 $searchterms   = $_GET["WBsearch"];
     910                                $searchterms   = htmlspecialchars($_GET["WBsearch"]);
    903911                                $was_search    = TRUE;
    904912                                $is_searchpage = FALSE;
    905                                 $content       = WordBay :: WBlisting ( $content, $searchterms, $was_search, $is_searchpage );
     913                                $content       = WordBay :: WBlisting ( $content, $searchterms, $was_search, $is_searchpage, FALSE );
    906914                               
    907915                        }
Note: See TracChangeset for help on using the changeset viewer.