From b339fd125870bb0b084cf54b03cdacd257cc560b Mon Sep 17 00:00:00 2001
From: Steve Clay
Date: Thu, 17 Jan 2013 10:24:54 -0500
Subject: Corrects encoding and other small tweaks in Twitter widget
---
.../views/default/widgets/twitter/content.php | 41 ++++++++++++++--------
mod/twitter/views/default/widgets/twitter/edit.php | 34 +++++++++++-------
2 files changed, 49 insertions(+), 26 deletions(-)
(limited to 'mod/twitter/views/default')
diff --git a/mod/twitter/views/default/widgets/twitter/content.php b/mod/twitter/views/default/widgets/twitter/content.php
index c616d944c..dd741745e 100644
--- a/mod/twitter/views/default/widgets/twitter/content.php
+++ b/mod/twitter/views/default/widgets/twitter/content.php
@@ -6,26 +6,39 @@
* @package ElggTwitter
*/
-//some required params
-
$username = $vars['entity']->twitter_username;
+
+if (empty($username)) {
+ echo "" . elgg_echo("twitter:notset") . "
";
+ return;
+}
+
+$username_is_valid = preg_match('~^[a-zA-Z0-9_]{1,20}$~', $username);
+
+if (!$username_is_valid) {
+ echo "" . elgg_echo("twitter:invalid") . "
";
+ return;
+}
+
+
+
$num = $vars['entity']->twitter_num;
+if (empty($num)) {
+ $num = 5;
+}
-// if the twitter username is empty, then do not show
-if ($username) {
+// @todo upgrade to 1.1 API https://dev.twitter.com/docs/api/1.1/get/statuses/home_timeline
+$script_url = "https://api.twitter.com/1/statuses/user_timeline/" . urlencode($username) . ".json"
+ . "?callback=twitterCallback2&count=" . (int) $num;
?>
-
-
-" . elgg_echo("twitter:notset") . ".
";
-
-}
diff --git a/mod/twitter/views/default/widgets/twitter/edit.php b/mod/twitter/views/default/widgets/twitter/edit.php
index 5da3a7e55..5dd291257 100644
--- a/mod/twitter/views/default/widgets/twitter/edit.php
+++ b/mod/twitter/views/default/widgets/twitter/edit.php
@@ -1,16 +1,26 @@
-
-
-
-
-
-
-
\ No newline at end of file
+
+
+
+
+
+
+
\ No newline at end of file
--
cgit v1.2.3
From 60dde10b389667af0b4e1b703f8962e9e54f4a28 Mon Sep 17 00:00:00 2001
From: Steve Clay
Date: Fri, 18 Jan 2013 16:51:20 -0500
Subject: Style fixes to match 1.8 widgets
---
mod/twitter/views/default/widgets/twitter/content.php | 2 --
mod/twitter/views/default/widgets/twitter/edit.php | 16 +++++++---------
2 files changed, 7 insertions(+), 11 deletions(-)
(limited to 'mod/twitter/views/default')
diff --git a/mod/twitter/views/default/widgets/twitter/content.php b/mod/twitter/views/default/widgets/twitter/content.php
index dd741745e..caefd369a 100644
--- a/mod/twitter/views/default/widgets/twitter/content.php
+++ b/mod/twitter/views/default/widgets/twitter/content.php
@@ -14,14 +14,12 @@ if (empty($username)) {
}
$username_is_valid = preg_match('~^[a-zA-Z0-9_]{1,20}$~', $username);
-
if (!$username_is_valid) {
echo "" . elgg_echo("twitter:invalid") . "
";
return;
}
-
$num = $vars['entity']->twitter_num;
if (empty($num)) {
$num = 5;
diff --git a/mod/twitter/views/default/widgets/twitter/edit.php b/mod/twitter/views/default/widgets/twitter/edit.php
index 5dd291257..c3fc6f0d5 100644
--- a/mod/twitter/views/default/widgets/twitter/edit.php
+++ b/mod/twitter/views/default/widgets/twitter/edit.php
@@ -7,20 +7,18 @@
*/
?>
-
-