perf: update to v3.4.0 (#273)

* fix: bug fix
update Meting API, add ipv6 support, fix icon
close #255,#243

* style: add some variable definitions
support php8

* perf: update to v3.4.0

* docs: update screenshot
This commit is contained in:
Spirit 2021-08-01 13:04:09 +08:00 committed by GitHub
parent 8a46b8545f
commit b73c45f022
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 151 additions and 139 deletions

View File

@ -3,10 +3,10 @@ Sakura🌸: A Wonderful WordPress Theme
[中文](README.md) | Engilsh
![Sakura](https://view.moezx.cc/images/2018/05/26/sakura.png)
![Sakura](screenshot.jpg)
![PHP version](https://img.shields.io/badge/PHP-7.1+-4F5B93.svg?style=flat-square)
![WP version](https://img.shields.io/badge/WordPress-5.0+-0073aa.svg?style=flat-square)
![PHP version](https://img.shields.io/badge/PHP-7.1+-4F5B93.svg?style=flat-square&logo=php)
![WP version](https://img.shields.io/badge/WordPress-5.3-0073aa.svg?style=flat-square&logo=wordpress)
[![GitHub release](https://img.shields.io/github/release/mashirozx/Sakura.svg?style=flat-square)](https://github.com/mashirozx/Sakura/releases/latest)
[![Github commits (since latest release)](https://img.shields.io/github/commits-since/mashirozx/Sakura/latest/dev.svg?style=flat-square)](https://github.com/mashirozx/Sakura/commits/dev)
[![](https://data.jsdelivr.com/v1/package/gh/moezx/cdn/badge)](https://www.jsdelivr.com/package/gh/moezx/cdn)

View File

@ -3,10 +3,10 @@
中文 | [Engilsh](README-en.md)
![Sakura](https://view.moezx.cc/images/2018/05/26/sakura.png)
![Sakura](screenshot.jpg)
![PHP version](https://shader.2heng.xin/badge/PHP-7.1+-4F5B93.svg?style=flat-square&logo=php)
![WP version](https://shader.2heng.xin/badge/WordPress-5.3-0073aa.svg?style=flat-square&logo=wordpress)
![PHP version](https://img.shields.io/badge/PHP-7.1+-4F5B93.svg?style=flat-square&logo=php)
![WP version](https://img.shields.io/badge/WordPress-5.3-0073aa.svg?style=flat-square&logo=wordpress)
[![GitHub release](https://img.shields.io/github/v/release/mashirozx/Sakura.svg?style=flat-square&logo=github)](https://github.com/mashirozx/Sakura/releases/latest)
[![Github commits (since latest release)](https://img.shields.io/github/commits-since/mashirozx/Sakura/latest/dev.svg?style=flat-square&logo=git&color=important)](https://github.com/mashirozx/Sakura/commits/dev)
[![](https://data.jsdelivr.com/v1/package/gh/moezx/cdn/badge)](https://www.jsdelivr.com/package/gh/moezx/cdn)

View File

@ -48,7 +48,7 @@
<?php endif; ?>
<?php
$robot_comments = '';
if(comments_open()){
if(akina_option('norobot')) $robot_comments = '<label class="siren-checkbox-label"><input class="siren-checkbox-radio" type="checkbox" name="no-robot"><span class="siren-no-robot-checkbox siren-checkbox-radioInput"></span>'.__('I\'m not a robot', 'sakura').'</label>';
$private_ms = akina_option('open_private_message') ? '<label class="siren-checkbox-label"><input class="siren-checkbox-radio" type="checkbox" name="is-private"><span class="siren-is-private-checkbox siren-checkbox-radioInput"></span>'.__('Comment in private', 'sakura').'</label>' : '';

View File

@ -249,6 +249,15 @@ require get_template_directory() . '/inc/categories-images.php';
function convertip($ip)
{
error_reporting(E_ALL ^ E_NOTICE);
if (!filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) === false) {
$file_contents = file_get_contents('http://ip.taobao.com/outGetIpInfo?accessKey=alibaba-inc&ip='.$ip);
$result = json_decode($file_contents,true);
if ($result['data']['country'] != '中国') {
return $result['data']['country'];
} else {
return $result['data']['region'].'&nbsp;·&nbsp;'.$result['data']['city'].'&nbsp;·&nbsp;'.$result['data']['isp'];
}
} else {
$dat_path = dirname(__FILE__) . '/inc/QQWry.Dat';
if (!$fd = @fopen($dat_path, 'rb')) {
return 'IP date file not exists or access denied';
@ -270,6 +279,7 @@ function convertip($ip)
$ipAllNum = ($ipend - $ipbegin) / 7 + 1;
$BeginNum = 0;
$EndNum = $ipAllNum;
$ip1num = $ip2num = $ipAddr1 = $ipAddr2 = '';
while ($ip1num > $ipNum || $ip2num < $ipNum) {
$Middle = intval(($EndNum + $BeginNum) / 2);
fseek($fd, $ipbegin + 7 * $Middle);
@ -393,6 +403,7 @@ function convertip($ip)
return $ipaddr;
}
}
//Comment Location End
/**
@ -428,6 +439,7 @@ if (!function_exists('akina_comment_format')) {
<?php if (current_user_can('manage_options') and (wp_is_mobile() == false)) {
$comment_ID = $comment->comment_ID;
$i_private = get_comment_meta($comment_ID, '_private', true);
$flag = '';
$flag .= ' <i class="fa fa-snowflake-o" aria-hidden="true"></i> <a href="javascript:;" data-actionp="set_private" data-idp="' . get_comment_id() . '" id="sp" class="sm" style="color:rgba(0,0,0,.35)">' . __("Private", "sakura") . ': <span class="has_set_private">';
if (!empty($i_private)) {
$flag .= __("Yes", "sakura") . ' <i class="fa fa-lock" aria-hidden="true"></i>';

View File

@ -496,7 +496,7 @@ class Meting
case 'netease':
$api = array(
'method' => 'POST',
'url' => 'http://music.163.com/api/v3/playlist/detail',
'url' => 'http://music.163.com/api/v6/playlist/detail',
'body' => array(
's' => '0',
'id' => $id,

View File

@ -5,7 +5,7 @@ Theme URI: https://github.com/mashirozx/Sakura/
Author: Mashiro, Spirit, Louie, Fuzzz
Author URI: http://2heng.xin
Description: A wonderful branch of theme Akina
Version: 3.3.9
Version: 3.4.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: sakura