>Widgets>>UserVoice Idea List Widget.
Version: 1.6
Author: Maintained by TJ Downes of MediaSlurp. Rob Knight. Originally produced by Shane & Peter, Inc.
Author URI: http://mediaslurp.com/download/uservoice-idea-list-widget/
Maintained by: MediaSlurp development team - TJ Downes, Vicky Ryder and Ben Farrell
Maintainer URI: http://mediaslurp.com/download/uservoice-idea-list-widget/
See the readme.txt for install instructions if you are doing an manual install.
History:
1.6
* ADDED: There is now an Order By feature that allows you to specify the order of feedback.
All of the available order by arguments are used, so if you need other order by paramters and dont see
it in the list, ask UserVoice to add it to the API!
1.5
* CHANGED: IMPORTANT!!!! Migrated to the "new" plugin/widget API. This means that this plugin may not work
on some older installations of WordPress. This allows the widget to be put into multiple sidebars.
Backup your existing installation BEFORE upgrading. Please remember to report any errors, as this is an
almost complete rewrite of the widget.
1.4
* You can now turn off the "powered by" logo by using the "Hide Credits" option in the widget options
* You can now add text to the footer of the widget using the "Footer Text" option in the widget options. You are responsible for styling. Override the default id, uv_footer_text to style it yourself.
* Updated installer doc for info on API key
* Code cleanup
* CHANGED: Cleaner "powered by" logo, in PNG format. Thanks UV!
* Fixed break in widget admin on account name
1.3
* Updated for the most recent UV API (version 1). This should have gone into 1.2 but there were bugs that we weren't certain we would have fixed on time
* Now requires API KEY!!!!
* account name has been updated and you should only require the account name, not the full uservoice subdomain (mediaslurp instead of mediaslurp.uservoice.com)
1.2
* Updated widget to fix URL, wehich was broken and did not allow plugin to function
* reformatted code for readability
* updated some text elements for usability, in management console
* updated classes on text inputs in widget editor so they would span entire width of the widget editor
*/
class UserVoiceIdeaListWidget extends WP_Widget
{
var $id = "uservoice-suggestions";
var $name = "UserVoice";
var $classname = "uservoice_suggestions_widget";
var $optionsname = "uservoice_suggestions_widget_option";
var $description = "UserVoice suggestions widget";
/** constructor */
function UserVoiceIdeaListWidget()
{
parent::WP_Widget(false, $name = 'UserVoice Idea List Widget');
}
/** @see WP_Widget::widget */
function widget($args, $instance)
{
extract($args);
$title = apply_filters('widget_title', $instance['title']);
$account = apply_filters('widget_account', $instance['account']);
$forum_id = apply_filters('widget_forum_id', $instance['forum_id']);
$order_by = apply_filters('widget_order_by', $instance['order_by']);
$count = apply_filters('widget_count', $instance['count']);
$api_key = apply_filters('widget_api_key', $instance['api_key']);
$hide_credits = apply_filters('widget_hide_credits', $instance['hide_credits']);
$footer_text = apply_filters('widget_footer_text', $instance['footer_text']);
echo $before_widget;
echo $before_title . $title . $after_title;
//Run function to return HTML with suggestions
echo $this->uservoice_get_suggestions($account, $forum_id, $order_by, $count, $api_key, $hide_credits, $footer_text);
echo $after_widget;
}
// Widget Panel
/** @see WP_Widget::form */
function form($instance)
{
$title = esc_attr($instance['title']);
$account = esc_attr($instance['account']);
$forum_id = esc_attr($instance['forum_id']);
$order_by = esc_attr($instance['order_by']);
$count = esc_attr($instance['count']);
$api_key = esc_attr($instance['api_key']);
$hide_credits = esc_attr($instance['hide_credits']);
$footer_text = esc_attr($instance['footer_text']);
$hide_credits_options = '
';
// Display the widget control panel
echo '
';
echo '
';
echo '
';
echo '
';
echo '
';
echo '';
echo $hide_credits_options;
echo '';
echo '