| @@ 344-352 (lines=9) @@ | ||
| 341 | /** |
|
| 342 | * @return bool |
|
| 343 | */ |
|
| 344 | public function delete() |
|
| 345 | { |
|
| 346 | $sql = sprintf('DELETE FROM %s WHERE storyid = %u', $this->table, $this->storyid); |
|
| 347 | if (!$result = $this->db->query($sql)) { |
|
| 348 | return false; |
|
| 349 | } |
|
| 350 | ||
| 351 | return true; |
|
| 352 | } |
|
| 353 | ||
| 354 | /** |
|
| 355 | * @return bool |
|
| @@ 357-365 (lines=9) @@ | ||
| 354 | /** |
|
| 355 | * @return bool |
|
| 356 | */ |
|
| 357 | public function updateCounter() |
|
| 358 | { |
|
| 359 | $sql = sprintf('UPDATE %s SET counter = counter+1 WHERE storyid = %u', $this->table, $this->storyid); |
|
| 360 | if (!$result = $this->db->queryF($sql)) { |
|
| 361 | return false; |
|
| 362 | } |
|
| 363 | ||
| 364 | return true; |
|
| 365 | } |
|
| 366 | ||
| 367 | /** |
|
| 368 | * @param $total |
|
| @@ 372-380 (lines=9) @@ | ||
| 369 | * |
|
| 370 | * @return bool |
|
| 371 | */ |
|
| 372 | public function updateComments($total) |
|
| 373 | { |
|
| 374 | $sql = sprintf('UPDATE %s SET comments = %u WHERE storyid = %u', $this->table, $total, $this->storyid); |
|
| 375 | if (!$result = $this->db->queryF($sql)) { |
|
| 376 | return false; |
|
| 377 | } |
|
| 378 | ||
| 379 | return true; |
|
| 380 | } |
|
| 381 | ||
| 382 | public function topicid() |
|
| 383 | { |
|