mirror of
https://github.com/mashirozx/sakura.git
synced 2024-12-12 09:54:35 +08:00
bug fix
This commit is contained in:
parent
ad63468e4e
commit
15e7f3b57a
@ -470,7 +470,7 @@ function set_post_views() {
|
||||
global $post;
|
||||
$post_id = intval($post->ID);
|
||||
if($post_id) {
|
||||
$views = get_post_meta($post_id, 'views', true);
|
||||
$views = (int)get_post_meta($post_id, 'views', true);
|
||||
if(!update_post_meta($post_id, 'views', ($views + 1))) {
|
||||
add_post_meta($post_id, 'views', 1, true);
|
||||
}
|
||||
|
10
inc/api.php
10
inc/api.php
@ -275,7 +275,7 @@ EOS;
|
||||
|
||||
$posts = new WP_Query('posts_per_page=-1&post_status=publish&post_type=post');
|
||||
while ($posts->have_posts()): $posts->the_post();
|
||||
$output .= '{"type":"post","link":"' . get_post_permalink() . '","title":' . json_encode(get_the_title()) . ',"comments":"' . get_comments_number('0', '1', '%') . '","text":' . json_encode(str_replace($vowels, " ", preg_replace($regex, ' ', get_the_content()))) . '},';
|
||||
$output .= '{"type":"post","link":"' . get_permalink() . '","title":' . json_encode(get_the_title()) . ',"comments":"' . get_comments_number('0', '1', '%') . '","text":' . json_encode(str_replace($vowels, " ", preg_replace($regex, ' ', get_the_content()))) . '},';
|
||||
endwhile;
|
||||
wp_reset_postdata();
|
||||
|
||||
@ -373,12 +373,12 @@ function update_database() {
|
||||
$manifest = file_get_contents($img_domain . "/manifest/manifest.json");
|
||||
if($manifest) {
|
||||
$manifest = array(
|
||||
"key" => "manifest_json",
|
||||
"value" => $manifest
|
||||
"mate_key" => "manifest_json",
|
||||
"mate_value" => $manifest
|
||||
);
|
||||
$time = array(
|
||||
"key" => "json_time",
|
||||
"value" => date("Y-m-d H:i:s",time())
|
||||
"mate_key" => "json_time",
|
||||
"mate_value" => date("Y-m-d H:i:s",time())
|
||||
);
|
||||
|
||||
$wpdb->query("DELETE FROM `wp_sakura` WHERE `mate_key` ='manifest_json'");
|
||||
|
Binary file not shown.
@ -2,7 +2,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Sakura\n"
|
||||
"POT-Creation-Date: 2019-12-21 20:23+0800\n"
|
||||
"PO-Revision-Date: 2019-12-21 20:24+0800\n"
|
||||
"PO-Revision-Date: 2019-12-24 13:28+0800\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: \n"
|
||||
"Language: zh_CN\n"
|
||||
@ -955,7 +955,7 @@ msgstr "聚焦图二链接"
|
||||
|
||||
#: options.php:509
|
||||
msgid "Top-feature 3 image"
|
||||
msgstr "聚焦图二链接"
|
||||
msgstr "聚焦图三"
|
||||
|
||||
#: options.php:516 options.php:517
|
||||
msgid "Top-feature 3 title"
|
||||
|
Loading…
Reference in New Issue
Block a user