Hi, I have version 2.40 so you must check your code against mine.
Look in class/msg.php and replace this method:
function insert(&$msg)
{
if (strtolower(get_class($msg)) != 'xfguestbookmsg') {
return false;
}
if (!$msg->cleanVars()) {
return false;
}
foreach ($msg->cleanVars as $k => $v) {
${$k} = $v;
}
if (empty($msg_id)) {
$msg_id = $this->db->genId('xfguestbook_msg_msg_id_seq');
$sql = 'INSERT INTO '.$this->db->prefix('xfguestbook_msg').' (msg_id, user_id, uname, title, message, note, post_time, email, url, poster_ip, moderate, gender, country, photo, flagdir, other) VALUES ('.$msg_id.','.$user_id.', '.$this->db->quoteString($uname).', '.$this->db->quoteString($title).', '.$this->db->quoteString($message).', '.$this->db->quoteString($note).', '.$post_time.', '.$this->db->quoteString($email).', '.$this->db->quoteString($url).', '.$this->db->quoteString($poster_ip).', '.$moderate.', '.$this->db->quoteString($gender).', '.$this->db->quoteString($country).', '.$this->db->quoteString($photo).', '.$this->db->quoteString($flagdir).', '.$this->db->quoteString($other).')';
} else {
$sql = 'UPDATE '.$this->db->prefix('xfguestbook_msg').' SET user_id='.$user_id.', uname='.$this->db->quoteString($uname).', title='.$this->db->quoteString($title).', message='.$this->db->quoteString($message).', note='.$this->db->quoteString($note).', email='.$this->db->quoteString($email).', url='.$this->db->quoteString($url).', moderate='.$moderate.', gender='.$this->db->quoteString($gender).', country='.$this->db->quoteString($country).', photo='.$this->db->quoteString($photo).', flagdir='.$this->db->quoteString($flagdir).', other='.$this->db->quoteString($other).' WHERE msg_id='.$msg_id;
}
if (!$result = $this->db->queryF($sql)) {
return false;
}
if (empty($msg_id)) {
$msg_id = $this->db->getInsertId();
// Hack for increment user posts by trabis
$member_handler = xoops_gethandler('member');
$poster = $member_handler->getUser(intval($user_id));
if (is_object($poster)) {
$poster->setVar('posts', $poster->getVar('posts') + 1);
$member_handler->insertUser($poster, true));
}
// End of hack
}
$msg->assignVar('msg_id', $msg_id);
return $msg_id;
}