Source for file class.Guestbook_Post.inc

Documentation is available at class.Guestbook_Post.inc

  1. <?php //-*-php-*-
  2. /* ******************************************************************** **
  3. ** Copyright notice **
  4. ** **
  5. ** (c) 1995-2003 PHPOpenChat Development Team **
  6. ** http://phpopenchat.sourceforge.net/ **
  7. ** **
  8. ** All rights reserved **
  9. ** **
  10. ** This script is part of the PHPOpenChat project. The PHPOpenChat **
  11. ** project is free software; you can redistribute it and/or modify **
  12. ** it under the terms of the GNU General Public License as published by **
  13. ** the Free Software Foundation; either version 2 of the License, or **
  14. ** (at your option) any later version. **
  15. ** **
  16. ** The GNU General Public License can be found at **
  17. ** http://www.gnu.org/copyleft/gpl.html. **
  18. ** A copy is found in the textfile GPL and important notices to the **
  19. ** license from the team is found in the textfile LICENSE distributed **
  20. ** with these scripts. **
  21. ** **
  22. ** This script is distributed in the hope that it will be useful, **
  23. ** but WITHOUT ANY WARRANTY; without even the implied warranty of **
  24. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the **
  25. ** GNU General Public License for more details. **
  26. ** **
  27. ** This copyright notice MUST APPEAR in all copies of the script! **
  28. ** ******************************************************************** */
  29.  
  30. //has to be moved to config in the future
  31. define('TIME_FORMAT', 'Y-m-d h:i:s');
  32.  
  33. /**
  34. * Get default values
  35. */
  36. require_once(POC_BASE.'/config.inc.php');
  37. require_once(POC_INCLUDE_PATH.'/class.Logger.inc');
  38.  
  39. /**
  40. * Class Guestbook_Post describes a guestbook post written by chatters
  41. *
  42. * @package phpopenchat
  43. * @author Michael Oertel <michael@ortelius.de>
  44. * @access public
  45. * @version $Id: class.Guestbook_Post.inc,v 1.2 2003/08/06 12:19:36 letreo Exp $
  46. */
  47. class Guestbook_Post {
  48.  
  49. /**
  50. * chatter object represents a person taking part in a chat session
  51. *
  52. * @var object
  53. */
  54. var $sender = null;
  55.  
  56. /**
  57. * Time of post
  58. *
  59. * @var integer
  60. */
  61. var $time = 0;
  62.  
  63. /**
  64. * Content of post
  65. *
  66. * @var string
  67. */
  68. var $said = '';
  69.  
  70. /**
  71. * Constructor for class Guestbook
  72. *
  73. * @param object $chatter chatter object represents a person taking part in a chat session
  74. */
  75. function Guestbook_Post( $sender )
  76. {
  77. if( !is_object($sender) ) die('Object expected');
  78. $this->sender = $sender;
  79. }
  80. function set_time( $time = null )
  81. {
  82. if( !is_null($time) && !is_integer($time) ) die('Integer expected');
  83. $this->time =( is_null($time) )? time():$time;
  84. }
  85. function get_time()
  86. {
  87. return date(TIME_FORMAT,$this->time);
  88. }
  89. function get_db_time()
  90. {
  91. return $this->time;
  92. }
  93.  
  94. function get_sender()
  95. {
  96. return $this->sender;
  97. }
  98. function set_said( $said )
  99. {
  100. if( !is_string($said) ) return false;
  101. $this->said = $said;
  102. }
  103. function get_said()
  104. {
  105. return $this->said;
  106. }
  107. function get_content()
  108. {
  109. return $this->get_said();
  110. }
  111. }
  112. ?>

Documentation generated on Tue, 29 Jun 2004 14:42:05 +0200 by phpDocumentor 1.3.0RC3