19 defined(
'XOOPS_ROOT_PATH') or die('Restricted access');
68 function id($format =
'N')
70 return $this->getVar(
'com_id', $format);
76 function com_id($format =
'')
78 return $this->getVar(
'com_id', $format);
84 function com_pid($format =
'')
86 return $this->getVar(
'com_pid', $format);
92 function com_modid($format =
'')
94 return $this->getVar(
'com_modid', $format);
100 function com_icon($format =
'')
102 return $this->getVar(
'com_icon', $format);
108 function com_title($format =
'')
110 return $this->getVar(
'com_title', $format);
116 function com_text($format =
'')
118 return $this->getVar(
'com_text', $format);
124 function com_created($format =
'')
126 return $this->getVar(
'com_created', $format);
133 return $this->getVar(
'com_modified', $format);
139 function com_uid($format =
'')
141 return $this->getVar(
'com_uid', $format);
148 function com_user($format =
'')
150 return $this->getVar(
'com_user', $format);
155 function com_email($format =
'')
157 return $this->getVar(
'com_email', $format);
162 function com_url($format =
'')
164 return $this->getVar(
'com_url', $format);
171 function com_ip($format =
'')
173 return $this->getVar(
'com_ip', $format);
179 function com_sig($format =
'')
181 return $this->getVar(
'com_sig', $format);
187 function com_itemid($format =
'')
189 return $this->getVar(
'com_itemid', $format);
195 function com_rootid($format =
'')
197 return $this->getVar(
'com_rootid', $format);
203 function com_status($format =
'')
205 return $this->getVar(
'com_status', $format);
211 function com_exparams($format =
'')
213 return $this->getVar(
'com_exparams', $format);
219 function dohtml($format =
'')
221 return $this->getVar(
'dohtml', $format);
227 function dosmiley($format =
'')
229 return $this->getVar(
'dosmiley', $format);
235 function doxcode($format =
'')
237 return $this->getVar(
'doxcode', $format);
243 function doimage($format =
'')
245 return $this->getVar(
'doimage', $format);
251 function dobr($format =
'')
253 return $this->getVar(
'dobr', $format);
263 return ($this->getVar(
'com_id') == $this->getVar(
'com_rootid'));
310 $sql =
'SELECT * FROM ' . $this->db->prefix(
'xoopscomments') .
' WHERE com_id=' . $id;
314 $numrows = $this->db->getRowsNum(
$result);
335 if (!is_a(
$comment,
'xoopscomment')) {
344 foreach(
$comment->cleanVars as $k => $v) {
349 $com_id = $this->db->genId(
'xoopscomments_com_id_seq');
350 $sql = sprintf(
"INSERT INTO %s (com_id, com_pid, com_modid, com_icon, com_title, com_text, com_created, com_modified, com_uid, com_user, com_email, com_url, com_ip, com_sig, com_itemid, com_rootid, com_status, com_exparams, dohtml, dosmiley, doxcode, doimage, dobr) VALUES (%u, %u, %u, %s, %s, %s, %u, %u, %u, %s, %s, %s, %s, %u, %u, %u, %u, %s, %u, %u, %u, %u, %u)", $this->db->prefix(
'xoopscomments'),
$com_id,
$com_pid,
$com_modid, $this->db->quoteString(
$com_icon), $this->db->quoteString(
$com_title), $this->db->quoteString(
$com_text), $com_created, $com_modified, $com_uid, $this->db->quoteString(
$com_user), $this->db->quoteString(
$com_email), $this->db->quoteString(
$com_url), $this->db->quoteString($com_ip), $com_sig,
$com_itemid,
$com_rootid,
$com_status, $this->db->quoteString($com_exparams),
$dohtml,
$dosmiley,
$doxcode,
$doimage,
$dobr);
352 $sql = sprintf(
"UPDATE %s SET com_pid = %u, com_icon = %s, com_title = %s, com_text = %s, com_created = %u, com_modified = %u, com_uid = %u, com_user = %s, com_email = %s, com_url = %s, com_ip = %s, com_sig = %u, com_itemid = %u, com_rootid = %u, com_status = %u, com_exparams = %s, dohtml = %u, dosmiley = %u, doxcode = %u, doimage = %u, dobr = %u WHERE com_id = %u", $this->db->prefix(
'xoopscomments'),
$com_pid, $this->db->quoteString(
$com_icon), $this->db->quoteString(
$com_title), $this->db->quoteString(
$com_text), $com_created, $com_modified, $com_uid, $this->db->quoteString(
$com_user), $this->db->quoteString(
$com_email), $this->db->quoteString(
$com_url), $this->db->quoteString($com_ip), $com_sig,
$com_itemid,
$com_rootid,
$com_status, $this->db->quoteString($com_exparams),
$dohtml,
$dosmiley,
$doxcode,
$doimage,
$dobr,
$com_id);
359 $com_id = $this->db->getInsertId();
377 if (!is_a(
$comment,
'xoopscomment')) {
380 $sql = sprintf(
"DELETE FROM %s WHERE com_id = %u", $this->db->prefix(
'xoopscomments'),
$comment->getVar(
'com_id'));
399 $sql =
'SELECT * FROM ' . $this->db->prefix(
'xoopscomments');
411 while ($myrow = $this->db->fetchArray(
$result)) {
433 $sql =
'SELECT COUNT(*) FROM ' . $this->db->prefix(
'xoopscomments');
440 list ($count) = $this->db->fetchRow(
$result);
453 $sql =
'DELETE FROM ' . $this->db->prefix(
'xoopscomments');
581 $comment->setVar($field_name, $field_value);