plugin('CommentNotifier')->template; /* @var $request */ /* @var $response */ /* @var $options */ if ($request->change) { $db = Db::get(); $select = $db->select('value')->from('table.options')->where('name = ?', 'plugin:CommentNotifier')->limit(1); $aftersitting = $db->fetchRow($select); $setting = unserialize($aftersitting['value']); $setting['template'] = $request->change; $setting = serialize($setting); $update = $db->update('table.options')->rows(array('value' => $setting))->where('name = ?', 'plugin:CommentNotifier'); $updateRows = $db->query($update); Notice::alloc()->set(_t("邮件模板启动成功"), 'success'); $template = $request->change; $response->redirect($options->adminUrl . 'extending.php?panel=' . CommentNotifier_Plugin::$panel); } function getMailTheme(): array { return glob(__TYPECHO_ROOT_DIR__ . __TYPECHO_PLUGIN_DIR__ . '/CommentNotifier/template/*', GLOB_ONLYDIR); }//获取模板 $themes = getMailTheme(); $html = ''; $ding = ''; $cite = ''; foreach ($themes as $key => $theme) { $themeFile = $theme . '/owner.html'; if (file_exists($themeFile)) {//判断是否存在模板 $name = basename($theme); $info = Plugin::parseInfo($themeFile); $screen = array_filter(glob($theme . '/*'), function ($path) { return preg_match("/screenshot\.(jpg|png|gif|bmp|jpeg|webp)$/i", $path); }); if ($screen) { $img = $options->pluginUrl . '/CommentNotifier/template/' . $name . '/' . basename(current($screen)); } else { $img = Common::url('noscreen.png', $options->adminStaticUrl('img')); } if ($info['author']) { $cite = '作者:' . $info['author'] . '  '; } if ($info['author'] && $info['homepage']) { $cite = '作者:' . $info['author'] . '  '; } if ($info['version']) { $cite = $cite . '版本: ' . $info['version']; } if ($template == $name) { $ding = ''; } else { $html = $html . ''; } } } $html = $ding . $html; echo $html; ?>

' . $info['title'] . '

' . $cite . '

' . nl2br($info['description']) . '

' . $info['title'] . '

' . $cite . '

' . nl2br($info['description']) . '

启用