| @@ 291-299 (lines=9) @@ | ||
| 288 | /** |
|
| 289 | * @return bool |
|
| 290 | */ |
|
| 291 | public function delete() |
|
| 292 | { |
|
| 293 | $sql = sprintf('DELETE FROM %s WHERE storyid = %u', $this->table, $this->storyid); |
|
| 294 | if (!$result = $this->db->query($sql)) { |
|
| 295 | return false; |
|
| 296 | } |
|
| 297 | ||
| 298 | return true; |
|
| 299 | } |
|
| 300 | ||
| 301 | /** |
|
| 302 | * @return bool |
|
| @@ 304-312 (lines=9) @@ | ||
| 301 | /** |
|
| 302 | * @return bool |
|
| 303 | */ |
|
| 304 | public function updateCounter() |
|
| 305 | { |
|
| 306 | $sql = sprintf('UPDATE %s SET counter = counter+1 WHERE storyid = %u', $this->table, $this->storyid); |
|
| 307 | if (!$result = $this->db->queryF($sql)) { |
|
| 308 | return false; |
|
| 309 | } |
|
| 310 | ||
| 311 | return true; |
|
| 312 | } |
|
| 313 | ||
| 314 | /** |
|
| 315 | * @param $total |
|
| @@ 319-327 (lines=9) @@ | ||
| 316 | * |
|
| 317 | * @return bool |
|
| 318 | */ |
|
| 319 | public function updateComments($total) |
|
| 320 | { |
|
| 321 | $sql = sprintf('UPDATE %s SET comments = %u WHERE storyid = %u', $this->table, $total, $this->storyid); |
|
| 322 | if (!$result = $this->db->queryF($sql)) { |
|
| 323 | return false; |
|
| 324 | } |
|
| 325 | ||
| 326 | return true; |
|
| 327 | } |
|
| 328 | ||
| 329 | public function topicid() |
|
| 330 | { |
|