@@ 1120-1135 (lines=16) @@ | ||
1117 | * |
|
1118 | * @return bool |
|
1119 | */ |
|
1120 | public function deleteCategoryRelations($record_id, $record_lang) |
|
1121 | { |
|
1122 | $query = sprintf(" |
|
1123 | DELETE FROM |
|
1124 | %sfaqcategoryrelations |
|
1125 | WHERE |
|
1126 | record_id = %d |
|
1127 | AND |
|
1128 | record_lang = '%s'", |
|
1129 | PMF_Db::getTablePrefix(), |
|
1130 | $record_id, |
|
1131 | $record_lang); |
|
1132 | $this->_config->getDb()->query($query); |
|
1133 | ||
1134 | return true; |
|
1135 | } |
|
1136 | ||
1137 | /** |
|
1138 | * Returns an array with all data from a FAQ record. |
|
@@ 1498-1516 (lines=19) @@ | ||
1495 | * |
|
1496 | * @return array |
|
1497 | */ |
|
1498 | public function addNewRevision($record_id, $record_lang) |
|
1499 | { |
|
1500 | $query = sprintf(" |
|
1501 | INSERT INTO |
|
1502 | %sfaqdata_revisions |
|
1503 | SELECT * FROM |
|
1504 | %sfaqdata |
|
1505 | WHERE |
|
1506 | id = %d |
|
1507 | AND |
|
1508 | lang = '%s'", |
|
1509 | PMF_Db::getTablePrefix(), |
|
1510 | PMF_Db::getTablePrefix(), |
|
1511 | $record_id, |
|
1512 | $record_lang); |
|
1513 | $this->_config->getDb()->query($query); |
|
1514 | ||
1515 | return true; |
|
1516 | } |
|
1517 | ||
1518 | /** |
|
1519 | * Returns the keywords of a FAQ record from the ID and language. |
|
@@ 1709-1726 (lines=18) @@ | ||
1706 | * |
|
1707 | * @return bool |
|
1708 | */ |
|
1709 | public function deleteQuestion($questionId) |
|
1710 | { |
|
1711 | $delete = sprintf(" |
|
1712 | DELETE FROM |
|
1713 | %sfaqquestions |
|
1714 | WHERE |
|
1715 | id = %d |
|
1716 | AND |
|
1717 | lang = '%s'", |
|
1718 | PMF_Db::getTablePrefix(), |
|
1719 | $questionId, |
|
1720 | $this->_config->getLanguage()->getLanguage() |
|
1721 | ); |
|
1722 | ||
1723 | $this->_config->getDb()->query($delete); |
|
1724 | ||
1725 | return true; |
|
1726 | } |
|
1727 | ||
1728 | /** |
|
1729 | * Returns the visibility of a question. |
|
@@ 1769-1789 (lines=21) @@ | ||
1766 | * |
|
1767 | * @return bool |
|
1768 | */ |
|
1769 | public function setVisibilityOfQuestion($questionId, $isVisible) |
|
1770 | { |
|
1771 | $query = sprintf(" |
|
1772 | UPDATE |
|
1773 | %sfaqquestions |
|
1774 | SET |
|
1775 | is_visible = '%s' |
|
1776 | WHERE |
|
1777 | id = %d |
|
1778 | AND |
|
1779 | lang = '%s'", |
|
1780 | PMF_Db::getTablePrefix(), |
|
1781 | $isVisible, |
|
1782 | $questionId, |
|
1783 | $this->_config->getLanguage()->getLanguage() |
|
1784 | ); |
|
1785 | ||
1786 | $this->_config->getDb()->query($query); |
|
1787 | ||
1788 | return true; |
|
1789 | } |
|
1790 | ||
1791 | /** |
|
1792 | * This function generates a data-set with the mosted voted recors. |
@@ 312-329 (lines=18) @@ | ||
309 | * |
|
310 | * @return bool |
|
311 | */ |
|
312 | public function deleteGlossaryItem($id) |
|
313 | { |
|
314 | $query = sprintf(" |
|
315 | DELETE FROM |
|
316 | %sfaqglossary |
|
317 | WHERE |
|
318 | id = %d AND lang = '%s'", |
|
319 | PMF_Db::getTablePrefix(), |
|
320 | (int) $id, |
|
321 | $this->config->getLanguage()->getLanguage() |
|
322 | ); |
|
323 | ||
324 | if ($this->config->getDb()->query($query)) { |
|
325 | return true; |
|
326 | } |
|
327 | ||
328 | return false; |
|
329 | } |
|
330 | } |
|
331 |
@@ 61-74 (lines=14) @@ | ||
58 | * |
|
59 | * @return int |
|
60 | */ |
|
61 | public function getNumberOfEntries() |
|
62 | { |
|
63 | $query = sprintf(' |
|
64 | SELECT |
|
65 | id |
|
66 | FROM |
|
67 | %sfaqadminlog', |
|
68 | PMF_Db::getTablePrefix() |
|
69 | ); |
|
70 | ||
71 | return $this->_config->getDb()->numRows( |
|
72 | $this->_config->getDb()->query($query) |
|
73 | ); |
|
74 | } |
|
75 | ||
76 | /** |
|
77 | * Returns all data from the adminlog. |
@@ 396-415 (lines=20) @@ | ||
393 | * |
|
394 | * @return bool |
|
395 | */ |
|
396 | public function deleteNews($id) |
|
397 | { |
|
398 | $query = sprintf( |
|
399 | "DELETE FROM |
|
400 | %sfaqnews |
|
401 | WHERE |
|
402 | id = %d |
|
403 | AND |
|
404 | lang = '%s'", |
|
405 | PMF_Db::getTablePrefix(), |
|
406 | $id, |
|
407 | $this->_config->getLanguage()->getLanguage() |
|
408 | ); |
|
409 | ||
410 | if (!$this->_config->getDb()->query($query)) { |
|
411 | return false; |
|
412 | } |
|
413 | ||
414 | return true; |
|
415 | } |
|
416 | } |
|
417 |
@@ 273-288 (lines=16) @@ | ||
270 | * |
|
271 | * @return bool |
|
272 | */ |
|
273 | public function updateTag(PMF_Entity_Tags $entity) |
|
274 | { |
|
275 | $query = sprintf(" |
|
276 | UPDATE |
|
277 | %sfaqtags |
|
278 | SET |
|
279 | tagging_name = '%s' |
|
280 | WHERE |
|
281 | tagging_id = %d", |
|
282 | PMF_Db::getTablePrefix(), |
|
283 | $entity->getName(), |
|
284 | $entity->getId() |
|
285 | ); |
|
286 | ||
287 | return $this->_config->getDb()->query($query); |
|
288 | } |
|
289 | ||
290 | /** |
|
291 | * Deletes all tags from a given record id. |
@@ 1458-1472 (lines=15) @@ | ||
1455 | * |
|
1456 | * @return int |
|
1457 | */ |
|
1458 | public function numParent($parent_id) |
|
1459 | { |
|
1460 | $query = sprintf(' |
|
1461 | SELECT distinct |
|
1462 | id |
|
1463 | FROM |
|
1464 | %sfaqcategories |
|
1465 | WHERE |
|
1466 | parent_id = %d', |
|
1467 | PMF_Db::getTablePrefix(), |
|
1468 | $parent_id); |
|
1469 | $result = $this->_config->getDb()->query($query); |
|
1470 | ||
1471 | return $this->_config->getDb()->numRows($result); |
|
1472 | } |
|
1473 | ||
1474 | /** |
|
1475 | * Adds the category permissions for users and groups. |