'aeytimes', 'description' => 'A widget displaying the latest comments of your idea on AeyTimes.' ); $control_ops = array( 'width' => 300, 'height' => 350, 'id_base' => 'aeytimes-site' ); $this->WP_Widget('aeytimes-site', 'Aeytimes Site Widget', $widget_ops, $control_ops); } function widget($args, $instance) { add_filter( 'wp_feed_cache_transient_lifetime', create_function( '$a', 'return 900;' ) ); extract($args, EXTR_SKIP); $title = apply_filters('widget_title', $instance['title']); $uri = "http://aeytimes.com/comment_feeds/".$instance['aeyid'].".xml"; $max = $instance['latestmax']; echo $before_widget; if ($title) { echo $before_title . $title . $after_title; } if($instance['userid'] == "") { echo "Invalid Idea"; } else { $rss = fetch_feed($uri); if (!is_wp_error($rss)) { $maxitems = $rss->get_item_quantity($max); $rss_items = $rss->get_items(0, $maxitems); } echo ""; echo "

... Give feedback

"; } echo $after_widget; } function update($new_instance, $old_instance) { $instance = $old_instance; $instance['title'] = strip_tags($new_instance['title']); $instance['aeyid'] = strip_tags($new_instance['aeyid']); $instance['userid'] = file_get_contents("http://aeytimes.com/getfileid/".$instance['aeyid']."/"); $instance['latestmax'] = strip_tags($new_instance['latestmax']); return $instance; } function form($instance) { $title = esc_attr($instance['title']); $aeyid = esc_attr($instance['aeyid']); $latestmax = esc_attr($instance['latestmax']); ?>

'; echo '

Instructions for using the AeyTimes Site Feedback / Comments Widget

'; echo '

AeyTimes is an Idea Journal and Social Network that allows people to share ideas and inspirations, and to submit feedback or comments to improve websites, services, or products.

'; echo '

To start using the Aeytimes Site Feedback / Comments Widget:

'; echo '
    '; echo '
  1. First register at AeyTimes.
  2. '; echo '
  3. Once you have created your account, login and create your AeyTimes ideas pages.
  4. '; echo '
  5. Title the name of your idea page something like "Feedback for YOURSITE", where YOURSITE is the name of your site.
  6. '; echo '
  7. Once you complete the rest of the idea submission process, a URL with the idea number can be found after the forward slash after the word "ideas" ( eg http://aeytimes.com/ideas/###/Feedback_for_YourSite ).
  8. '; echo '
  9. Within your WordPress administration panel, drag your widget to the desired position on the \'Widgets\' page under \'Appearance\'.
  10. '; echo '
  11. Enter a title for your widget, and select the number of feedback comments that you would like to display.
  12. '; echo '
  13. Enter that idea number into the "Idea ID" field of your widget within the WordPress administration panel.
  14. '; echo '
  15. Click on "Save".
  16. '; echo '
  17. For feedback comments to appear on your widget, users must submit feedback on the Comments section on the particular ideas feedback page created on AeyTimes. It may take up to 15 minutes before the comments start displaying.
  18. '; echo '
'; echo ''; } function addAeytimesSiteRSSWidgetOptionsPage() { add_options_page('Site Feedback Options', 'Site Feedback', 'manage_options', 'aeytimes-sites', 'addAeytimesSiteRSSWidgetOptions' ); } add_action('admin_menu', 'addAeytimesSiteRSSWidgetOptionsPage' ); add_action('init', 'register_AeytimesSiteRSSWidget', 1); ?>