Changeset 208429
- Timestamp:
- 02/20/2010 08:13:20 PM (16 years ago)
- Location:
- wordbay
- Files:
-
- 8 added
- 3 edited
-
tags/1.20 (added)
-
tags/1.20/WordBay license.txt (added)
-
tags/1.20/WordBay readme.txt (added)
-
tags/1.20/WordBay.css.default (added)
-
tags/1.20/WordBay.php (added)
-
tags/1.20/buy.php (added)
-
tags/1.20/click-for-details.png (added)
-
tags/1.20/countries.txt (added)
-
trunk/WordBay license.txt (modified) (1 diff)
-
trunk/WordBay readme.txt (modified) (3 diffs)
-
trunk/WordBay.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wordbay/trunk/WordBay license.txt
r204162 r208429 1 WordBay - eBay plugin for WordPress, v1. 16, 11/2/20101 WordBay - eBay plugin for WordPress, v1.20, 20/2/2010 2 2 3 Copyright (C) 2008, 2009 Mark Daniels3 Copyright (C) 2008, 2009, 2010 Mark Daniels 4 4 5 5 -------- -
wordbay/trunk/WordBay readme.txt
r204162 r208429 4 4 Tags: ebay, affiliate, listing, product 5 5 Requires at least: 2.5 6 Tested up to: 2. 627 Stable tag: 1. 166 Tested up to: 2.9.2 7 Stable tag: 1.20 8 8 name: WordBay 9 9 … … 76 76 [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. 77 77 78 There is more help on the relevant eBay page (http://pages.ebay.com/help/find/search_commands.html?fromFeature=Advanced%20Search). 78 There 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 82 BETA! "Widget" functionality 83 84 Purely 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 79 92 80 93 … … 92 105 All comments and suggestions will be appreciated, to help iron out any bugs. 93 106 107 108 Changelog 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... 94 114 95 115 Changelog 1.16 -
wordbay/trunk/WordBay.php
r205886 r208429 5 5 Description: 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 /> 6 6 Includes 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. 167 Version: 1.20 8 8 Author: Mark Daniels 9 9 Author URI: http://www.itsgottabered.com/wordbay/about … … 35 35 curl_close ($ch); 36 36 return $content; 37 } 37 } 38 39 function Wbwidget($params) 40 { 41 42 $wb=new WordBay(); 43 return $wb->WBlisting('', $params['searchterms'], TRUE, FALSE, TRUE); 44 45 } 38 46 39 47 … … 51 59 } 52 60 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 inserted61 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 54 62 55 63 … … 160 168 161 169 $newcontent = "<div id='leftpanel'>"; 162 if ( $was_search == TRUE ) {170 if ( $was_search == TRUE && $is_widget == FALSE) { 163 171 $newcontent .= 'Search results:<br/>'; 164 172 } else { … … 283 291 $description = str_replace ( "<a ", "<a rel='nofollow' ", $description ); // Add "nofollow" to all hyperlinks 284 292 285 $siteurl = get_ option ('siteurl');293 $siteurl = get_bloginfo ('wpurl'); 286 294 $newcontent .= "<b><a rel='nofollow' href='" . $href . "'>" . 287 295 $title . … … 291 299 292 300 { 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>";} 294 302 295 303 $newcontent .= $description."</li></div>"; … … 889 897 $was_search = FALSE; 890 898 $is_searchpage = TRUE; 891 $content = WordBay :: WBlisting ( $content, $searchterms, $was_search, $is_searchpage );899 $content = WordBay :: WBlisting ( $content, $searchterms, $was_search, $is_searchpage, FALSE ); 892 900 893 901 } elseif ( preg_match ( '#\\[wordbay\\](.*?)\\[\\/wordbay\\]#is', $content, $searchterm ) ) // Find the WordBay tags … … 897 905 $was_search = FALSE; 898 906 $is_searchpage = FALSE; 899 $content = WordBay :: WBlisting ( $content, $searchterms, $was_search, $is_searchpage );907 $content = WordBay :: WBlisting ( $content, $searchterms, $was_search, $is_searchpage, FALSE ); 900 908 901 909 } elseif ( $_GET["WBsearch"] ) { 902 $searchterms = $_GET["WBsearch"];910 $searchterms = htmlspecialchars($_GET["WBsearch"]); 903 911 $was_search = TRUE; 904 912 $is_searchpage = FALSE; 905 $content = WordBay :: WBlisting ( $content, $searchterms, $was_search, $is_searchpage );913 $content = WordBay :: WBlisting ( $content, $searchterms, $was_search, $is_searchpage, FALSE ); 906 914 907 915 }
Note: See TracChangeset
for help on using the changeset viewer.