// ================== 系统通知后台管理页(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
艾瑞克网-艾瑞克网-第160页
艾瑞克网-艾瑞克网-第160页
be reported后接非谓语动词的用法-艾瑞克网

be reported后接非谓语动词的用法

  be reported后接非谓语动词的用法 be reported可以后接的非谓语动词有现在分词短语、过去分词短语、动词不定式短语。 1. 后接现在分词短语 Insurgent forces were reported advancing in...
3年前
0180
可以后跟v-ing形式的动词(短语)-艾瑞克网

可以后跟v-ing形式的动词(短语)

coax(P460)作“to persuade someone to do something that they do not want to do by talking to them in a kind, gentle, and patient way 劝诱,哄;诱导”解时,构成“coax somebody into...
3年前
0260
2022高考英语浙江卷(6月)精校文档(附听力录音原文)-艾瑞克网

2022高考英语浙江卷(6月)精校文档(附听力录音原文)

  2022高考英语浙江卷(6月)精校文档 (附参考答案与听力录音原文) 选择题部分(共95分) 第一部分听力(共两节满分30分) 做题时,先将答案标在试卷上。录音内容结束后,你将有两分钟的...
3年前
0270
five-months-old 用法是否正确-艾瑞克网

five-months-old 用法是否正确

  当代英语中已经没有这种用法了,我们也知道正确的表达方式是什么,只是龙楠网友想要知道来龙去脉怎么回事,为啥偏偏要说two-months-old baby,我也比较感兴趣,我就以我查到的资料说说。...
3年前
0270
since done 与since being done,being done 与being doing区分-艾瑞克网

since done 与since being done,being done 与being doing区分

  这里涉及到:1、since词性的理解;2、being的词性及意思理解;3、being done的词性及意思理解(可以对比理解being doing,很多视频只知道从时态考虑,得出结论没有being doing的说话。这...
3年前
0190
advise表示“建议”的用法初探-艾瑞克网

advise表示“建议”的用法初探

  advise 表示“建议”的用法初探 在主动语态中,如果 advise 后面没有宾语(名词或者代词),后面的动词要用动名词,作宾语,即 advise doing sth(动名词作 advise 的宾语);如果allow ...
3年前
0700
名词前面alittle和alittleof的用法-艾瑞克网

名词前面alittle和alittleof的用法

  名词前面a little 和a little of的用法 笔者在某学生的英语考试卷中看到这样一道单项选择题: I’d like to drink ____ this water. A. a bit B. a little of C. a little D. a few 老师...
3年前
0270
speakwith...可以表示“与……交谈”吗-艾瑞克网

speakwith…可以表示“与……交谈”吗

  speak with ... 可以表示 “与……交谈”吗? — We can use WeChat to ________ with each other on the Internet. — Really? Will you show me how to use it? A.speak B.talk C.s...
3年前
0150
分词短语作条件状语的用法-艾瑞克网

分词短语作条件状语的用法

  分词短语作条件状语的用法 在英语中,现在分词短语和过去分词短语都可以充当条件状语。用分词短语作条件状语时,应该注意以下几个问题: 1. 分词短语充当条件状语时,分词的逻辑主语通常...
3年前
0240
关于know better than后的动词不定式形式讲解-艾瑞克网

关于know better than后的动词不定式形式讲解

  关于know better than后的动词不定式形式 张道真《实用英语语法》(外语教学与研究出版社2002)在15.3.5节中列出了know better than (to) do something的句式,并有例句如下: You ought...
3年前
0240