| @@ 6523-6536 (lines=14) @@ | ||
| 6520 | * |
|
| 6521 | * @return string |
|
| 6522 | */ |
|
| 6523 | public function totalUserJournal() { |
|
| 6524 | try { |
|
| 6525 | $number = (int) Database::prepare("SELECT SQL_CACHE COUNT(*) FROM `##news` WHERE user_id = ?") |
|
| 6526 | ->execute([Auth::id()]) |
|
| 6527 | ->fetchOne(); |
|
| 6528 | } catch (PDOException $ex) { |
|
| 6529 | DebugBar::addThrowable($ex); |
|
| 6530 | ||
| 6531 | // The module may not be installed, so the table may not exist. |
|
| 6532 | $number = 0; |
|
| 6533 | } |
|
| 6534 | ||
| 6535 | return I18N::number($number); |
|
| 6536 | } |
|
| 6537 | ||
| 6538 | /** |
|
| 6539 | * How many news items exist for this tree. |
|
| @@ 6543-6556 (lines=14) @@ | ||
| 6540 | * |
|
| 6541 | * @return string |
|
| 6542 | */ |
|
| 6543 | public function totalGedcomNews() { |
|
| 6544 | try { |
|
| 6545 | $number = (int) Database::prepare("SELECT SQL_CACHE COUNT(*) FROM `##news` WHERE gedcom_id = ?") |
|
| 6546 | ->execute([$this->tree->getTreeId()]) |
|
| 6547 | ->fetchOne(); |
|
| 6548 | } catch (PDOException $ex) { |
|
| 6549 | DebugBar::addThrowable($ex); |
|
| 6550 | ||
| 6551 | // The module may not be installed, so the table may not exist. |
|
| 6552 | $number = 0; |
|
| 6553 | } |
|
| 6554 | ||
| 6555 | return I18N::number($number); |
|
| 6556 | } |
|
| 6557 | ||
| 6558 | /** |
|
| 6559 | * ISO3166 3 letter codes, with their 2 letter equivalent. |
|