Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Use Firehose for Marquee

  • Loading branch information...
commit f2962091ba25b9b3031ebfdae2c6f8009dbdaaca 1 parent a864d8d
@tvroom tvroom authored
View
20 plugins/Users2/Users2.pm
@@ -313,6 +313,26 @@ sub getMarquee {
return $latest_thing;
}
+sub getFireHoseMarquee {
+ my ($self, $uid) = @_;
+ my $fh = getObject("Slash::FireHose");
+
+ my $fhe_opts = {
+ type => ['journal','submission','comment'],
+ orderby => 'createtime',
+ orderdir => 'DESC',
+ color => 'black',
+ duration => '-1',
+ limit => 1,
+ uid => $uid
+ };
+
+ my($items, $results, $count, $future_count, $day_num, $day_label, $day_count) = $fh->getFireHoseEssentials($fhe_opts);
+
+ return @$items >=1 ? $items->[0]: 0;
+}
+
+
sub getMarqueeFireHoseId {
my($self, $marquee) = @_;
my $fhid;
View
27 themes/slashcode/htdocs/users2.pl
@@ -1177,15 +1177,21 @@ sub showInfo {
# Set up default view (remove marquee for subsections)
my $main_view = 0;
- my $marquee;
+ my $marquee;
+ my $firehose_marquee;
my $not_fhid;
- if ((!$form->{dp}) || ($form->{dp} eq 'admin' && !$user->{is_admin})) {
- $main_view = 1;
- $form->{dp} = 'firehose';
+ if ((!$form->{dp}) || ($form->{dp} eq 'admin' && !$user->{is_admin})) {
+ $main_view = 1;
+ $form->{dp} = 'firehose';
# Marquee is the "latest thing"
$marquee = $users2->getMarquee($latest_comments, $latest_journals, $latest_submissions);
+ $firehose_marquee = $users2->getFireHoseMarquee($requested_user->{uid});
#$marquee = $users2->truncateMarquee($marquee);
- $not_fhid = $users2->getMarqueeFireHoseId($marquee);
+ if ($firehose_marquee) {
+ $not_fhid = $firehose_marquee->{id};
+ } else {
+ $not_fhid = $users2->getMarqueeFireHoseId($marquee);
+ }
}
if ($main_view || $form->{dp} eq 'firehose' || $form->{dp} =~ /^journal/ || $form->{dp} eq 'submissions' || $form->{dp} eq 'bookmarks' || $form->{dp} eq 'usertag') {
@@ -1216,11 +1222,12 @@ sub showInfo {
subcount => $subcount,
metamods => $metamods,
tagshist => $tagshist,
- latest_comments => $latest_comments,
- latest_journals => $latest_journals,
- latest_submissions => $latest_submissions,
- latest_bookmarks => $latest_bookmarks,
- latest_friends => $latest_friends,
+ latest_comments => $latest_comments,
+ latest_journals => $latest_journals,
+ latest_submissions => $latest_submissions,
+ latest_bookmarks => $latest_bookmarks,
+ latest_friends => $latest_friends,
+ firehose_marquee => $firehose_marquee,
marquee => $marquee,
relations_datapane => $relations_datapane,
tags_datapane => $tags_datapane,
View
54 themes/slashcode/templates/u2MainView;users;default
@@ -20,31 +20,43 @@ __template__
[% PROCESS u2UserBio useredit=useredit %]
</div>
- <div class="article" id="marquee_content">
- [% IF !marquee.body %]
+ [% IF firehose_marquee.defined %]
+ [% IF firehose_marquee && firehose_marquee.id %]
+ [% fh = Slash.getObject("Slash::FireHose") %]
+ [% item = fh.getFireHose(firehose_marquee.id) %]
+ [% fh.dispFireHose(item, { mode => 'full', featured => 1}) %]
+
+ [% ELSE %]
<h3>[% useredit.nickname | strip_literal %] doesn't seem to be particularly active.</h3>
+ [% END %]
[% ELSE %]
- <h3>[% marquee.subject %]</h3>
- <div class="body">
- [% marquee.body %]
- [% IF marquee.truncated %]&nbsp;...<p>[% END %]
+ <div class="article" id="marquee_content">
+ [% IF !marquee.body %]
+ <h3>[% useredit.nickname | strip_literal %] doesn't seem to be particularly active.</h3>
+ [% ELSE %]
+ <h3>[% marquee.subject %]</h3>
+ <div class="body">
+ [% marquee.body %]
+ [% IF marquee.truncated %]&nbsp;...<p>[% END %]
+ </div>
+ [% END %]
+
+
+ [%
+ '<br><a href="';
+
+ IF marquee.type == 'journal';
+ constants.real_rootdir; '/~'; useredit.nickname | strip_paramattr; '/journal/'; marquee.id;
+ ELSIF marquee.type == 'submission';
+ gSkin.rootdir; '/firehose.pl?op=view&id='; marquee.id;
+ ELSIF marquee.type == 'comment';
+ gSkin.rootdir; '/comments.pl?sid='; marquee.sid; '&cid='; marquee.id;
+ END;
+
+ '">Read More</a>';
+ %]
</div>
[% END %]
-
- [%
- '<br><a href="';
-
- IF marquee.type == 'journal';
- constants.real_rootdir; '/~'; useredit.nickname | strip_paramattr; '/journal/'; marquee.id;
- ELSIF marquee.type == 'submission';
- gSkin.rootdir; '/firehose.pl?op=view&id='; marquee.id;
- ELSIF marquee.type == 'comment';
- gSkin.rootdir; '/comments.pl?sid='; marquee.sid; '&cid='; marquee.id;
- END;
-
- '">Read More</a>';
- %]
- </div>
</div>
[% END %]
Please sign in to comment.
Something went wrong with that request. Please try again.