Error:
Discover: Undefined index: link_type in /residence/golchind/public_html/wp-content/themes/golchindl/capabilities.php on line 40
Discover: Attempting to get property of non-object in /residence/golchind/public_html/wp-content/themes/golchindl/capabilities.php on line 58
Warning: Can’t modify header info – headers already despatched by (output began at /residence/golchind/public_html/wp-content/themes/golchindl/capabilities.php:40) in /residence/golchind/public_html/wp-admin/admin-header.php on line 9
assist :
line 40
$sort = $_POST[‘link_type’];
line 58
update_post_meta($post->ID,”_oscar_data”,json_encode(array(“episodes”=>$episodes,”hyperlinks”=>$hyperlinks,”sort”=>$sort),
JSON_UNESCAPED_UNICODE));
operate oscar_meta_box_js(){
wp_enqueue_style( 'oscar_box_style',get_bloginfo('template_url')."/css/admin_meta_box.css");
wp_enqueue_script( 'oscar_box', get_bloginfo('template_url'). '/js/meta_boxes.js', array('jquery'),'1.0',true);
}
add_action( 'admin_enqueue_scripts', 'oscar_meta_box_js');
operate oscar_meta_save(){
international $put up,$meta_args,$meta_dls;
$sort = $_POST['link_type'];
$episodes = array();
$hyperlinks = array();
if($sort == "serial"){
for($i=0;$i<depend($_POST['ep_name']);$i++){
$episodes[] = array("title"=>$_POST['ep_name'][$i],"high quality"=>$_POST['ep_quality'][$i],"medium_size"=>$_POST['ep_med'][$i]);
}
for($i=0;$i<depend($_POST['link']);$i++){
$hyperlinks[] = array("title"=>$_POST['name'][$i],"hyperlink"=>$_POST['link'][$i],"subtitle"=>$_POST['subtitle'][$i],"screenshot"=>$_POST['screenshot'][$i],"episode"=>$_POST['episode'][$i]);
}
} else if($sort == "film") {
for($i=0;$i<depend($_POST['movie_title']);$i++){
$episodes[] = array("title"=>$_POST['movie_title'][$i]);
}
for($i=0;$i<depend($_POST['mlink']);$i++){
$hyperlinks[] = array("title"=>$_POST['mname'][$i],"hyperlink"=>$_POST['mlink'][$i],"subtitle"=>$_POST['msubtitle'][$i],"screenshot"=>$_POST['mscreenshot'][$i],"episode"=>$_POST['mtitle'][$i]);
}
}
update_post_meta($post->ID,"_oscar_data",json_encode(array("episodes"=>$episodes,"hyperlinks"=>$hyperlinks,"sort"=>$sort), JSON_UNESCAPED_UNICODE));
}
operate oscar_download(){
international $put up;
?>
<script>
var $ = jQuery;
$(operate(){
var knowledge = '<?=get_post_meta($post->ID,"_oscar_data",true);?>';
if(knowledge != ""){
knowledge = JSON.parse(knowledge);
var sort = knowledge['type'];
knowledge['episodes'].forEach(operate(e){
if(sort == "serial")
add_ep(e['name'],e['quality'],e['medium_size'])
else
add_title(e['name']);
});
knowledge['links'].forEach(operate(e){
if(sort == "serial")
add_link(e['name'],e['link'],e['subtitle'],e['screenshot'],e['episode'])
else
add_mlink(e['name'],e['link'],e['subtitle'],e['screenshot'],e['episode'])
});
if(knowledge['type']){
$("#link_type").val(knowledge['type']);
}
}
normalize_links()
normalize_mlinks()
});
</script>
<?php if ('sequence' == get_post_type()) { ?>
<div id="serial" class="content material">
<div class="side_inp_keeper">
<enter id="title_serial" sort="textual content" placeholder="عنوان فصل">
<enter id="quality_serial" sort="textual content" placeholder="کیفیت">
<enter id="med_serial" sort="textual content" placeholder="میانگین حجم هم قسمت">
<button id="add_ep" class="button">افزودن</button>
</div>
<div id="episodes">
</div>
<hr>
<div class="hyperlinks" type="show:none;">
<div class="side_inp_keeper">
<choose id="ep"></choose>
<enter sort="textual content" id="title" placeholder="عنوان لینک">
<enter sort="textual content" id="hyperlink" placeholder="لینک دانلود">
<enter sort="textual content" id="subtitle" placeholder="زیر نویس">
<enter sort="textual content" id="screenshot" placeholder="نمونه کیفیت">
<button id="add_link" class="button">افزودن</button>
</div>
<div id="hyperlinks">
</div>
</div>
</div>
<?php } else if ('motion pictures' == get_post_type()) { ?>
<div id="film" class="content material">
<div class="side_inp_keeper">
<enter sort="textual content" title="movie_title" id="movie_title" placeholder="عنوان (مثال : زبان اصلی)"><button id="add_link_title" class="button">افزودن</button>
</div>
<div id="titles">
</div>
<hr>
<div class="mlinks">
<div class="side_inp_keeper">
<choose id="titl"></choose>
<enter sort="textual content" id="mname" placeholder="عنوان لینک">
<enter sort="textual content" id="mlink" placeholder="لینک دانلود">
<enter sort="textual content" id="msubtitle" placeholder="زیر نویس">
<enter sort="textual content" id="mscreenshot" placeholder="نمونه کیفیت">
<button id="add_mlink" class="button">افزودن</button>
</div>
<div id="mlinks">
</div>
</div>
</div>
<?php } ?>
<enter sort="hidden" title="link_type" id="link_type" worth="serial">
<?php
}
operate oscar_meta_boxes() {
add_meta_box( 'oscar_download',"باکس دانلود", 'oscar_download', array('motion pictures', 'sequence'), 'regular', 'excessive' );
}
add_action("save_post","oscar_meta_save");
add_action( 'add_meta_boxes', 'oscar_meta_boxes' );