aboutsummaryrefslogtreecommitdiffstats
path: root/include/text.php
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2020-02-09 16:32:18 -0800
committerzotlabs <mike@macgirvin.com>2020-02-09 16:32:18 -0800
commitbbcb237f5b996e94af37611152105b2e965ea493 (patch)
tree042ea69cfc8eb90f0588b9c71edb8e4ef164390b /include/text.php
parentfc9e6d289acf30f89da0051a90cbf16f0bc006fb (diff)
downloadvolse-hubzilla-bbcb237f5b996e94af37611152105b2e965ea493.tar.gz
volse-hubzilla-bbcb237f5b996e94af37611152105b2e965ea493.tar.bz2
volse-hubzilla-bbcb237f5b996e94af37611152105b2e965ea493.zip
poll updates
Diffstat (limited to 'include/text.php')
-rw-r--r--include/text.php13
1 files changed, 12 insertions, 1 deletions
diff --git a/include/text.php b/include/text.php
index caecae33e..992b455c8 100644
--- a/include/text.php
+++ b/include/text.php
@@ -1880,6 +1880,17 @@ function format_poll($item,$s,$opts) {
}
}
}
+ if ($item['comments_closed'] > NULL_DATE) {
+ $t = datetime_convert('UTC',date_default_timezone_get(), $item['comments_closed'], 'Y-m-d h:i');
+ $closed = ((datetime_convert() > $item['comments_closed']) ? true : false);
+ if ($closed) {
+ $message = t('Poll has ended.');
+ }
+ else {
+ $message = sprintf(t('Poll ends: %s'),$t);
+ }
+ $output .= EOL . '<div>' . $message . '</div>';
+ }
if ($activated and $commentable) {
$output .= EOL . '<input type="button" class="btn btn-std btn-success" name="vote" value="vote" onclick="submitPoll(' . $item['id'] . '); return false;">'. '</form>';
}
@@ -3721,7 +3732,7 @@ function array_path_exists($str,$arr) {
if($search) {
foreach($search as $s) {
- if(array_key_exists($s,$ptr)) {
+ if($ptr && array_key_exists($s,$ptr)) {
$ptr = $ptr[$s];
}
else {