@@ 758-780 (lines=23) @@ | ||
755 | * @param int $sectionId |
|
756 | * @return string |
|
757 | */ |
|
758 | public function getSectionName($sectionId) |
|
759 | { |
|
760 | if (!is_numeric($sectionId) || $sectionId < 1) { |
|
761 | return '-'; |
|
762 | } |
|
763 | $select = sprintf(' |
|
764 | SELECT |
|
765 | name |
|
766 | FROM |
|
767 | %sfaqsections |
|
768 | WHERE |
|
769 | id = %d', |
|
770 | DB::getTablePrefix(), |
|
771 | $sectionId |
|
772 | ); |
|
773 | $res = $this->config->getDb()->query($select); |
|
774 | if ($this->config->getDb()->numRows($res) != 1) { |
|
775 | return '-'; |
|
776 | } |
|
777 | $row = $this->config->getDb()->fetchArray($res); |
|
778 | ||
779 | return $row['name']; |
|
780 | } |
|
781 | ||
782 | /** |
|
783 | * Adds a new category $categoryId to the section $sectionId. |
@@ 980-1004 (lines=25) @@ | ||
977 | * |
|
978 | * @return string |
|
979 | */ |
|
980 | public function getGroupName($groupId) |
|
981 | { |
|
982 | if ($groupId <= 0 || !is_numeric($groupId)) { |
|
983 | return '-'; |
|
984 | } |
|
985 | ||
986 | $select = sprintf(' |
|
987 | SELECT |
|
988 | name |
|
989 | FROM |
|
990 | %sfaqgroup |
|
991 | WHERE |
|
992 | group_id = %d', |
|
993 | Db::getTablePrefix(), |
|
994 | $groupId |
|
995 | ); |
|
996 | ||
997 | $res = $this->config->getDb()->query($select); |
|
998 | if ($this->config->getDb()->numRows($res) != 1) { |
|
999 | return '-'; |
|
1000 | } |
|
1001 | $row = $this->config->getDb()->fetchArray($res); |
|
1002 | ||
1003 | return $row['name']; |
|
1004 | } |
|
1005 | ||
1006 | /** |
|
1007 | * Removes all users from the group $groupId. |