comments.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. /**
  3. * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
  4. * CC-BY License - http://creativecommons.org/licenses/by/3.0/
  5. *
  6. * @defgroup DolphinCore Samples
  7. * @{
  8. */
  9. /**
  10. * @page samples
  11. * @section comments Comments
  12. */
  13. /**
  14. * Please refer to the following file for custom class and SQL dump data for this example:
  15. * @see BxCmtsMy.php
  16. */
  17. $aPathInfo = pathinfo(__FILE__);
  18. require_once ($aPathInfo['dirname'] . '/../inc/header.inc.php');
  19. require_once(BX_DIRECTORY_PATH_INC . "design.inc.php");
  20. bx_import('BxDolAcl');
  21. bx_import('BxDolLanguages');
  22. bx_import('BxTemplFunctions');
  23. $oTemplate = BxDolTemplate::getInstance();
  24. $oTemplate->setPageNameIndex (BX_PAGE_DEFAULT);
  25. $oTemplate->setPageHeader ('Comments');
  26. $oTemplate->setPageContent ('page_main_code', PageCompMainCode());
  27. $oTemplate->getPageCode();
  28. /**
  29. * page code function
  30. */
  31. function PageCompMainCode() {
  32. $iObjectId = 1;
  33. bx_import('BxDolCmts');
  34. $oCmts = BxDolCmts::getObjectInstance('sample', $iObjectId);
  35. if(!$oCmts->isEnabled())
  36. return '';
  37. return $oCmts->getCommentsBlock();
  38. }
  39. /** @} */