晋太元中,武陵人捕鱼为业。缘溪行,忘路之远近。忽逢桃花林,夹岸数百步,中无杂树,芳草鲜美,落英缤纷。渔人甚异之,复前行,欲穷其林。 林尽水源,便得一山,山有小口,仿佛若有光。便舍船,从口入。初极狭,才通人。复行数十步,豁然开朗。土地平旷,屋舍俨然,有良田、美池、桑竹之属。阡陌交通,鸡犬相闻。其中往来种作,男女衣着,悉如外人。黄发垂髫,并怡然自乐。 见渔人,乃大惊,问所从来。具答之。便要还家,设酒杀鸡作食。村中闻有此人,咸来问讯。自云先世避秦时乱,率妻子邑人来此绝境,不复出焉,遂与外人间隔。问今是何世,乃不知有汉,无论魏晋。此人一一为具言所闻,皆叹惋。余人各复延至其家,皆出酒食。停数日,辞去。此中人语云:“不足为外人道也。”(间隔 一作:隔绝) 既出,得其船,便扶向路,处处志之。及郡下,诣太守,说如此。太守即遣人随其往,寻向所志,遂迷,不复得路。 南阳刘子骥,高尚士也,闻之,欣然规往。未果,寻病终。后遂无问津者。
|
Server : Apache System : Linux srv.rainic.com 4.18.0-553.47.1.el8_10.x86_64 #1 SMP Wed Apr 2 05:45:37 EDT 2025 x86_64 User : rainic ( 1014) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/stando/public_html/wp-content/plugins/powerpress/views/onboarding/ |
Upload File : |
<?php
$AppleCategories = powerpress_apple_categories(true);
$FeedSettings = powerpress_get_settings('powerpress_feed_podcast');
$GeneralSettings = powerpress_get_settings('powerpress_general');
$title = $FeedSettings['title'] ? $FeedSettings['title'] : get_bloginfo_rss('name');
if (isset($_FILES['itunes_image_file'])) {
$feed_info = explode(" ", $_POST['basic_details']);
foreach ($feed_info as $i => $word) {
switch($word) {
case 'TITLE:':
if ($feed_info[$i + 1] != 'CATEGORY:') {
$title = str_replace("_", " ", $feed_info[$i + 1]);
}
break;
case 'CATEGORY:':
if ($feed_info[$i + 1] != 'EXPLICIT:') {
$FeedSettings['apple_cat_1'] = $feed_info[$i + 1];
}
break;
case 'EXPLICIT:':
if ($feed_info[$i + 1] != 'undefined') {
$FeedSettings['itunes_explicit'] = intval($feed_info[$i + 1]);
}
break;
default:
break;
}
}
$temp = $_FILES['itunes_image_file']['tmp_name'];
//Make sure the file extension is alright
$acceptable_extensions = ['jpg', 'jpeg', 'png'];
$name = $_FILES['itunes_image_file']['name'];
$ext = substr($name, strrpos($name, '.') + 1);
if (!in_array(strtolower($ext), $acceptable_extensions)) {
powerpress_page_message_add_error(__('Image has an invalid file type: ' . $ext, 'powerpress') );
$error = true;
} else {
// Check the image...
if (file_exists($temp)) {
$upload_result = wp_handle_upload($_FILES['itunes_image_file'], array('test_form' => false));
if (is_array($upload_result) && isset($upload_result['error'])) {
powerpress_page_message_add_error(__('Error saving Apple Podcasts image', 'powerpress') . ': ' . $upload_result['error']);
$error = true;
} elseif (is_array($upload_result) && isset($upload_result['url'])) {
$previewImageURL = $upload_result['url'];
} else {
powerpress_page_message_add_error(__('Error saving Apple Podcasts image', 'powerpress'));
$error = true;
}
}
}
}
if (isset($_POST['pp_start']['title'])) {
$SaveSettings = powerpress_stripslashes($_POST['pp_start']);
if (isset($previewImageURL)) {
unset($SaveSettings['itunes_image']);
$SaveSettings['itunes_image'] = $previewImageURL;
}
//var_dump($SaveSettings);
powerpress_save_settings($SaveSettings, 'powerpress_feed_podcast');
if (isset($GeneralSettings['blubrry_hosting']) && $GeneralSettings['blubrry_hosting'] != null) {
echo '<script>window.location.href = "' . admin_url("admin.php?page={$_GET['page']}&step=createEpisode") . '";</script>';
} else {
echo '<script>window.location.href = "' . admin_url("admin.php?page={$_GET['page']}&step=nohost") . '";</script>';
}
}
?>
<div class="wrap">
<div class="pp_container">
<h2 class="pp_align-center"><?php echo __('Enter your podcast title and upload artwork', 'powerpress'); ?></h2>
<h5 class="pp_align-center" style="margin-bottom: 2rem;"><?php echo __('Before you can upload your podcast, you need to name it and add podcast artwork.', 'powerpress'); ?></h5>
<hr style="margin-top: 0;" class="pp_align-center" />
<section id="one" class="pp_wrapper" style="margin-top:25px;">
<div class="pp_flex-grid">
<div class="pp_col">
<form id="basic-feed" enctype="multipart/form-data" action="" method="post">
<div class="pp_leftline">
<h4><?php echo __('Podcast Title', 'powerpress'); ?></h4>
<div class="pp_form-group">
<div class="pp_input-field-thirds">
<input id="input-title" type="text" name="pp_start[title]" class="pp_outlined" value="<?php echo $title; ?>" placeholder="<?php echo __('Enter the title of your podcast', 'powerpress'); ?>">
<label id="title-label" style="display:none" oninput=""><?php echo __('Enter the title of your podcast', 'powerpress'); ?></label>
<script>
jQuery("#input-title").on("input", function(el) {
jQuery("#title-label").css("display", "inline-block");
jQuery("#input-title").attr("placeholder", "");
});
</script>
</div>
</div>
</div>
<div class="pp_leftline">
<h4><?php echo __('Category', 'powerpress'); ?></h4>
<div class="pp_form-group">
<div class="pp_input-field-thirds">
<select id="apple_cat" name="pp_start[apple_cat_1]" class="bpp_input_med">
<?php
echo '<option value="">'. __('Select Category', 'powerpress') .'</option>';
foreach( $AppleCategories as $value=> $desc ) {
echo "\t<option value=\"$value\"" . ($FeedSettings['apple_cat_1'] == $value ? ' selected' : '') . ">" . htmlspecialchars($desc) . "</option>\n";
}
reset($AppleCategories);
?>
</select>
</div>
</div>
</div>
<div class="pp_leftline">
<h4><?php echo __('Does your podcast contain explicit content?', 'powerpress'); ?></h4>
<div class="pp_form-group">
<label><input type="radio" name="pp_start[itunes_explicit]" value="1" <?php echo $FeedSettings['itunes_explicit'] == 1 ? 'checked': '' ?> /> <?php echo __('Yes', 'powerpress'); ?></label>
<label><input type="radio" name="pp_start[itunes_explicit]" value="2" <?php echo $FeedSettings['itunes_explicit'] == 2 ? 'checked': '' ?> /> <?php echo __('No', 'powerpress'); ?></label>
</div>
</div>
<button type="submit" name="basic-feed-submit" class="pp_button" style="visibility: hidden;"><span><?php echo __('Continue', 'powerpress'); ?></span></button>
</form>
</div>
<div class="pp_col">
<form id="artwork" enctype="multipart/form-data" action="" method="post">
<div class="pp_leftline">
<h4><?php echo __('Podcast Artwork', 'powerpress'); ?></h4>
<div id="error-container" style="display: none;"><h5 style="font-weight: bold;color: red;"><img style="vertical-align: middle;margin: 0 5px 3px 0;" src="<?php echo powerpress_get_root_url(); ?>images/onboarding/cancel.svg"><?php echo __('Your image is not valid.', 'powerpress'); ?></h5></div>
<div class="pp_flex-grid" id="showbasics_artwork">
<div class="pp_col" id="showbasics_artwork_upload" style="margin-left: 0;">
<input type="text" id="filePath" readonly class="pp_outlined" style="margin: 1rem 0 1ch 0;" placeholder="Upload your show artwork" <?php echo empty($FeedSettings['itunes_image']) ? '' : "value='{$FeedSettings['itunes_image']}'" ?>>
<input id="itunes_image" type="hidden" name="pp_start[itunes_image]" <?php echo !empty($FeedSettings['itunes_image']) ? "value='{$FeedSettings['itunes_image']}'" : "" ?>>
<?php
if (!isset($previewImageURL)) {
$previewImageURL = !empty($FeedSettings['itunes_image']) ? $FeedSettings['itunes_image'] : powerpress_get_root_url() . "itunes_default.jpg";
} ?>
<img id="preview_image" class="image_wrapper" src="<?php echo $previewImageURL ?>" alt="Podcast Artwork Preview">
<input type="hidden" name="basic_details" id="basic-details">
</div>
<div class="pp_col" style="margin: 0;">
<div id="upload-artwork-button" class="pp_button_alt" onclick="document.getElementById('FileAttachment').click();">
<span><?php echo __('Upload', 'powerpress'); ?></span>
<input type="file" id="FileAttachment" name="itunes_image_file" accept="image/*" class="pp_file_upload" style="display: none;" />
</div>
<div id="artwork-spec">
<strong><?php echo __('Make sure your artwork meets the criteria for the best experience!', 'powerpress'); ?></strong>
<hr style="margin: 1em 0 0 0;">
<p class="pp-smaller-text"><?php echo __('Minimum size: 1400px x 1400px', 'powerpress'); ?></p>
<p class="pp-smaller-text"><?php echo __('Maximum size: 3000px x 3000px', 'powerpress'); ?></p>
<img style="display: none;" src="<?php echo powerpress_get_root_url(); ?>images/onboarding/checkmark.svg" id="size-icon" class="success-fail-icon">
<hr style="margin: 0;">
<p class="pp-smaller-text"><?php echo __('.jpg or .png', 'powerpress'); ?></p>
<img style="display: none;" src="<?php echo powerpress_get_root_url(); ?>images/onboarding/checkmark.svg" id="type-icon" class="success-fail-icon">
<hr style="margin: 0;">
<p class="pp-smaller-text"><?php echo __('RGB color space', 'powerpress'); ?></p>
<img style="display: none;" src="<?php echo powerpress_get_root_url(); ?>images/onboarding/checkmark.svg" id="colorspace-icon" class="success-fail-icon">
<hr style="margin: 0 0 1em 0;">
<a href="https://create.blubrry.com/resources/powerpress/powerpress-settings/artwork-2/"><?php echo __('Learn more about Podcast Artwork', 'powerpress'); ?></a>
</div>
</div>
</div>
</div>
<button type="submit" name="artwork-submit" class="pp_button" style="visibility: hidden;"><span><?php echo __('Continue', 'powerpress'); ?></span></button>
</form>
</div>
</section>
<div class="pp_col" style="padding: 20px 0;">
<hr class="pp_align-center" />
<div class="pp_button-container" style="float: right;">
<button id="continue-button" type="button" name="submit" class="pp_button"><span><?php echo __('Continue', 'powerpress'); ?></span></button>
</div>
</div>
</div>
<script>
function verifyImage() {
var img = new Image();
img.onload = function() {
let url = jQuery('#preview_image').attr("src");
jQuery("#itunes_image").val(url);
let width = this.naturalWidth;
let height = this.naturalHeight;
if (width != height || width > 3000 || width < 1400) {
jQuery("#size-icon").removeAttr('src');
jQuery("#size-icon").attr('src', '<?php echo powerpress_get_root_url(); ?>images/onboarding/cancel.svg');
}
jQuery("#size-icon").removeAttr('style');
jQuery("#size-icon").attr('style', 'display: inline-block');
if (!url.toLowerCase().includes('.jpg') && !url.toLowerCase().includes('.png')) {
jQuery("#type-icon").removeAttr('src');
jQuery("#type-icon").attr('src', '<?php echo powerpress_get_root_url(); ?>images/onboarding/cancel.svg')
}
jQuery("#type-icon").removeAttr('style');
jQuery("#type-icon").attr('style', 'display: inline-block');
let validate_url = 'https://castfeedvalidator.com/validate_colorspace?artwork-url=' + encodeURIComponent(url);
jQuery("#colorspace-icon").removeAttr('src');
jQuery("#colorspace-icon").attr('src', validate_url);
jQuery("#colorspace-icon").removeAttr('style');
jQuery("#colorspace-icon").attr('style', 'display: inline-block');
};
let url = jQuery('#preview_image').attr("src");
img.src = url;
}
jQuery(document).ready(function() {
jQuery("#filePath").val(jQuery("#preview_image").attr('src').replace(/https?:\/\/.*\/uploads\/powerpress\//i, ''));
let title = jQuery("#input-title").val().replace(" ", "_");
let category = jQuery("#apple_cat").val();
let explicit = jQuery("input[type=radio]:checked").val();
jQuery("#basic-details").val("TITLE: " + title + " CATEGORY: " + category + " EXPLICIT: " + explicit);
jQuery("#input-title").on("input", function() {
refreshDetails();
});
jQuery("#apple_cat").on("change", function() {
refreshDetails();
});
jQuery("input[type=radio]").on("change", function() {
refreshDetails();
});
jQuery("#continue-button").on("click", function () {
let valid_image = true;
<?php if (!empty($FeedSettings['itunes_image'])) { ?>
jQuery(".success-fail-icon").each(function (index) {
if (jQuery(this).attr("src").includes("cancel.svg")) {
valid_image = false;
}
});
<?php } ?>
if (valid_image) {
jQuery('#artwork :input').not(':submit').clone().hide().appendTo('#basic-feed');
jQuery("#basic-feed").submit();
} else {
jQuery("#error-container").removeAttr('style');
}
});
verifyImage();
});
function refreshDetails() {
let title = jQuery("#input-title").val().replace(" ", "_");
let category = jQuery("#apple_cat").val();
let explicit = jQuery("input[type=radio]:checked").val();
jQuery("#basic-details").val("TITLE: " + title + " CATEGORY: " + category + " EXPLICIT: " + explicit);
}
document.getElementById("FileAttachment").onchange = function () {
jQuery("#artwork").submit();
};
</script>