aboutsummaryrefslogtreecommitdiffstats
path: root/mod/dreport.php
diff options
context:
space:
mode:
authormrjive <mrjive@mrjive.it>2015-09-22 13:11:54 +0200
committermrjive <mrjive@mrjive.it>2015-09-22 13:11:54 +0200
commit5ec3d3e36d8bb7918b844b4ebbeb878c4b45e30d (patch)
treeece0274497ae0f3bc427cfa6e8f10752dd9934dc /mod/dreport.php
parent49d11ed9f88531bcd03f2f129230b0352014c22c (diff)
parent4b13f0e025b08263d7231845bc76034d9adc7847 (diff)
downloadvolse-hubzilla-5ec3d3e36d8bb7918b844b4ebbeb878c4b45e30d.tar.gz
volse-hubzilla-5ec3d3e36d8bb7918b844b4ebbeb878c4b45e30d.tar.bz2
volse-hubzilla-5ec3d3e36d8bb7918b844b4ebbeb878c4b45e30d.zip
Merge pull request #3 from redmatrix/master
updating from original codebase
Diffstat (limited to 'mod/dreport.php')
-rw-r--r--mod/dreport.php43
1 files changed, 43 insertions, 0 deletions
diff --git a/mod/dreport.php b/mod/dreport.php
new file mode 100644
index 000000000..a20e17372
--- /dev/null
+++ b/mod/dreport.php
@@ -0,0 +1,43 @@
+<?php
+
+function dreport_content(&$a) {
+
+ if(! local_channel()) {
+ notice( t('Permission denied') . EOL);
+ return;
+ }
+
+ $channel = $a->get_channel();
+
+ $mid = ((argc() > 1) ? argv(1) : '');
+
+ if(! $mid) {
+ notice( t('Invalid message') . EOL);
+ return;
+ }
+
+ $r = q("select * from dreport where dreport_xchan = '%s' and dreport_mid = '%s'",
+ dbesc($channel['channel_hash']),
+ dbesc($mid)
+ );
+
+ if(! $r) {
+ notice( t('no results') . EOL);
+ return;
+ }
+
+
+ $o .= '<h2>' . sprintf( t('Delivery report for %1$s'),substr($mid,0,32)) . '...' . '</h2>';
+ $o .= '<table>';
+
+ foreach($r as $rr) {
+ $name = escape_tags(substr($rr['dreport_recip'],strpos($rr['dreport_recip'],' ')));
+ $o .= '<tr><td>' . $name . '</td><td>' . escape_tags($rr['dreport_result']) . '</td><td>' . escape_tags($rr['dreport_time']) . '</td></tr>';
+ }
+ $o .= '</table>';
+
+ return $o;
+
+
+
+} \ No newline at end of file