| @@ 455-476 (lines=22) @@ | ||
| 452 | * |
|
| 453 | * @return string |
|
| 454 | */ |
|
| 455 | public function getTagNameById($tagId) |
|
| 456 | { |
|
| 457 | if (!is_numeric($tagId)) { |
|
| 458 | return; |
|
| 459 | } |
|
| 460 | ||
| 461 | $query = sprintf(' |
|
| 462 | SELECT |
|
| 463 | tagging_name |
|
| 464 | FROM |
|
| 465 | %sfaqtags |
|
| 466 | WHERE |
|
| 467 | tagging_id = %d', |
|
| 468 | PMF_Db::getTablePrefix(), |
|
| 469 | $tagId |
|
| 470 | ); |
|
| 471 | ||
| 472 | $result = $this->_config->getDb()->query($query); |
|
| 473 | if ($row = $this->_config->getDb()->fetchObject($result)) { |
|
| 474 | return $row->tagging_name; |
|
| 475 | } |
|
| 476 | } |
|
| 477 | ||
| 478 | /** |
|
| 479 | * Returns the HTML for the Tags Cloud. |
|
| @@ 2286-2304 (lines=19) @@ | ||
| 2283 | * |
|
| 2284 | * @return integer |
|
| 2285 | */ |
|
| 2286 | public function getNumberOfVotings($record_id) |
|
| 2287 | { |
|
| 2288 | $query = sprintf( |
|
| 2289 | 'SELECT |
|
| 2290 | usr |
|
| 2291 | FROM |
|
| 2292 | %sfaqvoting |
|
| 2293 | WHERE |
|
| 2294 | artikel = %d', |
|
| 2295 | PMF_Db::getTablePrefix(), |
|
| 2296 | $record_id); |
|
| 2297 | if ($result = $this->_config->getDb()->query($query)) { |
|
| 2298 | if ($row = $this->_config->getDb()->fetchObject($result)) { |
|
| 2299 | return $row->usr; |
|
| 2300 | } |
|
| 2301 | } |
|
| 2302 | ||
| 2303 | return 0; |
|
| 2304 | } |
|
| 2305 | ||
| 2306 | /** |
|
| 2307 | * Adds a new voting record. |
|