// ================== 系统通知后台管理页(v2.5.1) ================== function wmp_subscribe_render_notices_page() { if (!current_user_can('manage_options')) { return; } global $wpdb; jifen_ensure_notices_table(); $table = jifen_notices_table(); $notice_msg = ''; // 保存(新增/更新) if (isset($_POST['wmp_notice_save']) && (int) $_POST['wmp_notice_save'] === 1) { check_admin_referer('wmp_notice_action'); $id = absint(isset($_POST['nid']) ? $_POST['nid'] : 0); $title = sanitize_text_field(isset($_POST['ntitle']) ? $_POST['ntitle'] : ''); $content = wp_kses_post(isset($_POST['ncontent']) ? $_POST['ncontent'] : ''); $status = (isset($_POST['nstatus']) && (int) $_POST['nstatus'] === 1) ? 1 : 0; if ($title === '' || $content === '') { $notice_msg = '

标题和内容不能为空

'; } elseif ($id > 0) { $wpdb->update($table, array('title' => $title, 'content' => $content, 'status' => $status), array('id' => $id)); $notice_msg = '

通知已更新

'; } else { $wpdb->insert($table, array('title' => $title, 'content' => $content, 'status' => $status, 'created_at' => current_time('mysql'))); $notice_msg = '

通知已发布

'; } } // 删除 if (isset($_GET['del']) && (int) $_GET['del'] > 0) { check_admin_referer('wmp_notice_del'); $wpdb->delete($table, array('id' => absint($_GET['del']))); $notice_msg = '

通知已删除

'; } $edit = null; if (isset($_GET['edit']) && (int) $_GET['edit'] > 0) { $edit = $wpdb->get_row($wpdb->prepare("SELECT * FROM $table WHERE id=%d", absint($_GET['edit']))); } $list = $wpdb->get_results("SELECT * FROM $table ORDER BY id DESC LIMIT 200"); echo '

系统通知

'; echo '

发布后,小程序端“个人中心 → 系统通知”即可看到启用的通知。可用来发布公告、活动、折扣码等信息。

'; if ($notice_msg) { echo $notice_msg; } echo '

' . ($edit ? '编辑通知' : '发布新通知') . '

'; echo '
'; wp_nonce_field('wmp_notice_action'); echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
标题
内容

支持简单 HTML

状态
'; submit_button($edit ? '保存修改' : '发布通知'); echo '
'; echo '

通知列表

'; if ($list) { echo ''; foreach ($list as $n) { echo ''; } echo '
ID标题状态发布时间操作
' . (int) $n->id . '' . esc_html($n->title) . '' . ((int) $n->status === 1 ? '启用' : '停用') . '' . esc_html($n->created_at) . '编辑 | 删除
'; } else { echo '

暂无通知。

'; } echo '
'; } /** GET /wp-json/wmp-subscribe/v1/notices —— 小程序端获取启用的系统通知 */ function wmp_subscribe_get_notices($request) { global $wpdb; jifen_ensure_notices_table(); $table = jifen_notices_table(); $rows = $wpdb->get_results("SELECT id, title, content, created_at FROM $table WHERE status=1 ORDER BY id DESC LIMIT 50"); $list = array(); foreach ((array) $rows as $r) { $list[] = array( 'id' => (int) $r->id, 'title' => $r->title, 'content' => $r->content, 'created_at' => $r->created_at, ); } return rest_ensure_response(array('code' => 200, 'list' => $list)); }
Warning: Cannot modify header information - headers already sent by (output started at /www/wwwroot/www.iyrc.cn/wp-content/plugins/xiaocx-jifen/xiaocx-jifen.php:2957) in /www/wwwroot/www.iyrc.cn/wp-content/plugins/wp-super-cache/wp-cache-phase2.php on line 1906
艾瑞克网-艾瑞克网-第171页
艾瑞克网-艾瑞克网-第171页
2025年鄞州区十二校中考联考一模-艾瑞克网
7~9年级上册我的作业-艾瑞克网

7~9年级上册我的作业

我用夸克网盘分享了「7~9年级上册我的作业」,点击链接即可保存。打开「夸克APP」,无需下载在线播放视频,畅享原画5倍速,支持电视投屏。 链接:https://pan.quark.cn/s/88952b0804ec
过去进行时用法详解-艾瑞克网

过去进行时用法详解

1. 过去进行时的定义过去进行时主要表示过去某一时刻正在进行的动作,或表示过去某一阶段一直在进行的动作。如:I was having a talk with Li Hua at that time. 那时,我正在跟李华谈话。I was...
3年前
0356
旧约 -- 诗篇(Psalms) -- 第56章-艾瑞克网

旧约 — 诗篇(Psalms) — 第56章

56:1 (非利士人在迦特拿住大卫。那时他作这金诗,交与伶长,调用远方无声鸽)神阿,求你怜悯我,因为人要把我吞了,终日攻击欺压我。 Be merciful unto me, O God: for man would swallow m...
3年前
0357
2024年中考英语二轮热点题型归纳与变式演练(全国通用)阅读理解之议论文-艾瑞克网

2024年中考英语二轮热点题型归纳与变式演练(全国通用)阅读理解之议论文

【题型解读】 议论文往往有观点,有事实,逻辑性强,命题往往从事实的有关细节及文章的主旨或作者的表达意图等方面着手,考查我们的思维能力和判断能力。所以考生要培养根据上下文猜词的能力,...
人教版英语九年级 Unit5 What are the shirts made of? 知识点-艾瑞克网

人教版英语九年级 Unit5 What are the shirts made of? 知识点

Unit5 What are the shirts made of?1.重点短语 1.be made of 由...制作/制造(材料)  2.be made in在...制作/制造 (产地)3.be made from由......制造/制成   4.environmental ...
2年前
0350
2024年中考英语二轮热点题型归纳与变式演练(全国通用)任务型阅读之阅读还原-艾瑞克网

2024年中考英语二轮热点题型归纳与变式演练(全国通用)任务型阅读之阅读还原

【题型解读】 还原句子型阅读是中考题型中比较新的题型,一般有200-250个单词左右,常见题型为5选5、6选、7选5。这题型实际上需要学生拓宽自己思维的深度和广度,不再只是简单地从句子层面出发...
2016年12月英语六级作文范文:广告-艾瑞克网

2016年12月英语六级作文范文:广告

Directions: For this part, you are allowed 30 minutes to write a composition on the topic My Opinion on Advertisement. You should write at least 120 words and you should base your ...
3年前
03515
混血翻译员TheInterpretersWithMixedBlood-艾瑞克网

混血翻译员TheInterpretersWithMixedBlood

The job as an interpreter is not the easy work in people’s eyes, only these excellent students can stand out and work on it. The translation between languages needs to master at l...
2017年12月英语四级作文备考范文:求职申请信-艾瑞克网

2017年12月英语四级作文备考范文:求职申请信

Directions: Write a composition entitled Apply for an Employment. You should write at least 120 words according to the outline given below in Chiness. 1.请就某一工作职位写一封求职...