Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pudge committed Dec 14, 2006
1 parent 3c8d99e commit db81b7c
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 11 deletions.
10 changes: 7 additions & 3 deletions plugins/Journal/templates/journaledit;journal;default
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,13 @@ __template__
submit_note = submit_note _ "<li>Anyone will be allowed to post comments</li>";
submit_note = submit_note _ "</ul>";
%]
[% sel_promotetype = form.promotetype || article.promotetype || "publish" %]
<input type="radio" name="promotetype" value="publicize" [% IF sel_promotetype == "publicize"; constants.markup_checked_attribute; END; %]> <b>Publicize</b>: Submit this as a story for [% constants.sitename %]<br>
[% IF article.promotetype != "publicize" %]
[% IF constants.plugin.FireHose;
sel_promotetype = form.promotetype || article.promotetype || "publish";
ELSE;
sel_promotetype = form.promotetype || article.promotetype || "publicize";
END %]
<input type="radio" name="promotetype" value="publicize" [% IF sel_promotetype == "publicize"; constants.markup_checked_attribute; END; %]> <b>Publicize</b>: Submit this story to be posted to the [% constants.sitename %] front page<br>
[% IF constants.plugin.FireHose && article.promotetype != "publicize" %]
<input type="radio" name="promotetype" value="publish" [% IF sel_promotetype == "publish"; constants.markup_checked_attribute; END; %]> <b>Publish</b>: Share this with other [% constants.sitename %] users<br>
[% END %]
[% IF article.promotetype != "publish" && article.promotetype != "publicize" %]
Expand Down
2 changes: 1 addition & 1 deletion plugins/Search/Search.pm
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ sub findJournalEntry {
my $query = $self->sqlQuote($form->{query});
my $columns;
$columns .= "users.nickname as nickname, journals.description as description, ";
$columns .= "journals.id as id, date, users.uid as uid, article";
$columns .= "journals.id as id, date, users.uid as uid, article, posttype, tid";
$columns .= ", TRUNCATE((( " . $self->_score('description', $form->{query}, $constants->{search_method}) . " + " . $self->_score('article', $form->{query}, $constants->{search_method}) .") / 2), 1) as score "
if $form->{query};
my $tables = "journals, journals_text, users";
Expand Down
28 changes: 21 additions & 7 deletions plugins/Search/search.pl
Original file line number Diff line number Diff line change
Expand Up @@ -569,21 +569,35 @@ sub journalSearch {
sub journalSearchRSS {
my($form, $constants, $slashdb, $searchDB, $gSkin) = @_;

my $user = getCurrentUser();
my $start = $form->{start} || 0;
my $entries = $searchDB->findJournalEntry($form, $start, 15, $form->{sort});

my @items;
for my $entry (@$entries) {
my $time = timeCalc($entry->{date});
push @items, {
title => "$entry->{description} ($time)",
time => $entry->{date},
creator => $entry->{nickname},
'link' => ($gSkin->{absolutedir} . '/~' . fixparam($entry->{nickname}) . '/journal/' . $entry->{id}),
description => $constants->{article},
story => {
'time' => $entry->{date},
uid => $entry->{uid},
tid => $entry->{tid},
},
title => "$entry->{description} ($time)",
'link' => ($gSkin->{absolutedir} . '/~' . fixparam($entry->{nickname}) . '/journal/' . $entry->{id}),
description => balanceTags(strip_mode($entry->{article}, $entry->{posttype}), { deep_nesting => 1 }),
};
}

my $rss_html = $constants->{journal_rdfitemdesc_html} && (
$user->{is_admin}
||
($constants->{journal_rdfitemdesc_html} == 1)
||
($constants->{journal_rdfitemdesc_html} > 1 && ($user->{is_subscriber}))
||
($constants->{journal_rdfitemdesc_html} > 2 && !$user->{is_anon})
);

xmlDisplay($form->{content_type} => {
channel => {
title => "$constants->{sitename} Journal Search",
Expand All @@ -592,8 +606,8 @@ sub journalSearchRSS {
},
image => 1,
items => \@items,
rdfitemdesc => $constants->{search_rdfitemdesc},
rdfitemdesc_html => $constants->{search_rdfitemdesc_html},
rdfitemdesc => $constants->{journal_rdfitemdesc},
rdfitemdesc_html => $rss_html,
});
}

Expand Down

0 comments on commit db81b7c

Please sign in to comment.