| @@ 326-338 (lines=13) @@ | ||
| 323 | * @param int $against |
|
| 324 | * @return int |
|
| 325 | */ |
|
| 326 | public function alreadycomplaint($msg, $by, $against) |
|
| 327 | { |
|
| 328 | global $xoopsDB; |
|
| 329 | $sql = 'SELECT * FROM ' . $xoopsDB->prefix('smallworld_complaints') . " WHERE byuser_id = '" . (int)$by . "' AND owner = '" . (int)$against . "' AND link = '" . addslashes($msg) . "'"; |
|
| 330 | $result = $xoopsDB->queryF($sql); |
|
| 331 | $i = $xoopsDB->getRowsNum($result); |
|
| 332 | if ($i < 1) { |
|
| 333 | $query = 'INSERT INTO ' . $xoopsDB->prefix('smallworld_complaints') . " (complaint_id,link,byuser_id,owner) VALUES ('', '" . addslashes($msg) . "', '" . (int)$by . "', '" . (int)$against . "')"; |
|
| 334 | $result = $xoopsDB->queryF($query); |
|
| 335 | } else { |
|
| 336 | } |
|
| 337 | return $i; |
|
| 338 | } |
|
| 339 | ||
| 340 | /** |
|
| 341 | * updateComplaint function |
|
| @@ 329-341 (lines=13) @@ | ||
| 326 | * @param int $against |
|
| 327 | * @return int |
|
| 328 | */ |
|
| 329 | public function alreadycomplaint($msg, $by, $against) |
|
| 330 | { |
|
| 331 | global $xoopsDB; |
|
| 332 | $sql = 'SELECT * FROM ' . $xoopsDB->prefix('smallworld_complaints') . " WHERE byuser_id = '" . (int)$by . "' AND owner = '" . (int)$against . "' AND link = '" . addslashes($msg) . "'"; |
|
| 333 | $result = $xoopsDB->queryF($sql); |
|
| 334 | $i = $xoopsDB->getRowsNum($result); |
|
| 335 | if ($i < 1) { |
|
| 336 | $query = 'INSERT INTO ' . $xoopsDB->prefix('smallworld_complaints') . " (complaint_id,link,byuser_id,owner) VALUES ('', '" . addslashes($msg) . "', '" . (int)$by . "', '" . (int)$against . "')"; |
|
| 337 | $result = $xoopsDB->queryF($query); |
|
| 338 | } else { |
|
| 339 | } |
|
| 340 | return $i; |
|
| 341 | } |
|
| 342 | ||
| 343 | /** |
|
| 344 | * updateComplaint function |
|