##2362 twitter

This commit is contained in:
sebastian 2010-02-15 19:26:31 +00:00
parent 6d0b9ca5bf
commit 7c5aef870b
2 changed files with 42 additions and 12 deletions

View File

@ -413,7 +413,7 @@ if ($uiBrowser->userid) {
case "twitter.settings": case "twitter.settings":
$Smarty->assign('dynform', $uiBrowser->TWITTER->getSettingsForm()); $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); $Smarty->assign('act', $action);
break; break;
} }

View File

@ -15,6 +15,16 @@ class uiTwitter {
'type' => 'hidden', 'type' => 'hidden',
'constant' => 'twitter.saveSettings' 'constant' => 'twitter.saveSettings'
), ),
array(
'element' => 'twitter-account-fieldset-open',
'type' => 'static',
'text' => '<fieldset style="width: 300px;">'
),
array(
'element' => 'twitter-account-label',
'type' => 'static',
'text' => '<legend style="font-weight: bold;">Twitter info</legend>'
),
array( array(
'element' => 'twitter-is_active', 'element' => 'twitter-is_active',
'type' => 'checkbox', 'type' => 'checkbox',
@ -44,6 +54,21 @@ class uiTwitter {
'element' => array('twitter-password','twitter-password2'), 'element' => array('twitter-password','twitter-password2'),
'rulemsg' => 'The passwords do not match.' 'rulemsg' => 'The passwords do not match.'
), ),
array(
'element' => 'twitter-account-fieldset-close',
'type' => 'static',
'text' => '</fieldset>'
),
array(
'element' => 'twitter-config-fieldset-open',
'type' => 'static',
'text' => '<fieldset style="width: 300px;">'
),
array(
'element' => 'twitter-config-label',
'type' => 'static',
'text' => '<legend style="font-weight: bold;">Tweet configuration</legend>'
),
array( array(
'element' => 'twitter-prefix', 'element' => 'twitter-prefix',
'type' => 'text', 'type' => 'text',
@ -117,6 +142,11 @@ class uiTwitter {
), ),
'isPref' => true 'isPref' => true
), ),
array(
'element' => 'twitter-config-fieldset-close',
'type' => 'static',
'text' => '</fieldset>'
),
array( array(
'element' => 'Submit', 'element' => 'Submit',
'type' => 'submit', 'type' => 'submit',
@ -198,23 +228,23 @@ class uiTwitter {
$this->Base->_retMsg('Twitter settings saved.'); $this->Base->_retMsg('Twitter settings saved.');
} }
public function getFeed($p_withSample = false) public function getFeed($p_useSampledata = false)
{ {
$settings = $this->getSettings(); $settings = $this->getSettings();
$whatsplaying = $this->getWhatsplaying($settings['twitter-offset']);
if (!$p_withSample && !$whatsplaying) { if ($p_useSampledata) {
return; $whatsplaying = array(
}
$whatsplaying = @array_merge(
array(
"tracktitle" => "Gimme Shelter", "tracktitle" => "Gimme Shelter",
"trackartist" => "The Rolling Stones", "trackartist" => "The Rolling Stones",
"playlisttitle" => "The Blues Hour" "playlisttitle" => "The Blues Hour"
), );
$whatsplaying } else {
); $whatsplaying = $this->getWhatsplaying($settings['twitter-offset']);
}
if (!$whatsplaying) {
return;
}
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
// create twitter tweet sample // create twitter tweet sample