Reputation.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. /**
  3. *
  4. * PHP Pro Bid $Id$ /hUzA/d/lsDObXj/yDUpPZrTott3xGoV8tph/Uvm1Wo=
  5. *
  6. * @link http://www.phpprobid.com
  7. * @copyright Copyright (c) 2016 Online Ventures Software & CodeCube SRL
  8. * @license http://www.phpprobid.com/license Commercial License
  9. *
  10. * @version 7.8
  11. */
  12. /**
  13. * reputation table row object model
  14. */
  15. namespace Ppb\Db\Table\Row;
  16. class Reputation extends AbstractRow
  17. {
  18. /**
  19. *
  20. * checks if the reputation comments can be shown.
  21. *
  22. *
  23. * @param bool $admin
  24. * @return bool
  25. */
  26. public function canShowComments($admin = false)
  27. {
  28. if ($admin) {
  29. return true;
  30. }
  31. $settings = $this->getSettings();
  32. if (!$settings['private_reputation']) {
  33. return true;
  34. }
  35. else {
  36. $user = $this->getUser();
  37. if (in_array($user['id'], array_filter(array($this->getData('poster_id'), $this->getData('user_id'))))) {
  38. return true;
  39. }
  40. }
  41. return false;
  42. }
  43. }