| @@ 106-112 (lines=7) @@ | ||
| 103 | * @param int $userid |
|
| 104 | * @return int |
|
| 105 | */ |
|
| 106 | public function count($userid) |
|
| 107 | { |
|
| 108 | $sql = 'SELECT * FROM ' . $GLOBALS['xoopsDB']->prefix('smallworld_images') . " WHERE userid = '" . $userid . "'"; |
|
| 109 | $result = $GLOBALS['xoopsDB']->queryF($sql); |
|
| 110 | ||
| 111 | return $GLOBALS['xoopsDB']->getRowsNum($result); |
|
| 112 | } |
|
| 113 | } |
|
| 114 | ||
| @@ 179-185 (lines=7) @@ | ||
| 176 | * saveImage function |
|
| 177 | * @param $values |
|
| 178 | */ |
|
| 179 | public function saveImage($values) |
|
| 180 | { |
|
| 181 | $myts = \MyTextSanitizer::getInstance(); |
|
| 182 | $sql = 'INSERT INTO ' . $GLOBALS['xoopsDB']->prefix('smallworld_images') . ' VALUES (' . $values . ')'; |
|
| 183 | $result = $GLOBALS['xoopsDB']->queryF($sql); |
|
| 184 | return $result; |
|
| 185 | } |
|
| 186 | ||
| 187 | /** |
|
| 188 | * DeleteImage function |
|
| @@ 192-199 (lines=8) @@ | ||
| 189 | * @param int $userid |
|
| 190 | * @param string $imagename |
|
| 191 | */ |
|
| 192 | public function deleteImage($userid, $imagename) |
|
| 193 | { |
|
| 194 | $myts = \MyTextSanitizer::getInstance(); |
|
| 195 | $sql = 'DELETE FROM ' . $GLOBALS['xoopsDB']->prefix('smallworld_images') . " WHERE imgname = '" . stripslashes($imagename) . "' AND userid='" . (int)$userid . "'"; |
|
| 196 | $result = $GLOBALS['xoopsDB']->queryF($sql); |
|
| 197 | ||
| 198 | return $result; |
|
| 199 | } |
|
| 200 | ||
| 201 | /** |
|
| 202 | * handlePosts function |
|