mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 17:21:39 +09:00
Fix warning in PHP 8.0
This commit is contained in:
parent
375a71866d
commit
faea821e78
9 changed files with 103 additions and 131 deletions
|
|
@ -818,29 +818,29 @@ class ModuleHandler extends Handler
|
|||
|
||||
// Set meta keywords.
|
||||
$module_config = ModuleModel::getModuleConfig('module');
|
||||
if ($module_info->meta_keywords ?? '')
|
||||
if (!empty($module_info->meta_keywords))
|
||||
{
|
||||
Context::addMetaTag('keywords', $module_info->meta_keywords);
|
||||
}
|
||||
elseif ($site_module_info->settings->meta_keywords)
|
||||
elseif (!empty($site_module_info->settings->meta_keywords))
|
||||
{
|
||||
Context::addMetaTag('keywords', $site_module_info->settings->meta_keywords);
|
||||
}
|
||||
elseif ($module_config->meta_keywords)
|
||||
elseif (!empty($module_config->meta_keywords))
|
||||
{
|
||||
Context::addMetaTag('keywords', $module_config->meta_keywords);
|
||||
}
|
||||
|
||||
// Set meta description.
|
||||
if ($module_info->meta_description ?? '')
|
||||
if (!empty($module_info->meta_description))
|
||||
{
|
||||
Context::addMetaTag('description', $module_info->meta_description);
|
||||
}
|
||||
elseif ($site_module_info->settings->meta_description)
|
||||
elseif (!empty($site_module_info->settings->meta_description))
|
||||
{
|
||||
Context::addMetaTag('description', $site_module_info->settings->meta_description);
|
||||
}
|
||||
elseif($module_config->meta_description)
|
||||
elseif (!empty($module_config->meta_description))
|
||||
{
|
||||
Context::addMetaTag('description', $module_config->meta_description);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -805,7 +805,7 @@ class Debug
|
|||
// Clean up the backtrace.
|
||||
foreach (array('entries', 'errors', 'queries', 'slow_queries', 'remote_requests', 'slow_remote_requests') as $key)
|
||||
{
|
||||
if (!$data->$key)
|
||||
if (!isset($data->$key) || !is_array($data->$key))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
|
@ -819,7 +819,10 @@ class Debug
|
|||
{
|
||||
foreach ($entry->backtrace as &$backtrace)
|
||||
{
|
||||
$backtrace['file'] = self::translateFilename($backtrace['file']);
|
||||
if (isset($backtrace['file']))
|
||||
{
|
||||
$backtrace['file'] = self::translateFilename($backtrace['file']);
|
||||
}
|
||||
unset($backtrace['object'], $backtrace['args']);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,7 +52,10 @@ Debug Entries
|
|||
echo sprintf('%02d. %s', ++$entry_count, $entry->message) . "\n";
|
||||
foreach ($entry->backtrace as $key => $backtrace)
|
||||
{
|
||||
echo sprintf(' - %s line %d', $backtrace['file'], $backtrace['line']) . "\n";
|
||||
if (isset($backtrace['file']) && isset($backtrace['line']))
|
||||
{
|
||||
echo sprintf(' - %s line %d', $backtrace['file'], $backtrace['line']) . "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -72,7 +75,10 @@ PHP Errors and Warnings
|
|||
echo sprintf('%02d. %s: %s', ++$error_count, $error->type, $error->message) . "\n";
|
||||
foreach ($error->backtrace as $key => $backtrace)
|
||||
{
|
||||
echo sprintf(' - %s line %d', $backtrace['file'], $backtrace['line']) . "\n";
|
||||
if (isset($backtrace['file']) && isset($backtrace['line']))
|
||||
{
|
||||
echo sprintf(' - %s line %d', $backtrace['file'], $backtrace['line']) . "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -45,16 +45,8 @@ class communicationAdminModel extends communication
|
|||
$oModuleModel = getModel('module');
|
||||
$skin_info = $oModuleModel->loadSkinInfo($this->module_path, $skin, $dir);
|
||||
Context::set('skin_info', $skin_info);
|
||||
|
||||
$oModuleModel = getModel('module');
|
||||
$communication_config = $oModuleModel->getModuleConfig('communication');
|
||||
if(!is_object($communication_config)) $communication_config = new stdClass;
|
||||
if(!$communication_config->colorset)
|
||||
{
|
||||
$communication_config->colorset = "white";
|
||||
}
|
||||
Context::set('communication_config', $communication_config);
|
||||
|
||||
Context::set('communication_config', CommunicationModel::getConfig());
|
||||
|
||||
$security = new Security();
|
||||
$security->encodeHTML('skin_info.colorset..title', 'skin_info.colorset..name');
|
||||
$security->encodeHTML('skin_info.colorset..name');
|
||||
|
|
|
|||
|
|
@ -30,42 +30,19 @@ class communicationModel extends communication
|
|||
{
|
||||
$config = new stdClass();
|
||||
}
|
||||
|
||||
if(!$config->skin)
|
||||
{
|
||||
$config->skin = 'default';
|
||||
}
|
||||
|
||||
if(!$config->colorset)
|
||||
{
|
||||
$config->colorset = 'white';
|
||||
}
|
||||
|
||||
if(!$config->editor_skin)
|
||||
{
|
||||
$config->editor_skin = 'ckeditor';
|
||||
}
|
||||
|
||||
if(!$config->mskin)
|
||||
{
|
||||
$config->mskin = 'default';
|
||||
}
|
||||
|
||||
if(!$config->grant_send)
|
||||
{
|
||||
$config->grant_send = array('default' => 'member');
|
||||
}
|
||||
|
||||
if(!$config->enable_message)
|
||||
{
|
||||
$config->enable_message = 'Y';
|
||||
}
|
||||
$config->enable_message = $config->enable_message ?? 'Y';
|
||||
$config->enable_friend = $config->enable_friend ?? 'Y';
|
||||
$config->enable_attachment = $config->enable_attachment ?? 'N';
|
||||
$config->editor_skin = $config->editor_skin ?? 'ckeditor';
|
||||
$config->layout_srl = $config->layout_srl ?? 0;
|
||||
$config->skin = $config->skin ?? 'default';
|
||||
$config->colorset = $config->colorset ?? 'white';
|
||||
$config->mlayout_srl = $config->mlayout_srl ?? 0;
|
||||
$config->mskin = $config->mskin ?? 'default';
|
||||
$config->mcolorset = $config->mcolorset ?? 'white';
|
||||
$config->grant_send = $config->grant_send ?? array('default' => 'member');
|
||||
|
||||
if(!$config->enable_friend)
|
||||
{
|
||||
$config->enable_friend = 'Y';
|
||||
}
|
||||
|
||||
return $config;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -849,14 +849,14 @@ class moduleAdminController extends module
|
|||
$lang_supported = Context::loadLangSelected();
|
||||
$defaultLang = config('locale.default_lang');
|
||||
|
||||
if(!isset($langMap[$defaultLang]) || !is_array($langMap[$defaultLang]))
|
||||
if(!isset($langMap[$defaultLang]))
|
||||
{
|
||||
$langMap[$defaultLang] = array();
|
||||
}
|
||||
|
||||
foreach($lang_supported as $langCode => $langName)
|
||||
{
|
||||
if(!is_array($langMap[$langCode]))
|
||||
if(!isset($langMap[$langCode]))
|
||||
{
|
||||
$langMap[$langCode] = array();
|
||||
}
|
||||
|
|
@ -869,7 +869,7 @@ class moduleAdminController extends module
|
|||
continue;
|
||||
}
|
||||
|
||||
if(!isset($langMap[$targetLangCode]) || !is_array($langMap[$targetLangCode]))
|
||||
if(!isset($langMap[$targetLangCode]))
|
||||
{
|
||||
$langMap[$targetLangCode] = array();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,71 +18,62 @@ class ncenterliteModel extends ncenterlite
|
|||
$config = new stdClass();
|
||||
}
|
||||
|
||||
if(!is_array($config->use))
|
||||
$config->use = $config->use ?? array('message' => array('web' => 1));
|
||||
$config->display_use = $config->display_use ?? 'all';
|
||||
$config->always_display = $config->always_display ?? 'N';
|
||||
$config->user_config_list = $config->user_config_list ?? 'N';
|
||||
$config->user_notify_setting = $config->user_notify_setting ?? 'N';
|
||||
$config->document_read = $config->document_read ?? 'Y';
|
||||
$config->variable_name = $config->variable_name ?? 0;
|
||||
$config->mention_names = $config->mention_names ?? 'nick_name';
|
||||
$config->mention_suffixes = $config->mention_suffixes ?? array('님', '様', 'さん', 'ちゃん');
|
||||
$config->mention_suffix_always_cut = $config->mention_suffix_always_cut ?? 'N';
|
||||
$config->mention_limit = $config->mention_limit ?? 20;
|
||||
$config->anonymous_voter = $config->anonymous_voter ?? 'N';
|
||||
$config->anonymous_scrap = $config->anonymous_scrap ?? 'N';
|
||||
$config->highlight_effect = $config->highlight_effect ?? 'Y';
|
||||
$config->unsubscribe = $config->unsubscribe ?? 'N';
|
||||
$config->comment_all = $config->comment_all ?? 'N';
|
||||
$config->comment_all_notify_module_srls = $config->comment_all_notify_module_srls ?? array();
|
||||
$config->hide_module_srls = $config->hide_module_srls ?? array();
|
||||
$config->admin_notify_module_srls = $config->admin_notify_module_srls ?? array();
|
||||
$config->layout_srl = $config->layout_srl ?? 0;
|
||||
$config->mlayout_srl = $config->mlayout_srl ?? 0;
|
||||
$config->skin = $config->skin ?? 'default';
|
||||
$config->colorset = $config->colorset ?? 'black';
|
||||
$config->mskin = $config->mskin ?? 'default';
|
||||
$config->mcolorset = $config->mcolorset ?? 'black';
|
||||
$config->zindex = $config->zindex ?? '9999';
|
||||
$config->notify_count = $config->notify_count ?? 5;
|
||||
|
||||
if(!isset($config->hide_module_srls))
|
||||
{
|
||||
if($config->use == 'Y')
|
||||
{
|
||||
$config->use = array();
|
||||
foreach (self::getNotifyTypes() as $type => $srl)
|
||||
{
|
||||
$config->use[$type] = array('web' => 1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$config->use = array('message' => array('web' => 1));
|
||||
}
|
||||
$config->hide_module_srls = array();
|
||||
}
|
||||
else
|
||||
elseif(!is_array($config->hide_module_srls))
|
||||
{
|
||||
if(count($config->use) && !is_array(array_first($config->use)))
|
||||
{
|
||||
foreach($config->use as $key => $value)
|
||||
{
|
||||
$config->use[$key] = array();
|
||||
$config->use[$key]['web'] = $value;
|
||||
}
|
||||
getController('module')->insertModuleConfig('ncenterlite', $config);
|
||||
}
|
||||
$config->hide_module_srls = explode('|@|', $config->hide_module_srls);
|
||||
}
|
||||
|
||||
if(!$config->display_use) $config->display_use = 'all';
|
||||
if(!$config->mention_names) $config->mention_names = 'nick_name';
|
||||
if(!$config->mention_suffixes)
|
||||
// Convert old config format
|
||||
if($config->use === 'Y')
|
||||
{
|
||||
$config->mention_suffixes = array('님', '様', 'さん', 'ちゃん');
|
||||
$config->use = array();
|
||||
foreach (self::getNotifyTypes() as $type => $srl)
|
||||
{
|
||||
$config->use[$type] = array('web' => 1);
|
||||
}
|
||||
}
|
||||
elseif(is_array($config->use) && !is_array(array_first($config->use)))
|
||||
{
|
||||
foreach($config->use as $key => $value)
|
||||
{
|
||||
$config->use[$key] = array();
|
||||
$config->use[$key]['web'] = $value;
|
||||
}
|
||||
getController('module')->insertModuleConfig('ncenterlite', $config);
|
||||
}
|
||||
unset($config->mention_format);
|
||||
if(!isset($config->mention_limit))
|
||||
{
|
||||
$config->mention_limit = 20;
|
||||
}
|
||||
if(!$config->hide_module_srls) $config->hide_module_srls = array();
|
||||
if(!is_array($config->hide_module_srls)) $config->hide_module_srls = explode('|@|', $config->hide_module_srls);
|
||||
if(!$config->document_read) $config->document_read = 'Y';
|
||||
if(!$config->skin) $config->skin = 'default';
|
||||
if(!$config->colorset) $config->colorset = 'black';
|
||||
if(!$config->zindex) $config->zindex = '9999';
|
||||
if(!$config->user_notify_setting)
|
||||
{
|
||||
$config->user_notify_setting = 'N';
|
||||
}
|
||||
if(!$config->anonymous_voter)
|
||||
{
|
||||
$config->anonymous_voter = 'N';
|
||||
}
|
||||
if(!$config->anonymous_scrap)
|
||||
{
|
||||
$config->anonymous_scrap = 'N';
|
||||
}
|
||||
if(!$config->highlight_effect)
|
||||
{
|
||||
$config->highlight_effect = 'Y';
|
||||
}
|
||||
if(!isset($config->notify_count) || !$config->notify_count)
|
||||
{
|
||||
$config->notify_count = 5;
|
||||
}
|
||||
|
||||
self::$_config = $config;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -291,7 +291,7 @@ class widgetController extends widget
|
|||
return $matches[0];
|
||||
}
|
||||
unset($vars->widget);
|
||||
|
||||
|
||||
return $this->execute($widget, $vars, $this->javascript_mode);
|
||||
}
|
||||
|
||||
|
|
@ -331,19 +331,16 @@ class widgetController extends widget
|
|||
{
|
||||
$buff = $matches[0][$i];
|
||||
$xml_doc = $oXmlParser->parse(trim($buff));
|
||||
|
||||
$args = $xml_doc->img->attrs;
|
||||
if(!$args) continue;
|
||||
// If you are not caching path
|
||||
$widget = $args->widget;
|
||||
$sequence = $args->widget_sequence;
|
||||
$cache = $args->widget_cache;
|
||||
if(!$cache) continue;
|
||||
if(!$sequence)
|
||||
if(!$args || !$widget || empty($args->widget_cache))
|
||||
{
|
||||
$sequence = sha1(json_encode($args));
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
$args->widget_sequence = $args->widget_sequence ?? 0;
|
||||
$args->colorset = $args->colorset ?? null;
|
||||
|
||||
foreach($args as $k => $v)
|
||||
{
|
||||
$args->{$k} = urldecode($v);
|
||||
|
|
@ -351,7 +348,7 @@ class widgetController extends widget
|
|||
|
||||
foreach($lang_list as $lang_type => $val)
|
||||
{
|
||||
$this->getCache($widget, $args, $lang_type, true, $sequence);
|
||||
$this->getCache($widget, $args, $lang_type, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -368,7 +365,7 @@ class widgetController extends widget
|
|||
}
|
||||
|
||||
// Fix the widget sequence if it is missing
|
||||
$widget_sequence = $override_sequence ?: ($args->widget_sequence ?? 0);
|
||||
$widget_sequence = $override_sequence ?: $args->widget_sequence;
|
||||
if (!$widget_sequence)
|
||||
{
|
||||
$widget_sequence = sha1(json_encode($args));
|
||||
|
|
@ -463,8 +460,12 @@ class widgetController extends widget
|
|||
if($escaped) $args->{$key} = utf8RawUrlDecode($val);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Set default
|
||||
$args->widget_sequence = $args->widget_sequence ?? 0;
|
||||
$args->widget_cache = $args->widget_cache ?? 0;
|
||||
$args->colorset = $args->colorset ?? null;
|
||||
|
||||
/**
|
||||
* Widgets widgetContent/widgetBox Wanted If you are not content
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@ class login_info extends WidgetHandler
|
|||
*/
|
||||
function proc($args)
|
||||
{
|
||||
$args->ncenter_use = $args->ncenter_use ?? 'no';
|
||||
|
||||
// Set a path of the template skin (values of skin, colorset settings)
|
||||
$tpl_path = sprintf('%sskins/%s', $this->widget_path, $args->skin);
|
||||
Context::set('colorset', $args->colorset);
|
||||
|
|
@ -47,6 +49,9 @@ class login_info extends WidgetHandler
|
|||
return;
|
||||
}
|
||||
setcookie('_ncenterlite_hide_id', '', 0, '/');
|
||||
Context::set('ncenterlite_list', $ncenter_list->data);
|
||||
Context::set('ncenterlite_page_navigation', $ncenter_list->page_navigation);
|
||||
Context::set('_ncenterlite_num', $ncenter_list->page_navigation->total_count);
|
||||
}
|
||||
$tpl_file = 'login_info';
|
||||
}
|
||||
|
|
@ -62,9 +67,6 @@ class login_info extends WidgetHandler
|
|||
Context::set('ncenterlite_zindex', ' style="z-index:' . $ncenter_config->zindex . ';" ');
|
||||
}
|
||||
Context::set('useProfileImage', ($memberConfig->profile_image == 'Y') ? true : false);
|
||||
Context::set('ncenterlite_list', $ncenter_list->data);
|
||||
Context::set('ncenterlite_page_navigation', $ncenter_list->page_navigation);
|
||||
Context::set('_ncenterlite_num', $ncenter_list->page_navigation->total_count);
|
||||
Context::set('member_config', $this->member_config);
|
||||
|
||||
// Set a flag to check if the https connection is made when using SSL and create https url
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue