Skip to content

Commit

Permalink
Merge pull request #331 from mirai-mamori/preview
Browse files Browse the repository at this point in the history
Live Alive「Loving You」 Special Update
  • Loading branch information
mirai-mamori authored Sep 13, 2021
2 parents 1af1ef1 + c767eb8 commit 1690080
Show file tree
Hide file tree
Showing 14 changed files with 162 additions and 192 deletions.
10 changes: 6 additions & 4 deletions header.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,12 @@ function gtag() {
</div>
<?php } ?>
<div id="page" class="site wrapper">
<?php if (get_post_meta(get_the_ID(), 'cover_type', true) == 'hls') {
the_video_headPattern_hls();
} elseif (get_post_meta(get_the_ID(), 'cover_type', true) == 'normal') {
the_video_headPattern_normal();
<?php
$cover_type = get_post_meta(get_the_ID(), 'cover_type', true);
if ($cover_type == 'hls') {
the_video_headPattern(true);
} elseif ($cover_type == 'normal') {
the_video_headPattern(false);
} else {
the_headPattern();
} ?>
Expand Down
5 changes: 5 additions & 0 deletions inc/admin_addcss.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,9 @@
display: block !important;
}

.csf-nav {
position: -webkit-sticky;
position: sticky;
top: 125px;
}
</style>
38 changes: 19 additions & 19 deletions inc/classes/Images.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ public function Chevereto_API($image) {
);

$response = wp_remote_post($upload_url, $args);
$reply = json_decode($response["body"]);
$reply = json_decode($response['body']);

if ($reply->status_txt == 'OK' && $reply->status_code == 200) {
$status = 200;
$success = true;
$message = "success";
$message = 'success';
$link = $reply->image->image->url;
$proxy = iro_opt('comment_image_proxy') . $link;
} else {
Expand Down Expand Up @@ -68,12 +68,12 @@ public function Imgur_API($image) {
);

$response = wp_remote_post($upload_url, $args);
$reply = json_decode($response["body"]);
$reply = json_decode($response['body']);

if ($reply->success && $reply->status == 200) {
$status = 200;
$success = true;
$message = "success";
$message = 'success';
$link = $reply->data->link;
$proxy = iro_opt('comment_image_proxy') . $link;
} else {
Expand All @@ -98,19 +98,19 @@ public function Imgur_API($image) {
*/
public function SMMS_API($image) {
$client_id = $this->smms_client_id;
$upload_url = "https://sm.ms/api/v2/upload";
$upload_url = 'https://sm.ms/api/v2/upload';
$filename = $image['cmt_img_file']['name'];
$filedata = $image['cmt_img_file']['tmp_name'];
$Boundary = wp_generate_password();
$bits = file_get_contents($filedata);

$args = array(
"headers" => "Content-Type: multipart/form-data; boundary=$Boundary\r\n\r\nAuthorization: Basic $client_id\r\n\r\nUser-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97",
"body" => "--$Boundary\r\nContent-Disposition: form-data; name=\"smfile\"; filename=\"$filename\"\r\n\r\n$bits\r\n\r\n--$Boundary--"
'headers' => "Content-Type: multipart/form-data; boundary=$Boundary\r\n\r\nAuthorization: Basic $client_id\r\n\r\nUser-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97",
'body' => "--$Boundary\r\nContent-Disposition: form-data; name=\"smfile\"; filename=\"$filename\"\r\n\r\n$bits\r\n\r\n--$Boundary--"
);

$response = wp_remote_post($upload_url, $args);
$reply = json_decode($response["body"]);
$reply = json_decode($response['body']);

if ($reply->success && $reply->code == 'success') {
$status = 200;
Expand Down Expand Up @@ -142,34 +142,34 @@ public function SMMS_API($image) {
}

public static function cover_gallery() {
if (iro_opt('random_graphs_options') == "local") {
$img_array = glob(get_template_directory() . "/manifest/gallary/*.{gif,jpg,png}", GLOB_BRACE);
if (iro_opt('random_graphs_options') == 'local') {
$img_array = glob(get_template_directory() . '/manifest/gallary/*.{gif,jpg,png}', GLOB_BRACE);
$img = array_rand($img_array);
$imgurl = trim($img_array[$img]);
$imgurl = str_replace(get_template_directory(), get_template_directory_uri(), $imgurl);
} elseif (iro_opt('random_graphs_options') == "external_api") {
} elseif (iro_opt('random_graphs_options') == 'external_api') {
$imgurl = iro_opt('random_graphs_link');
} else {
global $sakura_image_array;
$img_array = json_decode($sakura_image_array, true);
$img = array_rand($img_array);
$img_domain = iro_opt('random_graphs_link') ? iro_opt('random_graphs_link') : get_template_directory_uri();
if (strpos($_SERVER['HTTP_ACCEPT'], 'image/webp') !== false) {
$imgurl = $img_domain . "/manifest/" . $img_array[$img]["webp"][0];
$imgurl = $img_domain . "/manifest/" . $img_array[$img]['webp'][0];
} else {
$imgurl = $img_domain . "/manifest/" . $img_array[$img]["jpeg"][0];
$imgurl = $img_domain . "/manifest/" . $img_array[$img]['jpeg'][0];
}
}
return $imgurl;
}

public static function mobile_cover_gallery() {
if (iro_opt('random_graphs_options') == "local") {
$img_array = glob(get_template_directory() . "/manifest/gallary/*.{gif,jpg,png}", GLOB_BRACE);
if (iro_opt('random_graphs_options') == 'local') {
$img_array = glob(get_template_directory() . '/manifest/gallary/*.{gif,jpg,png}', GLOB_BRACE);
$img = array_rand($img_array);
$imgurl = trim($img_array[$img]);
$imgurl = str_replace(get_template_directory(), get_template_directory_uri(), $imgurl);
} elseif (iro_opt('random_graphs_options') == "external_api") {
} elseif (iro_opt('random_graphs_options') == 'external_api') {
//$imgurl = iro_opt('random_graphs_link');
$imgurl = iro_opt('random_graphs_link_mobile');
} else {
Expand All @@ -178,16 +178,16 @@ public static function mobile_cover_gallery() {
$img = array_rand($img_array);
$img_domain = iro_opt('random_graphs_link') ? iro_opt('random_graphs_link') : get_template_directory_uri();
if (strpos($_SERVER['HTTP_ACCEPT'], 'image/webp')) {
$imgurl = $img_domain . "/manifest/" . $img_array[$img]["webp"][0];
$imgurl = $img_domain . "/manifest/" . $img_array[$img]['webp'][0];
} else {
$imgurl = $img_domain . "/manifest/" . $img_array[$img]["jpeg"][0];
$imgurl = $img_domain . "/manifest/" . $img_array[$img]['jpeg'][0];
}
}
return $imgurl;
}

public static function feature_gallery() {
if (iro_opt('post_cover_options') == "type_2") {
if (iro_opt('post_cover_options') == 'type_2') {
$imgurl = iro_opt('post_cover');
} else {
$imgurl = self::cover_gallery();
Expand Down
Loading

0 comments on commit 1690080

Please sign in to comment.