www.auctionnudge.com 2) Paste the code into the Auction Nudge configuration page 3) Place markers like [an_items] in pages or posts or call <?php wp_items(); ?> from your theme files to display your eBay data on your site. Version: 1.0 Author: Joseph Hawes Author URI: http://www.josephhawes.co.uk/ License: GPL2 */ /* Copyright 2011 Joseph Hawes (email: joe@josephhawes.co.uk) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Thanks to Otto on WordPress for their Wordpress settings tutorial: http://ottopress.com/2009/wordpress-settings-api-tutorial/ */ // Add the admin options page function an_admin_page() { add_options_page('Auction Nudge Plugin Page', 'Auction Nudge', 'manage_options', 'an_options_page', 'an_options_page'); } add_action('admin_menu', 'an_admin_page'); //Display the admin options page function an_options_page() { echo '
This plugin enables you to embed your live eBay information on your WordPress site using Auction Nudge. Auction Nudge is a set of free widgets to integrate eBay into your own website. If you sell on eBay you can include Your eBay Listings, Your eBay Profile and Your eBay Feedback on your site by installing one line of code.
' . "\n"; echo 'You can view more information and help at the plugin home page here: http://www.auctionnudge.com/wordpress-plugin or at the WordPress plugin page.
' . "\n"; echo ' ' . "\n"; echo 'To begin you must obtain your code snippet from the Auction Nudge website here: http://www.auctionnudge.com/your-ebay-items (shown as "Copy the code snippet onto your site") and paste it into the box below.
' . "\n"; echo 'You can then specify where to display Your eBay Items by placing the marker [an_items] in a post or page content through the editor. Alternatively you can call <?php an_items(); ?> from within your theme files.
' . "\n"; } //Output items option function an_items_setting() { $options = get_option('an_options'); echo '' . "\n"; } //Profile text function an_profile_text() { echo 'To begin you must obtain your code snippet from the Auction Nudge website here: http://www.auctionnudge.com/your-ebay-profile (shown as "Copy the code snippet onto your site") and paste it into the box below.
' . "\n"; echo 'You can then specify where to display Your eBay Items by placing the marker [an_profile] in a post or page content through the editor. Alternatively you can call <?php an_profile(); ?> from within your theme files.
' . "\n"; } //Output profile option function an_profile_setting() { $options = get_option('an_options'); echo '' . "\n"; } //Feedback text function an_feedback_text() { echo 'To begin you must obtain your code snippet from the Auction Nudge website here: http://www.auctionnudge.com/your-ebay-feedback (shown as "Copy the code snippet onto your site") and paste it into the box below.
' . "\n"; echo 'You can then specify where to display Your eBay Items by placing the marker [an_feedback] in a post or page content through the editor. Alternatively you can call <?php an_feedback(); ?> from within your theme files.
' . "\n"; } //Output feedback option function an_feedback_setting() { $options = get_option('an_options'); echo '' . "\n"; } //Feedback text function an_css_text() { echo 'You can modify the appearance of Auction Nudge by pasting CSS rules into this box.
' . "\n"; echo 'Ensure you target Auction Nudge content by starting your rules with div.auction-nudge. For example div.auction-nudge a { color: red } to make all Auction Nudge links red. You can find more information and demos on modifying the appearance of Auction Nudge here: http://www.auctionnudge.com/help#faq-css
' . "\n"; } //Output css option function an_css_setting() { $options = get_option('an_options'); echo '' . "\n"; } //Validate our options function an_options_validate($input) { $output['an_items_code'] = trim($input['an_items_code']); $output['an_profile_code'] = trim($input['an_profile_code']); $output['an_feedback_code'] = trim($input['an_feedback_code']); $output['an_css_rules'] = trim($input['an_css_rules']); return $output; } //Replace markers function an_the_content($content) { $options = get_option('an_options'); $old = array( '[an_items]', '[an_profile]', '[an_feedback]' ); $new = array( $options['an_items_code'], $options['an_profile_code'], $options['an_feedback_code'] ); return str_replace($old, $new, $content); } add_filter('the_content', 'an_the_content'); //Get option function an_get_option($option_key) { $options = get_option('an_options'); return $options[$option_key]; } //Output items function an_items() { echo an_get_option('an_items_code'); } //Output profile function an_profile() { echo an_get_option('an_profile_code'); } //Output feedback function an_feedback() { echo an_get_option('an_feedback_code'); } //Load custom CSS function an_load_css() { $options = get_option('an_options'); echo '' . "\n"; } add_action('wp_head', 'an_load_css');