Skip to content

Commit

Permalink
history plugin: Convert getHistoryEntries() link markup to HTML list
Browse files Browse the repository at this point in the history
  • Loading branch information
ophian committed Jan 6, 2024
1 parent f0b7fb7 commit 9ae123a
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions plugins/serendipity_plugin_history/serendipity_plugin_history.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function introspect(&$propbag)
$propbag->add('description', PLUGIN_HISTORY_DESC);
$propbag->add('stackable', true);
$propbag->add('author', 'Jannis Hermanns, Ian Styx');
$propbag->add('version', '1.42');
$propbag->add('version', '1.43');
$propbag->add('requirements', array(
'serendipity' => '2.0',
'smarty' => '3.1',
Expand Down Expand Up @@ -197,6 +197,9 @@ function getHistoryEntries($maxts, $mints, $max_age, $min_age, $full, $max_entri
$fmrch = date('md', $nowts) == '0301'; // 1st of march day ? true : false, which is the first day of "static" year rest days

echo empty($intro) ? '' : '<div class="serendipity_history_intro">' . $intro . "</div>\n";
if (!$full) {
echo '<ul class="plainList">'."\n";
}

for($x=0; $x < $ect; $x++) {
// in leap years exclude 1st of March entries, in normal years exclude leap day entries
Expand All @@ -212,21 +215,28 @@ function getHistoryEntries($maxts, $mints, $max_age, $min_age, $full, $max_entri
$date = !$displaydate ? '' : serendipity_strftime($dateformat, $e[$x]['timestamp']);
$author = $displayauthor ? $e[$x]['author'] . ': ' : '';

echo '<div class="serendipity_history_info">'."\n";

if ($full) {
echo '<div class="serendipity_history_info">'."\n";
}
if ($displayauthor) {
echo ' <span class="serendipity_history_author">' . $author . "</span> ";
echo ' <span class="serendipity_history_author">' . $author . "</span>\n";
}
if (!$full) {
echo "<li>\n";
}
if ($displaydate) {
echo ' <span class="serendipity_history_date">' . $date . "</span> ";
echo ' <span class="serendipity_history_date">' . $date . "</span>\n";
}
$t = ($maxlength == 0 || (strlen($e[$x]['title']) <= $maxlength))
? $e[$x]['title']
: trim(serendipity_mb('substr', $e[$x]['title'], 0, $maxlength-3)).' [...]';
echo ' <a href="' . $url . '" title="' . str_replace("'", "`", serendipity_specialchars($e[$x]['title'])) . '">' . serendipity_specialchars($t) . "</a>\n";
echo "</div>\n";
if ($full) {
echo "</div>\n";
echo '<div class="serendipity_history_body">' . strip_tags($e[$x]['body']) . "</div>\n";
} else {
echo "</li>\n";
}
}

Expand Down

0 comments on commit 9ae123a

Please sign in to comment.