| @@ 2499-2527 (lines=29) @@ | ||
| 2496 | * |
|
| 2497 | * @return array |
|
| 2498 | */ |
|
| 2499 | public function getChangeEntries($recordId) |
|
| 2500 | { |
|
| 2501 | $entries = []; |
|
| 2502 | ||
| 2503 | $query = sprintf(' |
|
| 2504 | SELECT |
|
| 2505 | DISTINCT revision_id, usr, datum, what |
|
| 2506 | FROM |
|
| 2507 | %sfaqchanges |
|
| 2508 | WHERE |
|
| 2509 | beitrag = %d |
|
| 2510 | ORDER BY revision_id, datum DESC', |
|
| 2511 | Db::getTablePrefix(), |
|
| 2512 | $recordId |
|
| 2513 | ); |
|
| 2514 | ||
| 2515 | if ($result = $this->config->getDb()->query($query)) { |
|
| 2516 | while ($row = $this->config->getDb()->fetchObject($result)) { |
|
| 2517 | $entries[] = array( |
|
| 2518 | 'revision_id' => $row->revision_id, |
|
| 2519 | 'user' => $row->usr, |
|
| 2520 | 'date' => $row->datum, |
|
| 2521 | 'changelog' => $row->what, |
|
| 2522 | ); |
|
| 2523 | } |
|
| 2524 | } |
|
| 2525 | ||
| 2526 | return $entries; |
|
| 2527 | } |
|
| 2528 | ||
| 2529 | /** |
|
| 2530 | * Retrieve faq records according to the constraints provided. |
|
| @@ 82-106 (lines=25) @@ | ||
| 79 | * |
|
| 80 | * @return array |
|
| 81 | */ |
|
| 82 | public function getAll() |
|
| 83 | { |
|
| 84 | $data = []; |
|
| 85 | ||
| 86 | $query = sprintf(' |
|
| 87 | SELECT |
|
| 88 | id, time, usr, text, ip |
|
| 89 | FROM |
|
| 90 | %sfaqadminlog |
|
| 91 | ORDER BY id DESC', |
|
| 92 | Db::getTablePrefix() |
|
| 93 | ); |
|
| 94 | ||
| 95 | $result = $this->_config->getDb()->query($query); |
|
| 96 | while ($row = $this->_config->getDb()->fetchObject($result)) { |
|
| 97 | $data[$row->id] = array( |
|
| 98 | 'time' => $row->time, |
|
| 99 | 'usr' => $row->usr, |
|
| 100 | 'text' => $row->text, |
|
| 101 | 'ip' => $row->ip, |
|
| 102 | ); |
|
| 103 | } |
|
| 104 | ||
| 105 | return $data; |
|
| 106 | } |
|
| 107 | ||
| 108 | /** |
|
| 109 | * Adds a new adminlog entry. |
|
| @@ 158-183 (lines=26) @@ | ||
| 155 | * |
|
| 156 | * @return array |
|
| 157 | */ |
|
| 158 | public function getAllData() |
|
| 159 | { |
|
| 160 | $data = []; |
|
| 161 | ||
| 162 | $query = sprintf(' |
|
| 163 | SELECT |
|
| 164 | * |
|
| 165 | FROM |
|
| 166 | %sfaqvisits |
|
| 167 | ORDER BY |
|
| 168 | visits DESC', |
|
| 169 | Db::getTablePrefix() |
|
| 170 | ); |
|
| 171 | $result = $this->config->getDb()->query($query); |
|
| 172 | ||
| 173 | while ($row = $this->config->getDb()->fetchObject($result)) { |
|
| 174 | $data[] = [ |
|
| 175 | 'id' => $row->id, |
|
| 176 | 'lang' => $row->lang, |
|
| 177 | 'visits' => $row->visits, |
|
| 178 | 'last_visit' => $row->last_visit, |
|
| 179 | ]; |
|
| 180 | } |
|
| 181 | ||
| 182 | return $data; |
|
| 183 | } |
|
| 184 | ||
| 185 | /** |
|
| 186 | * Resets all visits to current date and one visit per FAQ. |
|