Skip to content

Commit a875ad4

Browse files
committed
Merge pull request #18 from gn36/ticket/12
[ticket/12] Add snippet creation/deletion times to display
2 parents dafb412 + 1d75ee3 commit a875ad4

5 files changed

Lines changed: 12 additions & 1 deletion

File tree

controller/main.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ private function display_pb()
213213
'URL' => $this->helper->route('phpbbde_pastebin_main_controller', array('mode'=>'view', 's' => $row['snippet_id'])),
214214
'DESC' => $row['snippet_desc'],
215215
'TITLE' => $row['snippet_title'],
216+
'SNIPPET_TIME' => $this->user->format_date($row['snippet_time']),
216217
'TITLE_SHORT' => (utf8_strlen($row['snippet_title']) > 50) ? utf8_substr($row['snippet_title'], 0, 50) . '...' : $row['snippet_title'],
217218
'AUTHOR_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']),
218219
));
@@ -404,6 +405,8 @@ private function display_pb()
404405
'SNIPPET_TEXT_ORIG' => $snippet_text,
405406
'SNIPPET_TEXT_DISPLAY' => $snippet_text_display,
406407

408+
'SNIPPET_TIME' => $this->user->format_date($data['snippet_time']),
409+
'SNIPPET_PRUNE_ON' => $data['snippet_prunable'] ? $this->user->format_date($data['snippet_prune_on']) : $this->user->lang['NEVER'],
407410
'SNIPPET_DESC_V' => $data['snippet_desc'],
408411
'SNIPPET_TITLE_V' => $data['snippet_title'],
409412
'SNIPPET_AUTHOR' => $data['username'],

language/de/pastebin.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@
9292
'SNIPPET_MODERATED' => 'Das Snippet wurde erfolgreich bearbeitet.',
9393
'SNIPPET_TEXT' => 'Dein Code',
9494
'SNIPPET_TITLE' => 'Titel',
95+
'SNIPPET_CREATION_TIME' => 'Snippet erstellt',
96+
'SNIPPET_PRUNE_TIME' => 'Snippet wird automatisch gelöscht',
9597
'SNIPPET_PLAIN' => 'zeige einfaches Snippet',
9698
'SNIPPET_PRUNABLE' => 'Eintrag prunable - automatisch löschbar',
9799
'SNIPPET_PRUNABLE_EXPLAIN' => 'Wenn diese Option deaktiviert ist, wird der Eintrag nicht in die monatlich automatisch zu löschenden Einträge aufgenommen.',

language/en/pastebin.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@
8989
'SNIPPET_MODERATED' => 'The entry was sucessfully edited.',
9090
'SNIPPET_TEXT' => 'Your code',
9191
'SNIPPET_TITLE' => 'Title',
92+
'SNIPPET_CREATION_TIME' => 'Entry created on',
93+
'SNIPPET_PRUNE_TIME' => 'Entry will be automatically deleted',
9294
'SNIPPET_PLAIN' => 'Show simple entry.',
9395
'SNIPPET_PRUNABLE' => 'Entry prunable',
9496
'SNIPPET_PRUNABLE_EXPLAIN' => 'If this option is disabled, the entry will not be entered in the monthly list of prunable entries.',

styles/prosilver/template/pastebin_body.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ <h3>{L_LATEST_SNIPPETS}</h3>
6767
<!-- IF .latest_snippets -->
6868
<ul>
6969
<!-- BEGIN latest_snippets -->
70-
<li><a href="{latest_snippets.URL}" title="{latest_snippets.TITLE}<!-- IF latest_snippets.DESC -->: {latest_snippets.DESC}<!-- ENDIF -->">{latest_snippets.TITLE_SHORT}</a> ({latest_snippets.AUTHOR_FULL})</li>
70+
<li><a href="{latest_snippets.URL}" title="{latest_snippets.TITLE}<!-- IF latest_snippets.DESC -->: {latest_snippets.DESC}<!-- ENDIF -->">{latest_snippets.TITLE_SHORT}</a> ({latest_snippets.SNIPPET_TIME}, {latest_snippets.AUTHOR_FULL})</li>
7171
<!-- END latest_snippets -->
7272
</ul>
7373
<!-- ELSE -->

styles/prosilver/template/pastebin_view.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ <h3>{SNIPPET_TITLE_V}</h3>
44
<dl>
55
<dt><strong>{L_SNIPPET_DESC}:</strong></dt>
66
<dd>{SNIPPET_DESC_V}</dd>
7+
<dt><strong>{L_SNIPPET_CREATION_TIME}:</strong></dt>
8+
<dd>{SNIPPET_TIME}</dd>
9+
<dt><strong>{L_SNIPPET_PRUNE_TIME}:</strong></dt>
10+
<dd>{SNIPPET_PRUNE_ON}</dd>
711
</dl>
812
<br />
913
<!-- ENDIF -->

0 commit comments

Comments
 (0)