Skip to content

Instantly share code, notes, and snippets.

@tarto-dev
Created March 14, 2014 13:58
Show Gist options
  • Save tarto-dev/9548152 to your computer and use it in GitHub Desktop.
Save tarto-dev/9548152 to your computer and use it in GitHub Desktop.
WTF DRUDRU
function copris_demande_get_comments() {
die('plouf');
$nid = FALSE;
$json['comments'] = array();
$json['status'] = 400;
$json['message'] = 'Erreur de recuperation des donnees. Soit vous n\'avez pas accès à la node, soit il n\'y à pas de commentaires';
if(!empty($_POST['nid'])) {
$nid = $_POST['nid'];
}
if($nid) {
$node = node_load($nid);
$json['comments'] = comment_get_thread($node, '', 100);
$json['status'] = 200;
$json['message'] = 'success';
}
die('penis');
return drupal_json_output($json);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment