trac626 Put a list of feed links
darcs-hash:20081114210506-eefa4-ba7e9bdd794ddfcacc397d732073abf99e97f3a5.gz
This commit is contained in:
parent
577b54c2af
commit
67f3c1a8d4
|
@ -69,6 +69,11 @@ class AllAction extends StreamAction {
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->views_menu();
|
$this->views_menu();
|
||||||
|
|
||||||
|
$this->show_feeds_list(array(0=>array('href'=>common_local_url('allrss', array('nickname' => $user->nickname)),
|
||||||
|
'type' => 'rss',
|
||||||
|
'version' => 'RSS 1.0',
|
||||||
|
'item' => 'allrss')));
|
||||||
}
|
}
|
||||||
|
|
||||||
function show_notices($user) {
|
function show_notices($user) {
|
||||||
|
|
|
@ -73,6 +73,11 @@ class RepliesAction extends StreamAction {
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->views_menu();
|
$this->views_menu();
|
||||||
|
|
||||||
|
$this->show_feeds_list(array(0=>array('href'=>common_local_url('repliesrss', array('nickname' => $user->nickname)),
|
||||||
|
'type' => 'rss',
|
||||||
|
'version' => 'RSS 1.0',
|
||||||
|
'item' => 'repliesrss')));
|
||||||
}
|
}
|
||||||
|
|
||||||
function show_replies($user) {
|
function show_replies($user) {
|
||||||
|
|
|
@ -68,6 +68,10 @@ class ShowfavoritesAction extends StreamAction {
|
||||||
common_notice_form('all');
|
common_notice_form('all');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->show_feeds_list(array(0=>array('href'=>common_local_url('favoritesrss', array('nickname' => $user->nickname)),
|
||||||
|
'type' => 'rss',
|
||||||
|
'version' => 'RSS 1.0',
|
||||||
|
'item' => 'Favorites')));
|
||||||
$this->views_menu();
|
$this->views_menu();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -72,8 +72,25 @@ class ShowstreamAction extends StreamAction {
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->views_menu();
|
$this->views_menu();
|
||||||
|
|
||||||
|
$this->show_feeds_list(array(0=>array('href'=>common_local_url('userrss', array('nickname' => $user->nickname)),
|
||||||
|
'type' => 'rss',
|
||||||
|
'version' => 'RSS 1.0',
|
||||||
|
'item' => 'notices'),
|
||||||
|
1=>array('href'=>common_local_url('usertimeline', array('nickname' => $user->nickname)),
|
||||||
|
'type' => 'atom',
|
||||||
|
'version' => 'Atom 1.0',
|
||||||
|
'item' => 'usertimeline'),
|
||||||
|
|
||||||
|
2=>array('href'=>common_local_url('foaf',array('nickname' => $user->nickname)),
|
||||||
|
'type' => 'rdf',
|
||||||
|
'version' => 'FOAF',
|
||||||
|
'item' => 'foaf')));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function show_header($user) {
|
function show_header($user) {
|
||||||
# Feeds
|
# Feeds
|
||||||
common_element('link', array('rel' => 'alternate',
|
common_element('link', array('rel' => 'alternate',
|
||||||
|
|
|
@ -85,6 +85,74 @@ class PersonalAction extends Action {
|
||||||
common_element_end('ul');
|
common_element_end('ul');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function show_feeds_list($feeds) {
|
||||||
|
common_element_start('div', array('class' => 'feeds'));
|
||||||
|
common_element('p', null, 'Feeds:');
|
||||||
|
common_element_start('ul', array('class' => 'xoxo'));
|
||||||
|
|
||||||
|
foreach ($feeds as $key => $value) {
|
||||||
|
$this->common_feed_item($feeds[$key]);
|
||||||
|
}
|
||||||
|
common_element_end('ul');
|
||||||
|
common_element_end('div');
|
||||||
|
}
|
||||||
|
|
||||||
|
function common_feed_item($feed) {
|
||||||
|
$nickname = $this->trimmed('nickname');
|
||||||
|
|
||||||
|
switch($feed['item']) {
|
||||||
|
case 'notices': default:
|
||||||
|
$feed_classname = $feed['type'];
|
||||||
|
$feed_mimetype = "application/".$feed['type']."+xml";
|
||||||
|
$feed_title = "$nickname's ".$feed['version']." notice feed";
|
||||||
|
$feed['textContent'] = "RSS";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'allrss':
|
||||||
|
$feed_classname = $feed['type'];
|
||||||
|
$feed_mimetype = "application/".$feed['type']."+xml";
|
||||||
|
$feed_title = $feed['version']." feed for $nickname and friends";
|
||||||
|
$feed['textContent'] = "RSS";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'repliesrss':
|
||||||
|
$feed_classname = $feed['type'];
|
||||||
|
$feed_mimetype = "application/".$feed['type']."+xml";
|
||||||
|
$feed_title = $feed['version']." feed for replies to $nickname";
|
||||||
|
$feed['textContent'] = "RSS";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'foaf':
|
||||||
|
$feed_classname = "foaf";
|
||||||
|
$feed_mimetype = "application/".$feed['type']."+xml";
|
||||||
|
$feed_title = "$nickname's FOAF file";
|
||||||
|
$feed['textContent'] = "FOAF";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'favoritesrss':
|
||||||
|
$feed_classname = "favorites";
|
||||||
|
$feed_mimetype = "application/".$feed['type']."+xml";
|
||||||
|
$feed_title = "Feed for favorites of $nickname";
|
||||||
|
$feed['textContent'] = "RSS";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'usertimeline':
|
||||||
|
$feed_classname = "atom";
|
||||||
|
$feed_mimetype = "application/".$feed['type']."+xml";
|
||||||
|
$feed_title = "$nickname's ".$feed['version']." notice feed";
|
||||||
|
$feed['textContent'] = "Atom";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
common_element_start('li');
|
||||||
|
common_element('a', array('href' => $feed['href'],
|
||||||
|
'class' => $feed_classname,
|
||||||
|
'type' => $feed_mimetype,
|
||||||
|
'title' => $feed_title),
|
||||||
|
$feed['textContent']);
|
||||||
|
common_element_end('li');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function source_link($source) {
|
function source_link($source) {
|
||||||
$source_name = _($source);
|
$source_name = _($source);
|
||||||
switch ($source) {
|
switch ($source) {
|
||||||
|
|
|
@ -1029,6 +1029,9 @@ function common_fancy_url($action, $args=NULL) {
|
||||||
} else {
|
} else {
|
||||||
return common_path($args['nickname']);
|
return common_path($args['nickname']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case 'usertimeline':
|
||||||
|
return common_path("api/statuses/user_timeline/".$args['nickname']."atom");
|
||||||
case 'confirmaddress':
|
case 'confirmaddress':
|
||||||
return common_path('main/confirmaddress/'.$args['code']);
|
return common_path('main/confirmaddress/'.$args['code']);
|
||||||
case 'userbyid':
|
case 'userbyid':
|
||||||
|
|
|
@ -138,6 +138,37 @@ p#branding a {
|
||||||
border-right: 1px solid #dcaa3f;
|
border-right: 1px solid #dcaa3f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.feeds {
|
||||||
|
clear:both;
|
||||||
|
float:right;
|
||||||
|
margin-top:1.25em;
|
||||||
|
position:absolute;
|
||||||
|
right:0;
|
||||||
|
bottom:-30px;
|
||||||
|
}
|
||||||
|
.feeds * {
|
||||||
|
line-height:1.4;
|
||||||
|
padding:0;
|
||||||
|
margin:0;
|
||||||
|
font-size:12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.feeds p {
|
||||||
|
font-weight:bold;
|
||||||
|
display:inline;
|
||||||
|
display:none;
|
||||||
|
}
|
||||||
|
.feeds ul {
|
||||||
|
display:inline;
|
||||||
|
}
|
||||||
|
.feeds li {
|
||||||
|
list-style-type:none;
|
||||||
|
display:inline;
|
||||||
|
margin-left:0.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* ----- Nav Footer ----- */
|
/* ----- Nav Footer ----- */
|
||||||
#nav_sub {
|
#nav_sub {
|
||||||
clear: both;
|
clear: both;
|
||||||
|
|
BIN
theme/identica/icon_foaf.gif
Normal file
BIN
theme/identica/icon_foaf.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
BIN
theme/identica/icon_rss.png
Normal file
BIN
theme/identica/icon_rss.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 781 B |
Loading…
Reference in New Issue
Block a user