Version Description
Download this release
Release Info
Developer | aaroncampbell |
Plugin | Twitter Widget Pro |
Version | 1.2.1 |
Comparing to | |
See all releases |
Code changes from version 1.2.0 to 1.2.1
- readme.txt +1 -1
- wp-twitter-widget.php +54 -9
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=paypal%4
|
|
4 |
Tags: twitter, widget, feed
|
5 |
Requires at least: 2.5
|
6 |
Tested up to: 2.5.1
|
7 |
-
Stable tag: 1.2.
|
8 |
|
9 |
A widget that properly handles twitter feeds, including parsing @username and URLs into links. Requires PHP5.
|
10 |
|
4 |
Tags: twitter, widget, feed
|
5 |
Requires at least: 2.5
|
6 |
Tested up to: 2.5.1
|
7 |
+
Stable tag: 1.2.1
|
8 |
|
9 |
A widget that properly handles twitter feeds, including parsing @username and URLs into links. Requires PHP5.
|
10 |
|
wp-twitter-widget.php
CHANGED
@@ -3,16 +3,20 @@
|
|
3 |
* Plugin Name: Twitter Widget Pro
|
4 |
* Plugin URI: http://xavisys.com/wordpress-twitter-widget/
|
5 |
* Description: A widget that properly handles twitter feeds, including @username and link parsing, and can even display profile images for the users. Requires PHP5.
|
6 |
-
* Version: 1.2.
|
7 |
* Author: Aaron D. Campbell
|
8 |
* Author URI: http://xavisys.com/
|
9 |
*/
|
10 |
|
11 |
-
define('TWP_VERSION', '1.2.
|
12 |
|
13 |
/**
|
14 |
* Changelog:
|
15 |
* 06/09/2008: 1.2.0
|
|
|
|
|
|
|
|
|
16 |
* - Removed friends feed option, twitter removed this functionality
|
17 |
* - Added an option to set your own message to display when twitter is down
|
18 |
* - Added optional anonymous statistics collection
|
@@ -111,6 +115,46 @@ class wpTwitterWidget
|
|
111 |
$this->userAgent = 'WordPress/' . $GLOBALS['wp_version'];
|
112 |
}
|
113 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
114 |
/**
|
115 |
* Pulls the JSON feed from Twitter and returns an array of objects
|
116 |
*
|
@@ -574,8 +618,8 @@ profileImage;
|
|
574 |
|
575 |
function activatePlugin() {
|
576 |
// If the wga-id has not been generated, generate one and store it.
|
577 |
-
$o = get_option('twitter_widget_pro');
|
578 |
$id = $this->get_id();
|
|
|
579 |
if (!isset($o['user_agreed_to_send_system_information'])) {
|
580 |
$o['user_agreed_to_send_system_information'] = 'true';
|
581 |
update_option('twitter_widget_pro', $o);
|
@@ -583,19 +627,19 @@ profileImage;
|
|
583 |
}
|
584 |
|
585 |
function get_id() {
|
586 |
-
$
|
587 |
-
if (
|
588 |
-
$
|
589 |
-
update_option('twitter_widget_pro', $
|
590 |
}
|
591 |
-
return $
|
592 |
}
|
593 |
/**
|
594 |
* if user agrees to send system information and the last sent info is outdated outputs a bunch of stuff that sends sysinfo without interrupting
|
595 |
*/
|
596 |
function outputSendInfoForm()
|
597 |
{
|
598 |
-
$o = get_option('
|
599 |
if ($o['user_agreed_to_send_system_information'] == 'true') {
|
600 |
$lastSent = get_option('twp-sysinfo');
|
601 |
$sysinfo = $this->get_sysinfo();
|
@@ -642,6 +686,7 @@ $wpTwitterWidget = new wpTwitterWidget();
|
|
642 |
/**
|
643 |
* Add filters and actions
|
644 |
*/
|
|
|
645 |
add_action('widgets_init', array($wpTwitterWidget, 'register'));
|
646 |
add_filter('widget_twitter_content', array($wpTwitterWidget, 'linkTwitterUsers'));
|
647 |
add_filter('widget_twitter_content', array($wpTwitterWidget, 'linkUrls'));
|
3 |
* Plugin Name: Twitter Widget Pro
|
4 |
* Plugin URI: http://xavisys.com/wordpress-twitter-widget/
|
5 |
* Description: A widget that properly handles twitter feeds, including @username and link parsing, and can even display profile images for the users. Requires PHP5.
|
6 |
+
* Version: 1.2.1
|
7 |
* Author: Aaron D. Campbell
|
8 |
* Author URI: http://xavisys.com/
|
9 |
*/
|
10 |
|
11 |
+
define('TWP_VERSION', '1.2.1');
|
12 |
|
13 |
/**
|
14 |
* Changelog:
|
15 |
* 06/09/2008: 1.2.0
|
16 |
+
* - Fixed some minor errors in the collection code
|
17 |
+
* - Added the admin options page (how did that get missed?!?)
|
18 |
+
*
|
19 |
+
* 06/09/2008: 1.2.0
|
20 |
* - Removed friends feed option, twitter removed this functionality
|
21 |
* - Added an option to set your own message to display when twitter is down
|
22 |
* - Added optional anonymous statistics collection
|
115 |
$this->userAgent = 'WordPress/' . $GLOBALS['wp_version'];
|
116 |
}
|
117 |
|
118 |
+
function admin_menu() {
|
119 |
+
add_options_page(__('Twitter Widget Pro'), __('Twitter Widget Pro'), 'manage_options', str_replace("\\", "/", __FILE__), array($this, 'options'));
|
120 |
+
}
|
121 |
+
/**
|
122 |
+
* This is used to display the options page for this plugin
|
123 |
+
*/
|
124 |
+
function options() {
|
125 |
+
//Get our options
|
126 |
+
$o = get_option('twitter_widget_pro');
|
127 |
+
?>
|
128 |
+
<div class="wrap">
|
129 |
+
<h2><?php _e('Twitter Widget Pro Options') ?></h2>
|
130 |
+
<form action="options.php" method="post" id="wp_twitter_widget_pro">
|
131 |
+
<?php wp_nonce_field('update-options'); ?>
|
132 |
+
<table class="form-table">
|
133 |
+
<tr valign="top">
|
134 |
+
<th scope="row">
|
135 |
+
<a title="<?php _e('Click for Help!'); ?>" href="#" onclick="jQuery('#twp_user_agreed_to_send_system_information_help').toggle(); return false;">
|
136 |
+
<?php _e('System Information:') ?>
|
137 |
+
</a>
|
138 |
+
</th>
|
139 |
+
<td>
|
140 |
+
<label for="twp_user_agreed_to_send_system_information"><input type="checkbox" name="twitter_widget_pro[user_agreed_to_send_system_information]" value="true" id="twp_user_agreed_to_send_system_information"<?php checked('true', $o['user_agreed_to_send_system_information']); ?> /> <?php _e('I agree to send anonymous system information'); ?></label><br />
|
141 |
+
<small id="twp_user_agreed_to_send_system_information_help" style="display:none;">
|
142 |
+
<?php _e('You can help by sending anonymous system information that will help Xavisys make better decisions about new features.'); ?><br />
|
143 |
+
<?php _e('The information will be sent anonymously, but a unique identifier will be sent to prevent duplicate entries from the same installation.'); ?>
|
144 |
+
</small>
|
145 |
+
</td>
|
146 |
+
</tr>
|
147 |
+
</table>
|
148 |
+
<p class="submit">
|
149 |
+
<input type="submit" name="Submit" value="<?php _e('Update Options »'); ?>" />
|
150 |
+
</p>
|
151 |
+
<input type="hidden" name="action" value="update" />
|
152 |
+
<input type="hidden" name="page_options" value="twitter_widget_pro" />
|
153 |
+
</form>
|
154 |
+
</div>
|
155 |
+
<?php
|
156 |
+
}
|
157 |
+
|
158 |
/**
|
159 |
* Pulls the JSON feed from Twitter and returns an array of objects
|
160 |
*
|
618 |
|
619 |
function activatePlugin() {
|
620 |
// If the wga-id has not been generated, generate one and store it.
|
|
|
621 |
$id = $this->get_id();
|
622 |
+
$o = get_option('twitter_widget_pro');
|
623 |
if (!isset($o['user_agreed_to_send_system_information'])) {
|
624 |
$o['user_agreed_to_send_system_information'] = 'true';
|
625 |
update_option('twitter_widget_pro', $o);
|
627 |
}
|
628 |
|
629 |
function get_id() {
|
630 |
+
$id = get_option('twitter_widget_pro-id');
|
631 |
+
if ($id === false) {
|
632 |
+
$id = sha1( get_bloginfo('url') . mt_rand() );
|
633 |
+
update_option('twitter_widget_pro-id', $id);
|
634 |
}
|
635 |
+
return $id;
|
636 |
}
|
637 |
/**
|
638 |
* if user agrees to send system information and the last sent info is outdated outputs a bunch of stuff that sends sysinfo without interrupting
|
639 |
*/
|
640 |
function outputSendInfoForm()
|
641 |
{
|
642 |
+
$o = get_option('twitter_widget_pro');
|
643 |
if ($o['user_agreed_to_send_system_information'] == 'true') {
|
644 |
$lastSent = get_option('twp-sysinfo');
|
645 |
$sysinfo = $this->get_sysinfo();
|
686 |
/**
|
687 |
* Add filters and actions
|
688 |
*/
|
689 |
+
add_action('admin_menu', array($wpTwitterWidget,'admin_menu'));
|
690 |
add_action('widgets_init', array($wpTwitterWidget, 'register'));
|
691 |
add_filter('widget_twitter_content', array($wpTwitterWidget, 'linkTwitterUsers'));
|
692 |
add_filter('widget_twitter_content', array($wpTwitterWidget, 'linkUrls'));
|