Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/293.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 分析错误:语法错误,意外的文件结尾_Php_Wordpress - Fatal编程技术网

Php 分析错误:语法错误,意外的文件结尾

Php 分析错误:语法错误,意外的文件结尾,php,wordpress,Php,Wordpress,服务器给了我这个错误,但我不明白为什么 错误是 “分析错误:语法错误,第227行的/homepages/43/d514350324/htdocs/wp content/plugins/NetClass/nw_NetClass_init_custombox.php中出现意外的文件结尾” 第227行是文件的最后一行 这就是密码。请帮帮我 <?php /* Define the custom box */ add_action( 'add_meta_boxes', 'aggiungiMetaB

服务器给了我这个错误,但我不明白为什么

错误是

“分析错误:语法错误,第227行的/homepages/43/d514350324/htdocs/wp content/plugins/NetClass/nw_NetClass_init_custombox.php中出现意外的文件结尾”

第227行是文件的最后一行

这就是密码。请帮帮我

<?php
/* Define the custom box */

add_action( 'add_meta_boxes', 'aggiungiMetaBox' );
add_action( 'save_post', 'salvaMetaBox', 10, 2 );

add_action( 'wp_ajax_nc_savePortable_lezioni_action', 'nc_savePortable_lezioni' );
add_action( 'admin_footer', 'nc_savePortable_lezioni_js' );



function parseInt($str){
    return (int) $str;
}


function aggiungiMetaBox(){

  add_meta_box( "nw_Netclass_Box_AggiungiaCorso", "Aggiungi la lezione al corso", "aggiungiMetaBox_AggiungiLezione", "corso");
  add_meta_box("nw_NetClass_Box_DatiFattura", "Dati della fattura", "aggiungiMetaBox_DatiFattura", "fattura");
    add_meta_box("nw_NetClass_Box_Corsi_Associati", "Corsi associati", "aggiungiMetaBox_Corsi_Associati", "lezione");

}
function aggiungiMetaBox_Corsi_Associati($post){
  ?>
    <p><?php echo get_post_meta($post->ID, 'corsi_associati',true); ?></p>
  <?php
}

 function is_in_array($array_lezioni_del_corso, $object){

      if(!is_array($array_lezioni_del_corso)){
        if($array_lezioni_del_corso == $object){
          return true;
        }else{
          return false;
        }
      }
      else{
        return in_array($object, $array_lezioni_del_corso);
      }
  }


function aggiungiMetaBox_DatiFattura($post){

  $post_id = $post->ID;

  $user_info = get_userdata(get_post_meta($post_id, "intestatarioFattura" , true));
  $user_meta = array(
      'tipo_utente' => get_user_meta(get_post_meta($post_id, "intestatarioFattura" , true), 'tipo_utente',true),
      'p_iva' => get_user_meta(get_post_meta($post_id, "intestatarioFattura" , true), 'p_iva',true),
      'indirizzo_fatturazione' => get_user_meta(get_post_meta($post_id, "intestatarioFattura" , true), 'indirizzo_fatturazione',true)
    );

  ?>
  Intestatario della fattura : <?php echo $user_info->display_name; ?> <br>
  Tipo di utente : <?php echo $user_meta['tipo_utente']; ?> <br>
  Indirizzo di fatturazione : <?php echo $user_meta['indirizzo_fatturazione']; ?> <br>
  P.IVA : <?php echo $user_meta['p_iva']; ?> <br>
  Inponibile della fattura : <?php echo get_post_meta( $post_id, "inponibileFattura" , true); ?> <br>
  Totale della fattura : <?php echo get_post_meta( $post_id, "totaleFattura" , true); ?> <br>
  Articoli acquistati:

  <ul>
      <?php
      foreach(get_post_meta( $post_id, "articoliFattura" , true) as $prodotto){
      ?>
      <li><?php echo get_the_title($prodotto); ?></li>

      <?php
        }
      ?>
  </ul>
  <?php


}


//save the meta box
function salvaMetaBox($post_id)
{

  //Salvo i dati del Box lezioni nel post corso //
  global $wpdb;
  $database_name = $wpdb->prefix.'Netclass_friends';

  if ( (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) || ( defined('DOING_AJAX') && DOING_AJAX) || isset($_REQUEST['bulk_edit']) ) { return $post_id; }


  //Salvo i dati delle fatture
}



function aggiungiMetaBox_AggiungiLezione($post){

  global $wpdb;
  $post_id = $post->ID;
  $query = "SELECT post_title,ID FROM ".$wpdb->prefix."posts WHERE post_type='lezione' AND post_status='publish'";
  $array_lezioni_del_corso = get_post_meta($post_id, 'array_lezioni_del_corso');
  $lezioni = $wpdb->get_results($query);


  foreach ($lezioni as $lezione) { ?>

    <input id="<?php echo $lezione->ID; ?>" data-title="<?php echo $lezione->post_title; ?>" class="nc_lezione_pubblicata" type="checkbox" name="checkfield[]" value="<?php echo $lezione->ID; ?>" <?php if ( is_in_array($array_lezioni_del_corso[0], $lezione->ID)) { ?> checked <?php } ?>/> 
    <label for="<?php echo $lezione->ID; ?>"><?php echo $lezione->post_title; ?></label> <br>

  <?php }  ?>

  <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
  <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js"></script>

  <script type="text/javascript">

    $(document).ready(function($) 
    {    
        $( '.sortable' ).sortable({
            opacity: 0.6,
            revert: true,
            cursor: 'move',
            handle: '.hndle',
            placeholder: {
                element: function(currentItem) {
                    return $("<li style='background:#E7E8AD'>&nbsp;</li>")[0];
                },
                update: function(container, p) {
                    return;
                }
            },

            update: function( event, ui ) {

              console.log($(".sortable").sortable("toArray", {attribute: 'data-id'}));  
              saveSortable($(".sortable").sortable("toArray", {attribute: 'data-id'}));

            }
        });
        $( '.sortable' ).disableSelection();

        $(".nc_lezione_pubblicata").change(function() {
          if( $(this).is(':checked') ){
              $( '<li class="nc_lezione_del_corso" data-id="'+$(this).attr('id')+'" id="lezione_del_corso_'+$(this).attr('id')+'"><code class="hndle"> -[]- </code>'+$(this).data('title')+'</p>' ).appendTo( ".sortable" );
          }else{
            $("#lezione_del_corso_"+$(this).attr('id')).remove();
            console.log("elimino");
          }

          saveSortable($(".sortable").sortable("toArray", {attribute: 'data-id'}));

        });
    });
  </script>

  <ul  class="sortable ui-sortable">

      <?php foreach ($array_lezioni_del_corso[0] as $lezione_del_corso) { ?>

        <li class="nc_lezione_del_corso" id="lezione_del_corso_<?php echo $lezione_del_corso; ?>" 
        data-id="<?php echo $lezione_del_corso; ?>">

            <code class='hndle'> -[]- </code>
            <?php echo get_the_title($lezione_del_corso); ?>

        </li>

      } ?>

  </ul>

  <p>

    <script type="text/javascript">
    $(function(){ 
      console.log($(".sortable").sortable("toArray")); 
    });</script>

  </p>

<?php }

function nc_savePortable_lezioni(){

    global $wpdb;
    $post_id = $_POST['post_id'];
    $array_lezioni_del_corso = $_POST['array_lezioni_del_corso'];

    update_post_meta($post_id, 'array_lezioni_del_corso', $array_lezioni_del_corso);

    foreach ($array_lezioni_del_corso as $lezione_del_corso) {

      $corsi_associati = get_post_meta($lezione_del_corso, 'corsi_associati', true);
      $corsi_associati = $corsi_associati.','.$post_id;


      update_post_meta(parseInt($lezione_del_corso), 'corsi_associati', $corsi_associati);


    }

    echo 'al server arrriva '.$array_lezioni_del_corso;

}

function nc_savePortable_lezioni_js(){
  ?>
    <script type="text/javascript">
        function saveSortable(sortableArraystringData){

          var data = {
            action: 'nc_savePortable_lezioni_action',
            array_lezioni_del_corso : sortableArraystringData,
            post_id : <? echo get_the_ID(); ?>

          };

          // since 2.8 ajaxurl is always defined in the admin header and points to admin-ajax.php
          $.post(ajaxurl, data, function(response) {
            alert('This was passed ' + sortableArraystringData);
          });
        }

    </script>
  <?php 
}

德拉·法图拉情报局:
蒂波迪尤内特:
英迪里佐·迪法图拉齐翁:
P.IVA:
Inponibile della fattura:
德拉法图拉全集:
Articoli acquistati:

您缺少了一个大括号。

您的括号不匹配-您缺少了一个
}
。一致的代码格式以及不将HTML和PHP混合在一起可以避免此类问题!这些问题总是令人头痛,“尤其是”当涉及到WordPress(插件)时。你的任务甚至可以继续,即使在修复了丢失的支架之后。