aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Widget
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2022-09-07 12:50:46 +0000
committerMario <mario@mariovavti.com>2022-09-07 12:50:46 +0000
commitfcfb9e975836c4abbbfd339d46bf8ea937747e57 (patch)
treebbe6a8f19831eba6f9488c8e26687362870e0021 /Zotlabs/Widget
parent9beee689ce5537d0b64f20ccfe461eeb7c41ffa8 (diff)
downloadvolse-hubzilla-fcfb9e975836c4abbbfd339d46bf8ea937747e57.tar.gz
volse-hubzilla-fcfb9e975836c4abbbfd339d46bf8ea937747e57.tar.bz2
volse-hubzilla-fcfb9e975836c4abbbfd339d46bf8ea937747e57.zip
fix random php warnings
Diffstat (limited to 'Zotlabs/Widget')
-rw-r--r--Zotlabs/Widget/Channel_activities.php2
-rw-r--r--Zotlabs/Widget/Messages.php17
2 files changed, 8 insertions, 11 deletions
diff --git a/Zotlabs/Widget/Channel_activities.php b/Zotlabs/Widget/Channel_activities.php
index 47aa971a2..9acde591d 100644
--- a/Zotlabs/Widget/Channel_activities.php
+++ b/Zotlabs/Widget/Channel_activities.php
@@ -25,7 +25,7 @@ class Channel_activities {
self::$uid = local_channel();
self::$channel = App::get_channel();
- $o .= '<div id="channel-activities" class="d-none overflow-hidden">';
+ $o = '<div id="channel-activities" class="d-none overflow-hidden">';
$o .= '<h2 class="mb-4">Welcome ' . self::$channel['channel_name'] . '!</h2>';
//$o .= 'Last login date: ' . get_pconfig(self::$uid, 'system', 'stored_login_date') . ' from ' . get_pconfig(self::$uid, 'system', 'stored_login_addr');
diff --git a/Zotlabs/Widget/Messages.php b/Zotlabs/Widget/Messages.php
index 3d9ed8955..66b371c8e 100644
--- a/Zotlabs/Widget/Messages.php
+++ b/Zotlabs/Widget/Messages.php
@@ -45,11 +45,14 @@ class Messages {
if (!local_channel())
return;
- if (isset($options['offset']) && $options['offset'] == -1) {
+ $offset = $options['offset'] ?? 0;
+ $type = $options['type'] ?? 'default';
+
+ if ($offset == -1) {
return;
}
- if (isset($options['type']) && $options['type'] == 'notification') {
+ if ($type == 'notification') {
return self::get_notices_page($options);
}
@@ -58,15 +61,9 @@ class Messages {
$entries = [];
$limit = 30;
$dummy_order_sql = '';
-
- $offset = 0;
- if ($options['offset']) {
- $offset = intval($options['offset']);
- }
-
$loadtime = (($offset) ? $_SESSION['messages_loadtime'] : datetime_convert());
- switch($options['type']) {
+ switch($type) {
case 'direct':
$type_sql = ' AND item_private = 2 ';
// $dummy_order_sql has no other meaning but to trick
@@ -99,7 +96,7 @@ class Messages {
foreach($items as $item) {
$info = '';
- if ($options['type'] == 'direct') {
+ if ($type == 'direct') {
$info .= self::get_dm_recipients($channel, $item);
}