##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":
$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;
}

View File

@ -15,6 +15,16 @@ class uiTwitter {
'type' => 'hidden',
'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(
'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' => '</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(
'element' => 'twitter-prefix',
'type' => 'text',
@ -117,6 +142,11 @@ class uiTwitter {
),
'isPref' => true
),
array(
'element' => 'twitter-config-fieldset-close',
'type' => 'static',
'text' => '</fieldset>'
),
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