From 7c5aef870ba2541158b9bfdf61b36c6a341bcb33 Mon Sep 17 00:00:00 2001 From: sebastian Date: Mon, 15 Feb 2010 19:26:31 +0000 Subject: [PATCH] ##2362 twitter --- .../modules/htmlUI/var/html/ui_browser.php | 2 +- .../modules/htmlUI/var/ui_twitter.class.php | 52 +++++++++++++++---- 2 files changed, 42 insertions(+), 12 deletions(-) diff --git a/campcaster/src/modules/htmlUI/var/html/ui_browser.php b/campcaster/src/modules/htmlUI/var/html/ui_browser.php index 9097aeda7..207899273 100644 --- a/campcaster/src/modules/htmlUI/var/html/ui_browser.php +++ b/campcaster/src/modules/htmlUI/var/html/ui_browser.php @@ -413,7 +413,7 @@ if ($uiBrowser->userid) { case "twitter.settings": $Smarty->assign('dynform', $uiBrowser->TWITTER->getSettingsForm()); - $Smarty->assign('twitter', array('samplefeed' => $uiBrowser->TWITTER->getFeed())); + $Smarty->assign('twitter', array('samplefeed' => $uiBrowser->TWITTER->getFeed(true))); $Smarty->assign('act', $action); break; } diff --git a/campcaster/src/modules/htmlUI/var/ui_twitter.class.php b/campcaster/src/modules/htmlUI/var/ui_twitter.class.php index 04bc4af69..833cbccd8 100644 --- a/campcaster/src/modules/htmlUI/var/ui_twitter.class.php +++ b/campcaster/src/modules/htmlUI/var/ui_twitter.class.php @@ -15,6 +15,16 @@ class uiTwitter { 'type' => 'hidden', 'constant' => 'twitter.saveSettings' ), + array( + 'element' => 'twitter-account-fieldset-open', + 'type' => 'static', + 'text' => '
' + ), + array( + 'element' => 'twitter-account-label', + 'type' => 'static', + 'text' => 'Twitter info' + ), array( 'element' => 'twitter-is_active', 'type' => 'checkbox', @@ -44,6 +54,21 @@ class uiTwitter { 'element' => array('twitter-password','twitter-password2'), 'rulemsg' => 'The passwords do not match.' ), + array( + 'element' => 'twitter-account-fieldset-close', + 'type' => 'static', + 'text' => '
' + ), + array( + 'element' => 'twitter-config-fieldset-open', + 'type' => 'static', + 'text' => '
' + ), + array( + 'element' => 'twitter-config-label', + 'type' => 'static', + 'text' => 'Tweet configuration' + ), array( 'element' => 'twitter-prefix', 'type' => 'text', @@ -117,6 +142,11 @@ class uiTwitter { ), 'isPref' => true ), + array( + 'element' => 'twitter-config-fieldset-close', + 'type' => 'static', + 'text' => '
' + ), array( 'element' => 'Submit', 'type' => 'submit', @@ -198,23 +228,23 @@ class uiTwitter { $this->Base->_retMsg('Twitter settings saved.'); } - public function getFeed($p_withSample = false) + public function getFeed($p_useSampledata = false) { $settings = $this->getSettings(); - $whatsplaying = $this->getWhatsplaying($settings['twitter-offset']); - if (!$p_withSample && !$whatsplaying) { - return; - } - - $whatsplaying = @array_merge( - array( + if ($p_useSampledata) { + $whatsplaying = array( "tracktitle" => "Gimme Shelter", "trackartist" => "The Rolling Stones", "playlisttitle" => "The Blues Hour" - ), - $whatsplaying - ); + ); + } else { + $whatsplaying = $this->getWhatsplaying($settings['twitter-offset']); + } + + if (!$whatsplaying) { + return; + } //////////////////////////////////////////////////////////////////////// // create twitter tweet sample