Retroceder   Foros del Web > Diseño de Sitios web > Aplicaciones pre-fabricadas > Wordpress

Respuesta
 
Herramientas Desplegado
Antiguo 23-ene-2008, 11:54   #1 (permalink)
hernan11 ha deshabilitado el karma
 
Fecha de Ingreso: mayo-2007
Mensajes: 2
Error al dejar comentario en WordPress

Acá está la entrada
http://www.hpaz.com.ar/blog/disfruta-del-poder-y-la-belleza-de-tu-juventud/

El problema está en que cuando quiero poner un comentario, me sale el siguiente error

Fatal error: Call to a member function on a non-object in /www/mdgcontenidos/htdocs/hpaz/blog/wp-content/themes/elite/Elite/comments-ajax.php on line 21

Este es el codigo del comments-ajax.php

Código :

Código:
<?php
require_once('http://www.hpaz.com.ar/blog/wp-config.php');

global $comment, $comments, $post, $wpdb, $user_ID, $user_identity, $user_email, $user_url;


function fail($s) {
   header('HTTP/1.0 500 Internal Server Error');
   echo $s;
   exit;
}

   

foreach($_POST as $k=>$v) {
   $_POST[$k] = urldecode($v);
}

$comment_post_ID = (int) $_POST['comment_post_ID'];

$post_status = $wpdb->get_var("SELECT comment_status FROM $wpdb->posts WHERE ID = '$comment_post_ID'");

if ( empty($post_status) ) {
   do_action('comment_id_not_found', $comment_post_ID);
   fail('The post you are trying to comment on does not curently exist in the database.');
} elseif ( 'closed' ==  $post_status ) {
   do_action('comment_closed', $comment_post_ID);
   fail(__('Sorry, comments are closed for this item.'));
}

$comment_author       = trim($_POST['author']);
$comment_author_email = trim($_POST['email']);
$comment_author_url   = trim($_POST['url']);
$comment_content      = trim($_POST['comment']);

// If the user is logged in
get_currentuserinfo();
if ( $user_ID ) :
   $comment_author       = addslashes($user_identity);
   $comment_author_email = addslashes($user_email);
   $comment_author_url   = addslashes($user_url);
else :
   if ( get_option('comment_registration') )
      fail(__('Sorry, you must be logged in to post a comment.'));
endif;

$comment_type = '';

if ( get_settings('require_name_email') && !$user_ID ) {
   if ( 6 > strlen($comment_author_email) || '' == $comment_author )
      fail(__('Error: please fill the required fields (name, email).'));
   elseif ( !is_email($comment_author_email))
      fail(__('Error: please enter a valid email address.'));
}

if ( '' == $comment_content )
   fail(__('Error: please type a comment.'));

$commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'comment_type', 'user_ID');

$new_comment_ID = wp_new_comment($commentdata);

if ( !$user_ID ) :
        setcookie('comment_author_' . COOKIEHASH, stripslashes($comment_author), time() + 30000000, COOKIEPATH, COOKIE_DOMAIN);
        setcookie('comment_author_email_' . COOKIEHASH, stripslashes($comment_author_email), time() + 30000000, COOKIEPATH, COOKIE_DOMAIN);
        setcookie('comment_author_url_' . COOKIEHASH, stripslashes($comment_author_url), time() + 30000000, COOKIEPATH, COOKIE_DOMAIN);
endif;

$comment = $wpdb->get_row("SELECT * FROM {$wpdb->comments} WHERE comment_ID = " . $new_comment_ID);

$post->comment_status = $wpdb->get_var("SELECT comment_status FROM {$wpdb->posts} WHERE ID = {$comment_post_ID}");

ob_start();
$comments = array($comment);
include(TEMPLATEPATH . '/comments.php');
$commentout = ob_get_clean();
preg_match('#<li(.*?)>(.*)</li>#ims', $commentout, $matches);
echo "<li style=\"display:none\"".$matches[1].">".$matches[2]."</li>";

?>


La linea 21 a la que hace referencia es esta

Código :
Código:
$post_status = $wpdb->get_var("SELECT comment_status FROM $wpdb->posts WHERE ID = '$comment_post_ID'");


+ Probe bajandome de nuevo el theme original y pisando los archivos, pero nada. Sigue de la misma manera, dando el mismo error.

+ Busque el error en google, pero no sale nada.

+ Tengo la Version 2.3.2 de WordPress.



HELP !


Muchas Gracias!!!
hernan11 está desconectado   Responder Citando
Respuesta

No hay votos aún.


Herramientas
Desplegado

Normas de Publicación
No puedes crear nuevos temas
No puedes responder temas
No puedes subir archivos adjuntos
No puedes editar tus mensajes

BB code is Activado
Caritas están Activado
[IMG] está Activado
Código HTML está Desactivado


La Zona horaria es GMT -6. Ahora son las 04:25.


Message Board Statistics

LinkBacks Enabled by vBSEO 3.1.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96