includes/comment.php
changeset 86 c162ca39db8f
parent 78 4df25dfdde63
child 108 1c7f59df9474
equal deleted inserted replaced
85:7c68a18a27be 86:c162ca39db8f
    83     $parser = new Services_JSON(SERVICES_JSON_LOOSE_TYPE);
    83     $parser = new Services_JSON(SERVICES_JSON_LOOSE_TYPE);
    84     $data = $parser->decode($json);
    84     $data = $parser->decode($json);
    85     $data = decode_unicode_array($data);
    85     $data = decode_unicode_array($data);
    86     if ( !isset($data['mode']) )
    86     if ( !isset($data['mode']) )
    87     {
    87     {
    88       return $parser->encode(Array('mode'=>'error','error'=>'No mode defined!'));
    88       $ret = Array('mode'=>'error','error'=>'No mode defined!');
       
    89       echo $parser->encode($ret);
       
    90       return $ret;
       
    91     }
       
    92     if ( getConfig('enable_comments') == '0' )
       
    93     {
       
    94       $ret = Array('mode'=>'error','error'=>'Comments are not enabled on this site.');
       
    95       echo $parser->encode($ret);
       
    96       return $ret;
    89     }
    97     }
    90     $ret = Array();
    98     $ret = Array();
    91     $ret['mode'] = $data['mode'];
    99     $ret['mode'] = $data['mode'];
    92     switch ( $data['mode'] )
   100     switch ( $data['mode'] )
    93     {
   101     {